/* ===== CSS Variables ===== */
:root {
  --color-primary: #2E1B98;
  --color-secondary: #543CDD;
  --color-light-purple: #A092EC;
  --color-pale-purple: #ECE9FB;
  --color-dark: #28272A;
  --color-gray: #6B6977;
  --color-bg: #F7F7F8;
  --color-white: #FFFFFF;
  --color-orange: #D9651D;
  --color-orange-light: #F3BF7E;
  --color-orange-pale: #FCEED8;
  --color-link: #E25179;
  --font-main: Arial, Helvetica, sans-serif;
  --radius-card: 10px;
  --radius-btn: 6px;
  --shadow-card: 0 2px 8px rgba(46, 27, 152, 0.08);
}

/* ===== Password Gate ===== */
.password-gate {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-primary);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.password-gate.hidden { display: none; }
.password-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.password-logo {
  height: 40px;
  width: auto;
  margin-bottom: 24px;
}
.password-card h2 { font-size: 20px; margin-bottom: 8px; }
.password-card > p { font-size: 14px; color: var(--color-gray); margin-bottom: 24px; }
.password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.password-form input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--color-pale-purple);
  border-radius: var(--radius-btn);
  font-size: 16px;
  box-sizing: border-box;
}
.password-form input:focus { border-color: var(--color-primary); outline: none; }
.password-form .btn { width: 100%; padding: 14px; }
.password-error { color: #c0392b; font-size: 13px; margin-top: 12px; }

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

body {
  font-family: var(--font-main);
  font-size: 17px;
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--color-primary); }

/* ===== Typography ===== */
h1 { font-size: 32px; font-weight: bold; color: var(--color-primary); line-height: 1.2; }
h2 { font-size: 24px; font-weight: bold; color: var(--color-primary); line-height: 1.3; }
h3 { font-size: 18px; font-weight: bold; color: var(--color-dark); line-height: 1.4; }

.subtitle, .label { font-size: 14px; font-weight: bold; color: var(--color-orange); }
.caption { font-size: 13px; color: var(--color-gray); }
.disclaimer-text { font-size: 12px; color: var(--color-gray); font-style: italic; }

/* ===== Header ===== */
.site-header {
  background: var(--color-primary);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.site-header .phone-link {
  color: var(--color-white);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .site-header { height: 72px; padding: 0 32px; }
  .site-header .logo img { height: 38px; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0;
  font-size: 14px;
}
.site-footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Brand column */
.footer-brand { max-width: 340px; }
.footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 16px;
}
.footer-tagline {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-orange-light);
  margin-bottom: 12px;
}
.footer-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 20px;
}
.footer-socials {
  display: flex;
  gap: 12px;
}
.footer-socials a {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: background 0.2s, color 0.2s;
}
.footer-socials a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* Link columns */
.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 20px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-orange-light);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  padding: 4px 0;
}

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.footer-legal {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-legal a {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.footer-legal a:hover { color: rgba(255,255,255,0.8); }

/* Footer responsive */
@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    gap: 48px;
  }
  .footer-brand { flex: 0 0 280px; }
  .footer-columns {
    flex: 1;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--color-orange);
  color: var(--color-white);
  padding: 14px 28px;
}
.btn-primary:hover { background: #B85218; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 12px 24px;
}
.btn-secondary:hover { background: var(--color-pale-purple); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  padding: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

.btn-tertiary {
  background: var(--color-pale-purple);
  color: var(--color-primary);
  border: 1px solid var(--color-light-purple);
  padding: 12px 24px;
}
.btn-tertiary:hover { background: #ddd8f7; }

/* Inline icon in buttons */
.btn svg { vertical-align: -2px; margin-right: 4px; }

/* ===== Tooltips ===== */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 13px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 8px;
  width: max-content;
  max-width: min(350px, 90vw);
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(46,27,152,0.25);
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 201;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus::after,
[data-tooltip]:focus::before { opacity: 1; }

/* ===== Header Nav ===== */
.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.header-nav .nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  transition: background 0.2s, color 0.2s;
}
.header-nav .nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.header-nav .nav-link.active { color: #fff; background: rgba(255,255,255,0.15); }

/* ===== Warning Header ===== */
.warning-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.warning-header strong { color: var(--color-orange); }

/* ===== Cards ===== */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-pale-purple);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.card-disclaimer {
  background: var(--color-pale-purple);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-card);
  padding: 20px;
}

.card-warning {
  background: var(--color-orange-pale);
  border: 1px solid var(--color-orange);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ===== Screens ===== */
.screen { display: none; padding: 16px 16px; max-width: 640px; margin: 0 auto; }
.screen.active { display: block; }
#screen-results, #screen-landing { max-width: 1080px; }

@media (min-width: 768px) {
  .screen { padding: 24px 24px; }
  #screen-results { padding: 28px 32px; }
}

/* ===== Landing Screen ===== */

/* Hero */
.landing-hero {
  padding: 12px 0 16px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.landing-hero-text h1 { font-size: 36px; margin-bottom: 8px; }
.hero-subtitle { font-size: 18px; color: var(--color-gray); line-height: 1.6; margin-bottom: 16px; }
.hero-stats {
  display: flex;
  gap: 0;
  align-items: center;
}
.hero-stat {
  text-align: center;
  flex: 1;
}
.hero-stat strong {
  display: block;
  font-size: 24px;
  color: var(--color-primary);
  line-height: 1.2;
}
.hero-stat span {
  font-size: 12px;
  color: var(--color-gray);
}
.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--color-pale-purple);
}

/* How It Works — balanced row */
.how-it-works {
  background: var(--color-white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 6px rgba(46,27,152,0.05);
}
.how-it-works h2 { text-align: center; font-size: 18px; margin-bottom: 20px; }
.steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 280px;
}
.step-num {
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 1;
}
.step-icon-wrap {
  width: 52px;
  height: 52px;
  background: var(--color-pale-purple);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.step-text { min-width: 0; }
.step-text strong { display: block; font-size: 14px; color: var(--color-dark); line-height: 1.3; }
.step-text span { font-size: 12px; color: var(--color-gray); line-height: 1.3; }
.step-arrow { flex-shrink: 0; }

/* Stack steps vertically on small screens */
@media (max-width: 600px) {
  .steps-row { flex-direction: column; gap: 12px; }
  .step-arrow { transform: rotate(90deg); }
  .step-item { max-width: none; }
}

/* Hero CTA (above the fold) */
.hero-cta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.disclaimer-gate {
  background: var(--color-white);
  border: 2px solid var(--color-orange);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 480px;
}
.disclaimer-gate-arrow {
  text-align: center;
  color: var(--color-orange);
  margin-bottom: 4px;
  animation: pulse-bounce 2s infinite;
}
@keyframes pulse-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(3px); opacity: 1; }
}
.disclaimer-gate.checked {
  border-color: #d4edda;
  background: #f0faf3;
}
.disclaimer-gate.checked .disclaimer-gate-arrow { display: none; }
.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-dark);
  cursor: pointer;
}
.disclaimer-check strong { color: var(--color-orange); }
.disclaimer-check input[type="checkbox"] {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}
.btn-large {
  padding: 16px 32px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Compact disclaimer note (below fold) */
.landing-disclaimer-note {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 24px;
}
.landing-disclaimer-note p {
  font-size: 12px;
  color: var(--color-gray);
  line-height: 1.6;
}

/* Trust Bar */
.trust-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.trust-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-white);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(46,27,152,0.04);
}
.trust-bar-item svg { flex-shrink: 0; }
.trust-bar-item strong { display: block; font-size: 14px; color: var(--color-dark); }
.trust-bar-item span { font-size: 12px; color: var(--color-gray); }

/* Mask Types Section */
.mask-types-section {
  text-align: center;
  margin-bottom: 16px;
}
.mask-types-section h2 { margin-bottom: 8px; }
.section-subtitle { font-size: 14px; color: var(--color-gray); margin-bottom: 24px; }
.mask-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.mask-type-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(46,27,152,0.04);
  transition: box-shadow 0.2s;
}
.mask-type-card:hover { box-shadow: 0 4px 16px rgba(46,27,152,0.1); }
.mask-type-photo {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.mask-type-photo img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}
.mask-type-card h3 { font-size: 15px; margin-bottom: 4px; }
.mask-type-card p { font-size: 12px; color: var(--color-gray); line-height: 1.4; margin: 0; }

@media (min-width: 768px) {
  .mask-type-photo { height: 140px; }
  .mask-type-photo img { max-height: 130px; }
}

/* ===== Landing Desktop ===== */
@media (min-width: 768px) {
  .landing-hero { padding: 16px 0 20px; }
  .landing-hero-text h1 { font-size: 44px; }

  .trust-bar { grid-template-columns: repeat(3, 1fr); }

  .mask-types-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

@media (min-width: 1024px) {
  .landing-hero-text h1 { font-size: 48px; }
  .hero-subtitle { font-size: 20px; }
}

/* ===== Quiz Screen ===== */
.progress-bar-container { margin-bottom: 24px; }
.progress-bar-track { height: 6px; background: var(--color-pale-purple); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width 0.3s; }
.step-indicator { font-size: 13px; color: var(--color-gray); margin-bottom: 8px; }

.quiz-question { margin-bottom: 16px; }
.quiz-question h2 { font-size: 22px; margin-bottom: 12px; }

.option-cards { display: flex; flex-direction: column; gap: 8px; }
.option-card {
  background: var(--color-white);
  border: 2px solid var(--color-pale-purple);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.option-card:hover { border-color: var(--color-light-purple); }
.option-card.selected { border-color: var(--color-primary); background: var(--color-pale-purple); }
.option-card .check-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--color-pale-purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: transparent;
  transition: all 0.2s;
}
.option-card.selected .check-icon {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: var(--color-white);
}

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; }
.quiz-nav .btn-primary { flex: 1; max-width: 200px; }

.quiz-multi-hint { font-size: 14px; color: var(--color-gray); margin-bottom: 12px; }
.quiz-skip { text-align: center; margin-top: 12px; }
.quiz-skip .btn { width: 100%; }
.quiz-nav .btn { min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }

@media (max-width: 600px) {
  .option-card {
    padding: 10px 14px;
    font-size: 15px;
  }
  .option-cards {
    gap: 6px;
  }
  .quiz-question h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  .quiz-multi-hint {
    margin-bottom: 8px;
  }
  .quiz-nav {
    margin-top: 14px;
  }
  .quiz-skip {
    margin-top: 8px;
  }
}

.pressure-input-group { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pressure-input-group input {
  width: 80px; padding: 10px; border: 2px solid var(--color-pale-purple);
  border-radius: var(--radius-btn); font-size: 16px; text-align: center;
}
.pressure-input-group input:focus { border-color: var(--color-primary); outline: none; }
.pressure-input-group span { font-size: 14px; color: var(--color-gray); }
.helper-text { font-size: 13px; color: var(--color-gray); margin-top: 4px; }

/* Multi-select */
.option-card.multi-select.selected { border-color: var(--color-primary); background: var(--color-pale-purple); }

/* ===== Lighting Check ===== */
#screen-lighting .lighting-preview { text-align: center; margin: 24px 0; }
#screen-lighting video {
  width: 100%; max-width: 400px; border-radius: 12px;
  background: var(--color-dark);
}
#screen-lighting .lighting-actions,
#screen-lighting .warning-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* ===== Face Scan Screen ===== */
#screen-scan { background: var(--color-dark); max-width: none; padding: 24px 16px; }
#screen-scan h2 { color: var(--color-white); text-align: center; margin-bottom: 16px; }

.scan-container { position: relative; max-width: 400px; margin: 0 auto; }
.scan-container video {
  width: 100%; border-radius: 12px; display: block;
  transform: scaleX(-1);
}
.scan-container canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border-radius: 12px;
  pointer-events: none;
}

.scan-instructions {
  max-width: 400px; margin: 0 auto 16px; text-align: center;
}
.scan-instructions p {
  color: rgba(255,255,255,0.9); font-size: 16px; margin-bottom: 12px;
}
.scan-checklist {
  list-style: none; padding: 0; text-align: left;
  display: inline-block;
}
.scan-checklist li {
  color: rgba(255,255,255,0.7); font-size: 13px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.scan-checklist li svg { flex-shrink: 0; }

.scan-status {
  text-align: center; color: var(--color-white);
  font-size: 18px; font-weight: bold; margin-top: 20px; min-height: 48px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.scan-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
/* Override button styles for dark scan background */
#screen-scan .btn-secondary {
  background: rgba(255,255,255,0.15);
  color: var(--color-white);
  border-color: rgba(255,255,255,0.5);
}
#screen-scan .btn-secondary:hover {
  background: rgba(255,255,255,0.25);
}
#screen-scan .btn-primary {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#screen-scan .card-warning {
  max-width: 400px;
  margin: 16px auto 0;
}

.scan-tips { margin-top: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }
.scan-tips .tip {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.9); font-size: 14px; margin-bottom: 12px;
}
.scan-tips .tip .tip-icon,
.scan-tips .tip svg { flex-shrink: 0; }
.scan-tips .btn-primary { width: 100%; margin-top: 8px; }

.scan-captured-flash {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(46, 27, 152, 0.3); border-radius: 12px;
  display: none; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold; color: var(--color-white);
}
.scan-captured-flash.show { display: flex; animation: flashFade 1s forwards; }

@keyframes flashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== Results Screen ===== */

/* --- Act 1: Hero Banner --- */
.results-hero {
  background: var(--color-pale-purple);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Scan photo + measurements */
.hero-scan {
  text-align: center;
  flex-shrink: 0;
}
.hero-scan .captured-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(46,27,152,0.12);
}
.hero-scan .scan-quality-badge {
  margin-top: 10px;
}
.scan-measurements-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 8px;
  max-width: 170px;
  margin-left: auto;
  margin-right: auto;
}
.scan-meas-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 14px;
  cursor: pointer;
}
.scan-meas-label { color: var(--color-gray); }
.scan-meas-value { font-weight: bold; color: var(--color-primary); }
.same-type-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-white);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-dark);
}
.same-type-banner svg { flex-shrink: 0; color: var(--color-primary); margin-top: 2px; }
.same-type-banner p { margin: 0; font-size: 14px; color: var(--color-gray); }
.same-type-banner strong { color: var(--color-primary); }

.quiz-skipped-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-white);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 14px;
}
.quiz-skipped-banner svg { flex-shrink: 0; color: var(--color-orange); margin-top: 2px; }
.quiz-skipped-banner strong { display: block; margin-bottom: 4px; color: var(--color-dark); }
.quiz-skipped-banner p { font-size: 13px; color: var(--color-gray); margin: 0 0 10px; line-height: 1.5; }
.btn-sm { font-size: 13px; padding: 8px 16px; }

.quiz-only-note {
  font-size: 14px;
  color: var(--color-gray);
  margin-bottom: 4px;
  text-align: center;
}

.scan-quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}
.scan-quality-badge.good { background: #d4edda; color: #155724; }
.scan-quality-badge.fair { background: var(--color-orange-pale); color: var(--color-orange); }
.scan-quality-badge.low { background: #e9ecef; color: var(--color-gray); }

.measurement-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.measurement-pill {
  background: var(--color-white);
  border: 1px solid rgba(46,27,152,0.12);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  color: var(--color-dark);
}
.measurement-pill strong { color: var(--color-primary); }

/* Quiz-only placeholder */
.hero-scan-placeholder {
  background: var(--color-white);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(46,27,152,0.12);
}
.hero-scan-placeholder svg { margin-bottom: 12px; }
.hero-scan-placeholder p { font-size: 14px; color: var(--color-gray); margin: 0; }

/* Hero recommendation */
.results-hero .hero-rec {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-rec .label-orange {
  font-size: 11px;
  font-weight: bold;
  color: var(--color-orange);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}
.hero-rec h1 {
  font-size: 28px;
  margin-bottom: 8px;
}
.hero-rec .size-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-orange);
  color: var(--color-white);
  font-size: 15px;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 24px;
  margin-bottom: 12px;
}
.hero-rec .size-note {
  font-size: 14px;
  color: var(--color-dark);
  line-height: 1.5;
  margin-bottom: 12px;
  background: var(--color-white);
  border-radius: 8px;
  padding: 10px 14px;
}
.hero-rec .why-summary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
  margin-bottom: 12px;
}
.hero-rec .context-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.context-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.3;
}
.context-badge--orange { background: var(--color-orange-pale); color: var(--color-orange); }
.context-badge--purple { background: rgba(46,27,152,0.08); color: var(--color-primary); }

/* --- Act 2: Collapsible Sections --- */
.collapsible {
  border: 1px solid var(--color-pale-purple);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  overflow: hidden;
}
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--color-white);
  user-select: none;
  transition: background 0.2s;
}
.collapsible-header:hover { background: var(--color-bg); }
.collapsible-header h3 { margin: 0; font-size: 16px; }
.collapsible-chevron {
  width: 20px; height: 20px;
  transition: transform 0.3s;
  flex-shrink: 0;
  color: var(--color-gray);
}
.collapsible.open .collapsible-chevron { transform: rotate(180deg); }
.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.collapsible.open .collapsible-body {
  max-height: 800px;
}
.collapsible-body-inner {
  padding: 0 20px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-dark);
}
.collapsible-body-inner p { margin-bottom: 10px; }
.collapsible-body-inner p:last-child { margin-bottom: 0; }

/* --- Act 3: Product Showcase --- */
.products-section { margin: 32px 0; }
.products-section-header {
  margin-bottom: 20px;
}
.products-section-header h2 { margin-bottom: 4px; }
.products-section-header p { font-size: 14px; color: var(--color-gray); }

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-pale-purple);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(46,27,152,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover {
  box-shadow: 0 6px 24px rgba(46,27,152,0.12);
  transform: translateY(-2px);
}
.product-card .product-image-wrap {
  background: var(--color-bg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
}
.product-card .product-image {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.product-card .product-image-wrap .product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}
.product-card .product-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-card .product-brand {
  font-size: 11px;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.product-card .product-name { font-size: 17px; font-weight: bold; line-height: 1.3; }
.product-card .product-desc {
  font-size: 13px;
  color: var(--color-gray);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.size-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.size-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  background: var(--color-pale-purple);
  color: var(--color-primary);
}
.size-pill.recommended { background: var(--color-orange); color: var(--color-white); }

.product-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.product-flag {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-gray);
}

.product-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}
.product-badge.staff-pick { background: var(--color-orange); color: var(--color-white); }
.product-badge.best-seller { background: var(--color-orange-pale); color: var(--color-orange); }

.product-card .product-note {
  font-size: 11px;
  color: var(--color-gray);
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.product-card .product-fit-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-primary);
  background: var(--color-pale-purple);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0 2px;
}

.product-card .btn-primary {
  width: 100%;
  margin-top: auto;
  padding: 12px;
}

/* Mask Type Features (why this type) */
.mask-type-features {
  background: var(--color-white);
  border: 1px solid var(--color-pale-purple);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 24px;
}
.mask-type-features h3 {
  font-size: 18px;
  color: var(--color-primary);
  margin: 0 0 16px;
}
.mask-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mask-feature-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.mask-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-pale-purple);
  border-radius: 8px;
  color: var(--color-primary);
  margin-top: 2px;
}
.mask-feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mask-feature-text strong {
  font-size: 14px;
  color: var(--color-dark);
}
.mask-feature-text span {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-gray);
}
@media (max-width: 600px) {
  .mask-features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .mask-type-features {
    padding: 18px;
  }
}

.products-divider {
  font-size: 14px;
  font-weight: bold;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-pale-purple);
}

.sizing-note {
  font-size: 12px;
  color: var(--color-gray);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sizing-note a { color: var(--color-primary); }

/* Note cards */
.note-card { margin: 16px 0; font-size: 14px; }

/* --- Act 5: Next Steps --- */
.next-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 32px 0;
}
.next-step-card {
  background: var(--color-white);
  border: 1px solid var(--color-pale-purple);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.next-step-card .step-icon {
  width: 40px; height: 40px;
  background: var(--color-pale-purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.next-step-card h3 { font-size: 16px; margin: 0; }
.next-step-card p { font-size: 13px; color: var(--color-gray); margin: 0; flex: 1; }
.next-step-card .email-inline {
  display: flex;
  gap: 8px;
}
.next-step-card .email-inline input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--color-pale-purple);
  border-radius: var(--radius-btn);
  font-size: 14px;
  background: var(--color-bg);
}
.next-step-card .email-inline input:focus { border-color: var(--color-primary); outline: none; }
.next-step-card .email-inline .btn { padding: 10px 16px; font-size: 13px; }
.email-success-msg { color: #155724; font-weight: bold; font-size: 13px; }
.email-privacy { font-size: 11px; color: var(--color-gray); margin-top: 4px; }
.email-privacy a { color: var(--color-primary); }

.next-step-card .explore-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.explore-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 0;
}
.explore-link:hover { text-decoration: underline; }
.explore-link svg { flex-shrink: 0; }

/* --- Act 6: Actions --- */
.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 24px 0 8px;
}
.results-actions a,
.results-actions button {
  font-size: 13px;
  color: var(--color-gray);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.results-actions a:hover,
.results-actions button:hover { color: var(--color-primary); }

/* --- Results Responsive --- */
@media (min-width: 768px) {
  .results-hero {
    flex-direction: row;
    align-items: flex-start;
    padding: 32px;
    gap: 28px;
  }
  .hero-scan {
    flex: 0 0 auto;
    text-align: center;
  }
  .hero-scan .captured-image { width: 160px; height: 160px; }
  .scan-measurements-list { max-width: 170px; }
  .scan-meas-item { font-size: 14px; }
  .hero-rec { flex: 1; }
  .hero-rec h1 { font-size: 34px; }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .next-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .results-hero { padding: 40px; gap: 32px; }
  .hero-scan .captured-image { width: 190px; height: 190px; }
  .hero-rec h1 { font-size: 38px; }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-card .product-image-wrap { min-height: 240px; }
  .product-card .product-image { max-height: 220px; }
}

/* ===== Science Modal ===== */
.science-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: 12px;
  font-weight: bold;
}
.science-link:hover { text-decoration: underline; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.modal-card {
  background: var(--color-white);
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--color-white);
  border: none;
  cursor: pointer;
  color: var(--color-gray);
  padding: 6px;
  z-index: 10;
  border-radius: 6px;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--color-bg); color: var(--color-dark); }
.modal-card h2 { font-size: 22px; margin-bottom: 24px; padding-right: 32px; }
.modal-section {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.modal-section:last-child { margin-bottom: 0; }
.modal-section-icon {
  width: 48px;
  height: 48px;
  background: var(--color-pale-purple);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-section h3 { font-size: 16px; margin-bottom: 6px; }
.modal-section p { font-size: 14px; color: var(--color-gray); line-height: 1.6; margin: 0; }

/* ===== Mobile-First Responsive ===== */

@media (max-width: 600px) {
  /* --- Header: compact single row --- */
  .site-header { height: 52px; padding: 0 12px; }
  .site-header .logo img { height: 24px; }
  .header-nav { gap: 2px; }
  .header-nav .nav-link { font-size: 13px; padding: 6px 10px; }
  .site-header .phone-link { font-size: 0; }
  .site-header .phone-link svg { font-size: initial; width: 22px; height: 22px; }

  /* --- Typography --- */
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  body { font-size: 16px; }

  /* --- Landing Hero --- */
  .landing-hero { padding: 8px 0 12px; text-align: center; }
  .landing-hero-text h1 { font-size: 28px; }
  .hero-subtitle { font-size: 16px; margin-bottom: 20px; }

  /* Stats: horizontal row, compact */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: center;
    background: var(--color-white);
    border-radius: 12px;
    padding: 16px 12px;
    box-shadow: 0 1px 4px rgba(46,27,152,0.06);
  }
  .hero-stat { text-align: center; }
  .hero-stat strong { font-size: 20px; display: block; }
  .hero-stat span { font-size: 11px; }
  .hero-stat-divider { width: 1px; height: 28px; background: var(--color-pale-purple); margin: 0 auto; }

  /* CTA area */
  .hero-cta { margin-top: 16px; text-align: center; }
  .disclaimer-check { font-size: 13px; text-align: left; }
  .disclaimer-gate { padding: 12px 14px; }
  .btn-large { font-size: 16px; padding: 14px 20px; width: 100%; justify-content: center; }

  /* Science link */
  .science-link { justify-content: center; font-size: 13px; }

  /* --- How It Works --- */
  .how-it-works { padding: 16px; }
  .how-it-works h2 { font-size: 16px; margin-bottom: 14px; }
  .steps-row { flex-direction: column; gap: 8px; }
  .step-arrow { transform: rotate(90deg); }
  .step-item { max-width: none; width: 100%; }
  .step-icon-wrap { width: 44px; height: 44px; border-radius: 10px; }
  .step-icon-wrap svg { width: 22px; height: 22px; }
  .step-num { width: 18px; height: 18px; font-size: 10px; }
  .step-text strong { font-size: 13px; }
  .step-text span { font-size: 11px; }

  /* --- Disclaimer note --- */
  .landing-disclaimer-note p { font-size: 11px; }

  /* --- Trust bar --- */
  .trust-bar { gap: 8px; }
  .trust-bar-item { padding: 12px 14px; }
  .trust-bar-item svg { width: 20px; height: 20px; }
  .trust-bar-item strong { font-size: 13px; }
  .trust-bar-item span { font-size: 11px; }

  /* --- Mask types --- */
  .mask-types-section h2 { font-size: 18px; }
  .section-subtitle { font-size: 13px; }
  .mask-types-grid { gap: 8px; }
  .mask-type-card { padding: 14px 10px; }
  .mask-type-photo { height: 90px; }
  .mask-type-photo img { max-height: 80px; }
  .mask-type-card h3 { font-size: 13px; }
  .mask-type-card p { font-size: 11px; }

  /* --- Results hero --- */
  .results-hero { padding: 16px; gap: 10px; border-radius: 12px; }
  .hero-scan .captured-image { width: 100px; height: 100px; }
  .scan-measurements-list { max-width: 170px; }
  .scan-meas-item { font-size: 14px; }
  .hero-rec h1 { font-size: 26px; margin-bottom: 6px; }
  .hero-rec .size-badge { font-size: 14px; padding: 7px 16px; margin-bottom: 8px; }
  .hero-rec .size-note { font-size: 13px; padding: 8px 12px; margin-bottom: 8px; }
  .hero-rec .why-summary { font-size: 14px; margin-bottom: 8px; }
  .context-badge { font-size: 12px; padding: 4px 10px; }

  /* --- Product cards --- */
  .product-card .product-image-wrap { min-height: 160px; }
  .product-card .product-body { padding: 14px 16px 16px; }

  /* --- Next steps --- */
  .next-step-card { padding: 16px; }
  .next-step-card .email-inline { flex-direction: column; }
  .next-step-card .email-inline .btn { width: 100%; }

  /* --- Modal --- */
  .modal-overlay { padding: 12px; }
  .modal-card { padding: 20px; border-radius: 12px; }
  .modal-card h2 { font-size: 18px; }
  .modal-section { flex-direction: column; gap: 10px; }

  /* --- Footer --- */
  .footer-inner { padding: 28px 16px 20px; gap: 24px; }
  .footer-brand { max-width: none; }
  .footer-tagline { font-size: 18px; }
  .footer-desc { font-size: 12px; }
  .footer-columns { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .footer-col h4 { font-size: 11px; margin-bottom: 10px; }
  .footer-col a { font-size: 13px; padding: 3px 0; }
  .footer-bottom { padding: 14px 16px; flex-direction: column; gap: 6px; text-align: center; }
  .footer-legal { justify-content: center; }

  /* --- Password gate --- */
  .password-gate { padding: 16px; }
  .password-card { padding: 28px 20px; }
  .password-logo { height: 32px; }
}

/* Tablet and up */
@media (min-width: 768px) {
  h1 { font-size: 36px; }
  h2 { font-size: 24px; }
  .hero-subtitle { font-size: 18px; }
}

/* ===== Print Styles ===== */
@media print {
  /* Hide non-content elements */
  .site-header, .site-footer, .password-gate,
  .next-steps, .results-actions, .collapsible-header svg,
  #btn-print-results, #print-step,
  .btn-shop-now, .btn-primary, .btn-secondary { display: none !important; }

  /* Show only the results screen */
  .screen { display: none !important; }
  #screen-results { display: block !important; }

  /* Clean up layout */
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .results-hero { box-shadow: none; border: 1px solid #ddd; }
  .product-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #eee; }

  /* Expand collapsed sections for print */
  .collapsible-content { max-height: none !important; overflow: visible !important; }

  /* Make links show their URLs */
  .product-card a[href]::after { content: " (" attr(href) ")"; font-size: 10px; color: #888; word-break: break-all; }

  /* Add a footer note */
  #screen-results::after {
    content: "Sleep Doctor | SleepDoctor.com | 1 (844) 757-9355";
    display: block;
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
  }
}
