/* ═══════════════════════════════════════════════
   VISUAL ENHANCEMENT LAYER — AXIOM
   ═══════════════════════════════════════════════ */

/* ── Test cards: elevation, hover, scored states ── */
.test-card {
  position: relative;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.15s !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.test-card:hover {
  border-color: var(--border2) !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28), 0 0 0 1px rgba(87,187,70,0.08);
  transform: translateY(-1px);
}
.test-card.card-high {
  box-shadow: 0 4px 18px rgba(87,187,70,0.12), 0 0 0 1px rgba(87,187,70,0.18) !important;
}
.test-card.card-mid {
  box-shadow: 0 4px 18px rgba(0,152,208,0.12), 0 0 0 1px rgba(0,152,208,0.18) !important;
}
.test-card.card-low {
  box-shadow: 0 4px 18px rgba(16,80,216,0.12), 0 0 0 1px rgba(16,80,216,0.18) !important;
}
/* Scored card label glow */
.test-card.card-high .test-name,
.test-card.card-mid  .test-name,
.test-card.card-low  .test-name {
  color: var(--text);
}
/* Score bar micro-animation */
.score-bar-fill {
  transition: width 0.55s cubic-bezier(0.22,1,0.36,1), background 0.4s ease !important;
}
.score-bar-fill.bar-high {
  box-shadow: 0 0 10px rgba(87,187,70,0.55) !important;
}
/* Test input focus ring */
.test-input-row input:focus {
  box-shadow: 0 0 0 2px rgba(87,187,70,0.18);
  border-color: var(--accent) !important;
}
/* Bigger input tap targets on touch */
.test-input-row input {
  min-height: 44px;
}
/* Test grid spacing */
.test-grid {
  gap: 16px !important;
}
.test-card {
  padding: 22px 22px 18px !important;
}

/* ── Score reveal: bigger number, glow, count-up ── */
.final-score-block {
  background: linear-gradient(160deg, #001840 0%, var(--surface) 60%) !important;
  border-color: rgba(87,187,70,0.22) !important;
  box-shadow: 0 0 60px rgba(87,187,70,0.08), 0 8px 40px rgba(0,0,0,0.3) !important;
}
.final-score-block::before {
  background: radial-gradient(ellipse at 50% -10%, rgba(87,187,70,0.18) 0%, transparent 65%) !important;
}
.score-number {
  font-size: 140px !important;
  text-shadow: 0 0 60px rgba(87,187,70,0.35), 0 0 120px rgba(87,187,70,0.15);
  letter-spacing: -4px !important;
}
.level-badge {
  font-size: 22px !important;
  letter-spacing: 5px !important;
  padding: 10px 32px !important;
  box-shadow: 0 4px 20px rgba(87,187,70,0.25);
}
@keyframes scorePop {
  0%   { transform: scale(0.4); opacity: 0; filter: blur(8px); }
  70%  { filter: blur(0); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}
@keyframes scoreGlowPulse {
  0%, 100% { text-shadow: 0 0 60px rgba(87,187,70,0.35), 0 0 120px rgba(87,187,70,0.15); }
  50%       { text-shadow: 0 0 80px rgba(87,187,70,0.55), 0 0 160px rgba(87,187,70,0.25); }
}
.score-number.score-pop {
  animation: scorePop 0.7s cubic-bezier(0.34,1.56,0.64,1) forwards,
             scoreGlowPulse 3s ease-in-out 0.7s infinite;
}

/* ── Breakdown rows: richer ── */
.breakdown-row {
  border-radius: 4px !important;
  transition: background 0.2s, border-color 0.2s;
  padding: 12px 16px !important;
}
.breakdown-row:hover {
  background: var(--surface2) !important;
  border-color: var(--border2) !important;
}
.breakdown-score {
  font-size: 24px !important;
}

/* ── Hero: bolder, more dramatic ── */
.hero::before {
  background: radial-gradient(ellipse at 10% 85%, rgba(87,187,70,0.07) 0%, transparent 55%),
              radial-gradient(ellipse at 90% 10%, rgba(87,187,70,0.04) 0%, transparent 45%) !important;
}
.hero-headline {
  font-size: clamp(80px, 10vw, 140px) !important;
  letter-spacing: -4px !important;
}
.hero-headline em {
  text-shadow: 0 0 80px rgba(87,187,70,0.3);
}

/* ── Buttons: richer ── */
.btn-primary {
  box-shadow: 0 4px 20px rgba(87,187,70,0.22);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s !important;
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(87,187,70,0.35) !important;
}

/* ── Nav row spacing ── */
.nav-row {
  margin-top: 40px !important;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── Section labels: slightly larger ── */
.section-label {
  font-size: 11px !important;
  letter-spacing: 5px !important;
  margin-top: 36px !important;
  margin-bottom: 16px !important;
}

/* ── App padding: more breathing room ── */
.app {
  padding: 94px 28px 100px !important;
}

/* ══════════════════════════════════════════════
   MOBILE — comprehensive responsive overhaul
   ══════════════════════════════════════════════ */
@media (max-width: 720px) {
  header { padding: 12px 16px !important; }
  .logo-wordmark-bottom { font-size: 15px !important; }

  .app { padding: 28px 16px 80px !important; }

  .screen-title { font-size: 38px !important; }
  .screen-sub { font-size: 10px !important; margin-bottom: 28px !important; }

  /* Hero */
  .hero { padding: 36px 0 0 !important; }
  .hero-headline { font-size: clamp(58px, 16vw, 90px) !important; letter-spacing: -2px !important; margin-bottom: 20px !important; }
  #howItWorksGrid { grid-template-columns: 1fr !important; }
  #levelsDisplayGrid { grid-template-columns: repeat(3,1fr) !important; }
  .hero-atf { max-width: 100% !important; padding-bottom: 24px !important; grid-template-columns: 1fr !important; }
  .hero-tagline { font-size: 14px !important; }
  .hero-hook { font-size: 15px !important; }
  .hero-cta-row { gap: 10px !important; }
  .hero-cta-btn { width: 100%; text-align: center; padding: 16px 24px !important; font-size: 16px !important; }

  /* Step bar */
  .step-bar { margin-bottom: 28px !important; }

  /* Test grid — single column on mobile */
  .test-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .test-card { padding: 18px 16px 14px !important; }
  .test-name { font-size: 12px !important; margin-bottom: 10px !important; }
  .test-input-row input { width: 80px !important; font-size: 22px !important; padding: 10px !important; }
  .score-number { font-size: 100px !important; }
  .score-bar-wrap { margin-bottom: 14px !important; }

  /* Results */
  .results-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  .final-score-block { padding: 28px 20px !important; }
  .score-number { font-size: 108px !important; }
  .breakdown-name { width: 100px !important; font-size: 11px !important; }
  .breakdown-score { font-size: 20px !important; }
  .breakdown-bar-wrap { display: none; }

  /* Profile grid */
  .profile-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* UNLOCK THE STANDARD upsell — stack cards on mobile so text can breathe */
  .upsell-grid { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* Buttons */
  .btn-primary { width: 100%; text-align: center; padding: 16px 24px !important; font-size: 16px !important; }
  .btn-secondary { padding: 14px 20px !important; }
  .nav-row { flex-direction: column !important; gap: 10px !important; }
  .nav-row .btn-primary, .nav-row .btn-secondary { width: 100%; text-align: center; justify-content: center; }

  /* Save banner */
  .save-banner { flex-direction: column !important; gap: 12px !important; padding: 16px !important; }
  .save-banner .btn-primary { width: 100%; }

  /* Leaderboard */
  .lb-your-rank { gap: 16px !important; padding: 16px !important; }
  .lb-your-rank-num { font-size: 52px !important; }
  .lb-bar-cell { display: none !important; }
  .lb-gym-tag { display: none !important; }

  /* Section label */
  .section-label { font-size: 10px !important; margin-top: 28px !important; }
}

@media (max-width: 420px) {
  .hero-headline { font-size: clamp(50px, 18vw, 72px) !important; }
  .score-number { font-size: 88px !important; }
  header { padding: 10px 12px !important; }
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM LAYER v2 — AXIOM
   ═══════════════════════════════════════════════════════════ */

/* ── Smooth scroll ── */
html { scroll-behavior: smooth; }

/* ── Root enhancements ── */
:root {
  --glass-bg: rgba(17, 45, 88, 0.65);
  --glass-border: rgba(42, 79, 133, 0.5);
  --glow-accent: rgba(87, 187, 70, 0.12);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-elevated: 0 8px 40px rgba(0,0,0,0.38), 0 2px 8px rgba(0,0,0,0.22);
  --transition-smooth: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Ambient background orbs ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(87,187,70,0.045) 0%, transparent 65%),
    radial-gradient(ellipse 50% 35% at 80% 75%, rgba(42,79,133,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 60% 10%, rgba(87,187,70,0.025) 0%, transparent 55%);
  animation: orb-drift 20s ease-in-out infinite alternate;
}
@keyframes orb-drift {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  50%  { opacity: 0.8; transform: translateY(-12px) scale(1.03); }
  100% { opacity: 1; transform: translateY(8px) scale(0.98); }
}


/* All modals and overlays always on top */
.payment-overlay,
.sample-overlay,
#profileSettingsModal,
#signInModal {
  z-index: 9995 !important;
}

/* Cancellation modal must clear profileSettingsModal */
#cancellationModal {
  z-index: 10000 !important;
}

/* ── Header: gradient accent line, refined ── */
header {
  border-bottom: none !important;
  box-shadow:
    0 1px 0 rgba(87,187,70,0.15),
    0 4px 20px rgba(0,0,0,0.3);
  background: rgba(10, 28, 60, 0.92) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
}

/* ── Screen transitions: more fluid ── */
.screen.active {
  animation: screenIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Step bar: refined ── */
.step-seg {
  border-radius: 4px !important;
  height: 4px !important;
}
.step-seg.active {
  box-shadow: 0 0 12px rgba(87,187,70,0.7), 0 0 4px rgba(87,187,70,0.9) !important;
}

/* ── Screen title: clean white ── */
.screen-title {
  color: var(--text) !important;
  -webkit-text-fill-color: unset !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

/* ── Test cards: glass surface ── */
.test-card {
  background: var(--glass-bg) !important;
  border-color: var(--glass-border) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: var(--shadow-card) !important;
  transition: var(--transition-smooth) !important;
}
.test-card:hover {
  background: rgba(22, 52, 104, 0.8) !important;
  border-color: rgba(87,187,70,0.25) !important;
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(87,187,70,0.12) !important;
  transform: translateY(-2px) !important;
}
.test-card.card-high {
  background: rgba(87,187,70,0.07) !important;
  border-color: rgba(87,187,70,0.3) !important;
  box-shadow: 0 4px 24px rgba(87,187,70,0.1), 0 0 0 1px rgba(87,187,70,0.15) !important;
}
.test-card.card-mid {
  background: rgba(0,152,208,0.06) !important;
  border-color: rgba(0,152,208,0.25) !important;
}
.test-card.card-low {
  background: rgba(16,80,216,0.06) !important;
  border-color: rgba(16,80,216,0.25) !important;
}

/* ── Input fields: premium focus states ── */
.field-group select, .field-group input,
.test-input-row input {
  transition: var(--transition-smooth) !important;
}
.field-group select:focus, .field-group input:focus {
  box-shadow: 0 0 0 3px rgba(87,187,70,0.15), 0 2px 8px rgba(0,0,0,0.2) !important;
  border-color: var(--accent) !important;
}
.test-input-row input:focus {
  box-shadow: 0 0 0 3px rgba(87,187,70,0.15) !important;
  border-color: var(--accent) !important;
}

/* ── Buttons: premium ── */
.btn-primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(87,187,70,0.25), 0 2px 4px rgba(0,0,0,0.2) !important;
  transition: var(--transition-smooth) !important;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(87,187,70,0.4), 0 2px 8px rgba(0,0,0,0.2) !important;
  transform: translateY(-2px) !important;
}
.btn-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 12px rgba(87,187,70,0.2) !important;
}

/* ── Results screen: premium score reveal ── */
.final-score-block {
  background: linear-gradient(145deg, rgba(19, 47, 92, 0.95) 0%, rgba(13, 36, 72, 0.98) 100%) !important;
  border: 1px solid rgba(87,187,70,0.2) !important;
  box-shadow:
    0 0 0 1px rgba(87,187,70,0.08),
    0 8px 48px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
  overflow: hidden !important;
}
.final-score-block::before {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(87,187,70,0.22) 0%, transparent 65%),
    radial-gradient(ellipse at 50% 110%, rgba(42,79,133,0.3) 0%, transparent 60%) !important;
}
.score-number {
  font-size: 148px !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: unset !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 0 40px rgba(87,187,70,0.5), 0 0 80px rgba(87,187,70,0.2);
}
.score-number.score-pop {
  animation:
    scorePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    scoreGlowPulse 4s ease-in-out 0.7s infinite !important;
}
@keyframes scoreGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(87,187,70,0.4)); }
  50%       { filter: drop-shadow(0 0 50px rgba(87,187,70,0.65)); }
}
.level-badge {
  background: linear-gradient(135deg, #6fd15a 0%, #57bb46 100%) !important;
  box-shadow: 0 4px 20px rgba(87,187,70,0.3), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}

/* ── Breakdown rows ── */
.breakdown-row {
  background: rgba(17, 45, 88, 0.6) !important;
  border: 1px solid rgba(30, 61, 110, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  transition: var(--transition-smooth) !important;
}
.breakdown-row:hover {
  background: rgba(22, 52, 104, 0.85) !important;
  border-color: var(--border2) !important;
  transform: translateX(2px);
}

/* ── Save banner: glass ── */
.save-banner {
  background: rgba(17, 45, 88, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(87,187,70,0.2) !important;
  border-left: 3px solid var(--accent) !important;
  box-shadow: var(--shadow-elevated) !important;
}

/* ── Radar wrap: refined ── */
#radarWrap {
  backdrop-filter: blur(8px) !important;
  border: 1px solid var(--border2) !important;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.25), 0 4px 24px rgba(0,0,0,0.3) !important;
}

/* ── Hero: richer depth ── */
.hero {
  overflow: visible;
}
.hero::before {
  background:
    radial-gradient(ellipse at 5% 90%, rgba(87,187,70,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 95% 10%, rgba(42,79,133,0.15) 0%, transparent 45%) !important;
}
.hero-eyebrow {
  letter-spacing: 4px !important;
  opacity: 0.9 !important;
}

/* ── Ticker chips: glass ── */
.hero-ticker-chip {
  background: rgba(17, 45, 88, 0.7) !important;
  backdrop-filter: blur(8px) !important;
  border-color: rgba(42,79,133,0.6) !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.hero-ticker-chip:hover {
  border-color: rgba(87,187,70,0.3) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
}

/* ── Section label: refined ── */
.section-label {
  opacity: 0.9;
}
.section-label::after {
  background: linear-gradient(90deg, var(--border2) 0%, transparent 100%) !important;
}

/* ── Profile cards: glass ── */
.profile-card {
  transition: var(--transition-smooth) !important;
  backdrop-filter: blur(6px) !important;
}
.profile-card:hover {
  box-shadow: var(--shadow-elevated) !important;
  transform: translateY(-2px) !important;
}

/* ── Leaderboard: refined ── */
.lb-your-rank {
  background: rgba(17, 45, 88, 0.7) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: var(--shadow-card) !important;
}
.lb-row {
  transition: background 0.2s !important;
}
.lb-row:hover {
  background: rgba(22, 52, 104, 0.6) !important;
}

/* ── Score bar: smoother ── */
.score-bar-wrap {
  height: 8px !important;
  border-radius: 4px !important;
  background: rgba(30, 61, 110, 0.8) !important;
}
.score-bar-fill {
  border-radius: 4px !important;
}
.score-bar-fill.bar-high {
  background: linear-gradient(90deg, #229040, #57BB46) !important;
  box-shadow: 0 0 8px rgba(87,187,70,0.5) !important;
}
.score-bar-fill.bar-mid {
  background: linear-gradient(90deg, #006898, #0098D0) !important;
}
.score-bar-fill.bar-low {
  background: linear-gradient(90deg, #0030A0, #1050D8) !important;
}

/* ── Nav row: cleaner divider ── */
.nav-row {
  border-top: 1px solid rgba(42,79,133,0.4) !important;
}

/* ── Scrollbar: custom ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ══════════════════════════════════════════════════
   PREMIUM MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* Reduce orb intensity on mobile for performance */
  body::after { animation: none !important; opacity: 0.7; }

  /* Glass blur reduced on mobile for perf */
  .test-card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  #radarWrap { backdrop-filter: none !important; }

  /* Score number — gradient preserved */
  .score-number { font-size: 108px !important; }

  /* Full-width CTA buttons */
  .hero-cta-btn { width: 100%; }

  /* Leaderboard */
  .lb-your-rank-num { font-size: 56px !important; }

  /* Tighten section labels */
  .section-label { margin-top: 24px !important; }
}

@media (max-width: 420px) {
  .score-number { font-size: 88px !important; }
  .screen-title { font-size: 34px !important; }
}

/* ── COMPREHENSIVE MOBILE FIXES ── */
