/* ============================================================
   CareLabl /start quiz funnel — quiz.css
   Design system: docs/DESIGN.md
   Mobile-first, 390px primary, centered column max 480px
   ============================================================ */

:root {
  --bg: #f4f0ea; /* Warm Linen */
  --surface: #ffffff; /* Soft Cotton */
  --text: #1a1a1a; /* Pressed Charcoal */
  --text-muted: #7a7468; /* Tumble Grey */
  --accent: #2b5ce6; /* Detergent Blue */
  --accent-hover: #1e47b8;
  --amber: #e8913a; /* Dryer Amber */
  --amber-light: #fff3e6;
  --border: #d6d0c4; /* Tag Stitch */
  --border-light: #e8e3da;
  --success: #2a9d6e; /* Fresh Mint */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --ease-move: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Layout shell ── */
.quiz-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
}

.quiz-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.quiz-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 16px 32px;
}

.quiz-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 16px rgba(26, 24, 21, 0.07);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quiz-footer {
  padding: 12px 24px 20px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.quiz-footer a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

.quiz-footer a:hover {
  color: var(--text);
}

/* ── Progress dots ── */
.progress-track {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: default;
  padding: 0;
  transition:
    background 200ms var(--ease-move),
    border-color 200ms var(--ease-move),
    transform 200ms var(--ease-move);
}

.progress-dot.active {
  background: var(--amber);
  border-color: var(--amber);
  transform: scale(1.25);
}

.progress-dot.done {
  background: var(--border);
  border-color: var(--border);
}

/* ── Screen container & transition ── */
.quiz-screen-container {
  min-height: 300px;
}

.quiz-screen {
  animation: screen-in 300ms var(--ease-move) both;
}

.quiz-screen.exit {
  animation: screen-out 200ms ease-in both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes screen-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* ── Headings ── */
.quiz-step-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.quiz-h {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 24px;
}

/* ── Option buttons (single-select) ── */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 150ms,
    background 150ms,
    transform 100ms;
  position: relative;
}

.option-btn:hover {
  border-color: var(--accent);
  background: #eef2ff;
  transform: translateX(2px);
}

.option-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-btn.selected {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
  font-weight: 600;
}

/* Multi-select checkbox indicator */
.option-btn.multi {
  padding-left: 46px;
}

.option-btn.multi::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition:
    border-color 150ms,
    background 150ms;
}

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

.option-btn.multi.selected::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg) translateY(-2px);
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

/* ── Primary CTA button ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px 24px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    background 200ms,
    transform 200ms,
    box-shadow 200ms;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 92, 230, 0.28);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* ── Back button ── */
.quiz-nav {
  min-height: 32px;
  display: flex;
  align-items: center;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms;
}

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

.btn-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.btn-back[hidden] {
  display: none;
}

/* ── Screen 4: Profile card ── */
.profile-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--surface);
  position: relative;
}

.profile-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-card-label::after {
  content: "";
  flex: 1;
  height: 1px;
  border-top: 1px dashed var(--border);
}

.profile-lines {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.profile-line {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  padding-left: 14px;
  border-left: 2px solid var(--amber);
}

.profile-closet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.profile-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid #f0c890;
  border-radius: 6px;
  padding: 4px 10px;
}

/* ── Screen 5: Pricing ── */
.pricing-intro {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.pricing-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 20px 18px;
  background: var(--surface);
  position: relative;
  transition:
    border-color 150ms,
    box-shadow 150ms;
}

.pricing-card.featured {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 2px 12px rgba(43, 92, 230, 0.12);
}

.pricing-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 10px;
}

.pricing-card:not(.featured) .pricing-badge {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pricing-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.pricing-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pricing-card .btn-primary {
  font-size: 15px;
  padding: 12px 20px;
}

.pricing-card:not(.featured) .btn-primary {
  background: var(--bg);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.pricing-card:not(.featured) .btn-primary:hover {
  background: #eef2ff;
}

.pricing-footer-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  padding: 0 4px;
}

/* ── Responsive: desktop centering ── */
@media (min-width: 600px) {
  .quiz-main {
    padding: 32px 24px 48px;
    align-items: center;
  }

  .quiz-card {
    padding: 40px 40px 32px;
  }

  .quiz-h {
    font-size: 32px;
  }

  .option-btn {
    font-size: 17px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .quiz-screen,
  .quiz-screen.exit,
  .option-btn,
  .btn-primary,
  .progress-dot {
    animation: none;
    transition: none;
  }
}
