/* ============================================
   FUNNEL MINI APP — Global Styles
   Telegram Mini App для записи на консультацию
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --bg-primary: #0A0A0B;
  --bg-secondary: #141416;
  --bg-card: #1C1C1F;
  --bg-gradient: linear-gradient(145deg, #0A0A0B 0%, #12121A 50%, #0A0A0B 100%);
  
  --accent: #E85A4F;
  --accent-glow: rgba(232, 90, 79, 0.25);
  --accent-hover: #FF6B5B;
  --accent-soft: rgba(232, 90, 79, 0.12);
  
  --text-primary: #FAFAFA;
  --text-secondary: #8A8A8E;
  --text-muted: #5A5A5E;
  
  --success: #3DD68C;
  --success-soft: rgba(61, 214, 140, 0.12);
  
  --border: #2A2A2E;
  --border-hover: #3A3A3E;
  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-glow: 0 0 40px var(--accent-glow);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Screen Container */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  animation: screenIn 0.4s var(--transition-slow);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
}

.back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: -8px;
}

.back-btn:hover {
  color: var(--text-secondary);
}

.back-btn:active {
  transform: scale(0.92);
  color: var(--text-primary);
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

/* Content Area */
.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Typography */
.screen-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 32px;
}

.screen-question {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* Audio Player */
.audio-player {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.audio-player-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-play-btn {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.audio-play-btn:active {
  transform: scale(0.92);
}

.audio-play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.audio-play-btn.playing svg {
  margin-left: 0;
}

.audio-info {
  flex: 1;
  min-width: 0;
}

.audio-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.audio-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 32px;
}

.audio-bar {
  width: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.audio-bar.active {
  background: var(--accent);
}

.audio-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Option Buttons */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-btn:active {
  transform: scale(0.98);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 20px;
}

.option-text {
  flex: 1;
}

.option-arrow {
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.option-btn:active .option-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 18px 32px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary Button */
.btn-secondary {
  width: 100%;
  padding: 18px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:active {
  transform: scale(0.98);
  border-color: var(--border-hover);
}

/* Text Link */
.text-link {
  display: block;
  text-align: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 15px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.text-link:active {
  color: var(--accent);
}

/* Footer Actions */
.screen-footer {
  margin-top: auto;
  padding-top: 24px;
}

.footer-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 24px;
}

.card-label {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
}

.card-text {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Highlight Box */
.highlight-box {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.highlight-box p {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
}

/* Price Tag */
.price-tag {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 24px 0;
}

.price-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-currency {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-period {
  font-size: 16px;
  color: var(--text-muted);
}

/* Case Image */
.case-image {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 16px 0;
}

/* Checklist */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  line-height: 1.5;
}

.checklist-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 50%;
  font-size: 14px;
}

/* Swipe Hint */
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.swipe-dots {
  display: flex;
  gap: 6px;
}

.swipe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.swipe-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-up {
  animation: slideUp 0.5s var(--transition-slow) forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* Responsive */
@media (min-width: 400px) {
  .screen {
    padding: 32px 24px;
  }
  
  .screen-title {
    font-size: 32px;
  }
}

/* Safe areas for notched devices */
@supports (padding: max(0px)) {
  .screen {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}
