/* ============================================
   EXPÓPTICA — Pantalla Táctil 1920×1080
   Design System & Styles
   ============================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ── */
:root {
  /* Colors - Beltone Kiosk 2026 */
  --c-bg-start: #0b1326;
  --c-bg-mid: #171f33;
  --c-bg-end: #060e20;
  --c-primary: #FF8C00; /* Copper / Orange action */
  --c-primary-light: #ffb77d;
  --c-primary-glow: rgba(255, 140, 0, 0.4);
  --c-accent: #a7c8ff; /* Ice Blue texts/accents */
  --c-accent-warm: #fd8b00; /* Darker copper */
  --c-success: #4CAF50;
  --c-success-glow: rgba(76, 175, 80, 0.3);
  --c-danger: #ef5350;
  --c-white: #ffffff;
  --c-text: #dae2fd;
  --c-text-dim: #a7c8ff;
  --c-text-muted: #8c919c;
  --c-card-bg: rgba(45, 52, 73, 0.25); /* surface_container_highest */
  --c-card-border: rgba(167, 200, 255, 0.1);
  --c-card-hover: rgba(45, 52, 73, 0.4);
  --c-glass: rgba(11, 19, 38, 0.3);
  --c-glass-border: rgba(167, 200, 255, 0.15); /* Ghost border */
  --c-input-bg: rgba(45, 52, 73, 0.2);
  --c-input-border: rgba(167, 200, 255, 0.15);
  --c-input-focus: var(--c-primary);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;
  --gap-2xl: 48px;
  --gap-3xl: 64px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 50px;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px var(--c-primary-glow);
  --shadow-btn: 0 4px 20px rgba(0, 112, 192, 0.4);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 200ms;
  --t-normal: 400ms;
  --t-slow: 600ms;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-text);
  background: #060e20;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* ── App Container ── */
#app {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  background: #0b1326;
  transform-origin: top left;
  /* Scale is set dynamically by JS */
}

/* ── Background Effects ── */

/* Luminous orbs */
.bg-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.bg-orbs .orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--c-primary) 0%, transparent 70%);
  top: -100px; right: -50px;
  animation-duration: 14s;
}

.bg-orbs .orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #4a90d9 0%, transparent 70%);
  bottom: -80px; left: 10%;
  animation-duration: 18s;
  animation-delay: -4s;
}

.bg-orbs .orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--c-primary-light) 0%, transparent 70%);
  top: 40%; left: 50%;
  animation-duration: 16s;
  animation-delay: -8s;
  opacity: 0.06;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(40px, -30px) scale(1.1); }
}

/* Sound wave rings */
.bg-waves {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-waves .wave {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 140, 0, 0.06);
  animation: waveExpand 8s ease-out infinite;
}

.bg-waves .wave-1 {
  width: 200px; height: 200px;
  bottom: 15%; left: 5%;
  animation-delay: 0s;
}
.bg-waves .wave-2 {
  width: 200px; height: 200px;
  bottom: 15%; left: 5%;
  animation-delay: 2s;
}
.bg-waves .wave-3 {
  width: 200px; height: 200px;
  bottom: 15%; left: 5%;
  animation-delay: 4s;
}
.bg-waves .wave-4 {
  width: 200px; height: 200px;
  bottom: 15%; left: 5%;
  animation-delay: 6s;
}

@keyframes waveExpand {
  0% { transform: scale(1); opacity: 0.15; }
  100% { transform: scale(6); opacity: 0; }
}

/* Floating particles */
.bg-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-particles .particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-primary-light);
  opacity: 0;
  animation: particleFloat 10s ease-in-out infinite;
}

.bg-particles .particle:nth-child(1) { left: 8%; animation-delay: 0s; animation-duration: 12s; }
.bg-particles .particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.bg-particles .particle:nth-child(3) { left: 35%; animation-delay: 4s; animation-duration: 11s; }
.bg-particles .particle:nth-child(4) { left: 50%; animation-delay: 1s; animation-duration: 13s; }
.bg-particles .particle:nth-child(5) { left: 65%; animation-delay: 3s; animation-duration: 15s; }
.bg-particles .particle:nth-child(6) { left: 78%; animation-delay: 5s; animation-duration: 10s; }
.bg-particles .particle:nth-child(7) { left: 90%; animation-delay: 7s; animation-duration: 12s; }
.bg-particles .particle:nth-child(8) { left: 15%; animation-delay: 6s; animation-duration: 16s; }

@keyframes particleFloat {
  0% { bottom: -5%; opacity: 0; transform: translateX(0); }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { bottom: 105%; opacity: 0; transform: translateX(40px); }
}

/* ── Grid pattern overlay ── */
.bg-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gap-3xl);
  opacity: 0;
  transform: translateX(80px);
  pointer-events: none;
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  background: url('../img/hero.png') no-repeat center 30%;
  background-size: cover;
}

/* Dark overlay on all screens (except calculator which has its own) */
.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 38, 0.88);
  z-index: -1;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen.exit-left {
  opacity: 0;
  transform: translateX(-80px);
}

/* ── Typography ── */
.title-hero {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  text-align: center;
  background: linear-gradient(135deg, var(--c-white) 0%, var(--c-primary-light) 60%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-section {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--c-white);
  text-align: center;
  letter-spacing: -0.5px;
}

.title-card {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--c-white);
}

.subtitle {
  font-size: 22px;
  font-weight: 300;
  color: var(--c-text-dim);
  text-align: center;
  line-height: 1.5;
}

.label {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--c-text-dim);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  padding: 20px 48px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: var(--c-white);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover,
.btn-primary:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(0, 112, 192, 0.5);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-accent {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-warm));
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.btn-accent:hover,
.btn-accent:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.45);
}

.btn-ghost {
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  color: var(--c-text);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: var(--c-card-hover);
  border-color: var(--c-primary);
}

.btn-sm {
  padding: 14px 32px;
  font-size: 16px;
  min-height: 52px;
}

.btn .arrow {
  font-size: 24px;
  transition: transform var(--t-fast) var(--ease-out);
}

.btn:hover .arrow {
  transform: translateX(4px);
}

/* ── Cards ── */
.card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-card-border);
  border-radius: var(--r-lg);
  padding: var(--gap-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: all var(--t-normal) var(--ease-out);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--c-card-hover);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--c-primary-glow), transparent 50%);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--t-normal) var(--ease-out);
}

.card-glow:hover::before {
  opacity: 1;
}

/* ── Metric Display ── */
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--c-white);
  line-height: 1;
}

.metric-value.large {
  font-size: 64px;
}

.metric-value.accent {
  color: var(--c-accent);
}

.metric-value.primary {
  color: var(--c-primary-light);
}

.metric-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.metric-sub {
  font-size: 13px;
  color: var(--c-text-muted);
  text-align: center;
}

/* ── Input Fields ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  width: 100%;
}

.input-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
}

.input-field {
  width: 100%;
  padding: 18px 24px;
  border: 2px solid var(--c-input-border);
  border-radius: var(--r-md);
  background: var(--c-input-bg);
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  transition: all var(--t-fast) var(--ease-out);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 64px;
}

.input-field::placeholder {
  color: var(--c-text-muted);
  font-weight: 400;
}

.input-field:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-glow);
  background: rgba(255, 255, 255, 0.1);
}

.input-field.error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 4px rgba(239, 83, 80, 0.2);
}

.input-suffix {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text-dim);
  pointer-events: none;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

/* ── Slider ── */
.slider-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-input-bg) 0%);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  box-shadow: 0 2px 10px rgba(0, 112, 192, 0.4);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-spring);
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  box-shadow: 0 2px 10px rgba(0, 112, 192, 0.4);
  cursor: pointer;
  border: none;
}

.slider-value {
  text-align: center;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--c-accent);
}

/* ── Toggle Buttons (si/no/próximamente) ── */
.toggle-group {
  display: flex;
  gap: var(--gap-md);
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 16px 32px;
  border: 2px solid var(--c-input-border);
  border-radius: var(--r-md);
  background: var(--c-input-bg);
  color: var(--c-text-dim);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  min-height: 60px;
  flex: 1;
  text-align: center;
}

.toggle-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-text);
}

.toggle-btn.selected {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  border-color: var(--c-primary);
  color: var(--c-white);
  box-shadow: var(--shadow-btn);
}

/* ── Donut Chart ── */
.donut-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-container svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-container svg circle {
  fill: none;
  stroke-width: 20;
  stroke-linecap: round;
  transition: stroke-dasharray 1.5s var(--ease-out);
}

.donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.donut-center .metric-value {
  font-size: 36px;
}

/* ── Comparison Columns ── */
.comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--gap-xl);
  width: 100%;
  max-width: 1400px;
  align-items: start;
}

.comparison-divider {
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--c-glass-border), transparent);
  height: 100%;
  min-height: 200px;
  align-self: center;
}

.comparison-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}

.comparison-header {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  padding-bottom: var(--gap-md);
  border-bottom: 2px solid var(--c-card-border);
}

.comparison-header.glasses {
  color: var(--c-accent);
}

.comparison-header.audio {
  color: var(--c-primary-light);
}

.comparison-metrics {
  display: flex;
  flex-direction: column;
}

/* Make Screen Results 2 more compact to fit vertically */
#screen-results2 {
  padding-top: 40px;
  padding-bottom: 40px;
}

#screen-results2 .content {
  gap: 20px;
  max-width: 1300px;
}

#screen-results2 .comparison {
  gap: 40px;
}

#screen-results2 .title-section {
  margin-bottom: -10px;
}

#screen-results2 .growth-target {
  margin-bottom: 10px;
}

/* ── Stats Row ── */
.stats-row {
  display: flex;
  gap: var(--gap-xl);
  justify-content: center;
  flex-wrap: wrap;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-lg) var(--gap-xl);
  background: var(--c-card-bg);
  border: 1px solid var(--c-card-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  min-width: 180px;
}

/* ── Highlight Badge ── */
.highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 16px 32px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 167, 38, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.highlight-badge .icon {
  font-size: 28px;
}

/* ── Form Grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl) var(--gap-2xl);
  width: 100%;
  max-width: 1200px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* ── Virtual Keyboard ── */
.vkeyboard {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 100;
  background: rgba(15, 20, 40, 0.97);
  border-top: 1px solid var(--c-glass-border);
  backdrop-filter: blur(30px);
  padding: var(--gap-lg) var(--gap-xl);
  display: grid;
  gap: var(--gap-sm);
  transition: transform 0.4s var(--ease-out);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.vkeyboard.visible {
  transform: translateX(-50%) translateY(0);
}

.vkeyboard.numeric {
  grid-template-columns: 1fr;
  width: auto;
  padding: var(--gap-lg) var(--gap-2xl);
}

.vkeyboard.numeric .kb-row {
  gap: var(--gap-md);
}

.vkeyboard.numeric .vk-key {
  min-width: 90px;
  min-height: 70px;
  font-size: 28px;
}

.vkeyboard.alpha {
  width: 1400px;
}

.vkeyboard .kb-row {
  display: flex;
  gap: var(--gap-sm);
  justify-content: center;
}

.vk-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 64px;
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.vk-key:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vk-key:active {
  background: var(--c-primary);
  transform: scale(0.95);
}

.vk-key.wide {
  min-width: 110px;
}

.vk-key.extra-wide {
  min-width: 280px;
  flex: 1;
}

.vk-key.action {
  background: rgba(0, 112, 192, 0.2);
  border-color: rgba(0, 112, 192, 0.3);
  color: var(--c-primary-light);
}

.vk-key.action:active {
  background: var(--c-primary);
  color: white;
}

/* ── Progress Bar ── */
.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 50;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-light), var(--c-accent));
  border-radius: 0 3px 3px 0;
  transition: width var(--t-slow) var(--ease-out);
}

/* ── Step Indicator ── */
.step-indicator {
  position: absolute;
  top: var(--gap-xl);
  right: var(--gap-3xl);
  display: flex;
  gap: var(--gap-sm);
  z-index: 50;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-glass);
  border: 2px solid var(--c-glass-border);
  transition: all var(--t-normal) var(--ease-out);
}

.step-dot.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  box-shadow: 0 0 12px var(--c-primary-glow);
}

.step-dot.done {
  background: var(--c-success);
  border-color: var(--c-success);
}

/* ── Back Button ── */
.btn-back {
  position: absolute;
  top: var(--gap-xl);
  left: var(--gap-3xl);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 12px 24px;
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-pill);
  background: var(--c-glass);
  color: var(--c-text-dim);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  backdrop-filter: blur(10px);
}

.btn-back:hover {
  background: var(--c-card-hover);
  color: var(--c-white);
  border-color: var(--c-primary);
}

/* ── Success Animation ── */
.success-check {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-success), #66bb6a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  animation: popIn 0.6s var(--ease-spring);
  box-shadow: 0 0 60px var(--c-success-glow);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Counter Animation Helper ── */
.counter-animate {
  display: inline-block;
  transition: opacity 0.3s;
}

/* ── Fade-in stagger for cards ── */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideIn 0.5s var(--ease-out) forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Pulse animation for highlight ── */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

/* ── Screen-specific layouts ── */

/* Screen 0: Welcome */
#screen-welcome .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xl);
  max-width: 1000px;
  text-align: center;
}

/* Screen 1: Inputs */
#screen-inputs {
  padding-top: 40px;
  justify-content: flex-start;
}

#screen-inputs .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
  width: 100%;
  max-width: 900px;
}

.input-cards {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  width: 100%;
}

.input-card {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  padding: var(--gap-lg) var(--gap-xl);
}

.input-card .input-icon {
  font-size: 40px;
  min-width: 60px;
  text-align: center;
}

.input-card .input-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

/* Screen 2: Results Hearing Loss */
#screen-results1 {
  padding-top: 80px;
}

#screen-results1 .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xl);
  width: 100%;
}

.results-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap-2xl);
  width: 100%;
  max-width: 1400px;
  align-items: center;
}

.results-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);
}

.results-details .stat-card {
  gap: var(--gap-md);
  padding: var(--gap-lg);
}

.results-details .stat-card .metric-value {
  font-size: 36px;
}

/* Screen 3: Growth */
#screen-results2 {
  padding-top: 80px;
}

#screen-results2 .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xl);
  width: 100%;
}

.growth-target {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  padding: 12px 32px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 167, 38, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
}

.growth-target .metric-value {
  font-size: 52px;
  color: var(--c-accent);
}

.growth-target .metric-label {
  font-size: 16px;
  color: var(--c-accent-warm);
}

.comparison-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Extra compact */
}

.comp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px; /* Extra compact */
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-sm);
}

.comp-row-label {
  font-size: 15px;
  color: var(--c-text-dim);
}

.comp-row-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-white);
}

/* Screen 4: Form */
#screen-form {
  padding-top: 30px;
  padding-bottom: 30px;
}

#screen-form .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xl);
  width: 100%;
  max-width: 1200px;
}

.required-mark {
  color: var(--c-danger);
  margin-left: 4px;
}

/* Screen 5: Thank You */
#screen-thanks .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xl);
  text-align: center;
  max-width: 700px;
}

/* ── Auto-reset countdown ── */
.countdown {
  font-size: 16px;
  color: var(--c-text-muted);
  margin-top: var(--gap-md);
}

.countdown span {
  color: var(--c-primary-light);
  font-weight: 600;
}

/* Responsive adjustments removed — scaling handled by JS */

/* ── Error Tooltip ── */
.input-error {
  font-size: 13px;
  color: var(--c-danger);
  margin-top: 4px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all var(--t-fast);
}

.input-error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scrollable form area for keyboard ── */
.form-scroll-area {
  max-height: calc(1080px - 280px);
  overflow-y: auto;
  width: 100%;
  padding-right: var(--gap-md);
  scrollbar-width: thin;
  scrollbar-color: var(--c-primary) transparent;
}

.form-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.form-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.form-scroll-area::-webkit-scrollbar-thumb {
  background: var(--c-primary);
  border-radius: 3px;
}
