/* Growth Quiz styles. Look copied from the old Booking Leak Quiz (deep purple, Poppins, boxed grid).
   Mobile first: designed at 360px wide, text 16px or bigger, tap targets 48px or taller. */
:root {
  --purple: #3C1F43;
  --paper: #FAF3F9;
  --lavender: #B195C1;
  --orange: #FAB07A;
  --ink: #050505;
  --error: #FF8A80;
  --line: rgba(177, 149, 193, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--purple);
  overflow: hidden;
}

body {
  color: var(--paper);
  font-family: "Poppins", sans-serif;
}

[hidden] { display: none !important; }

#quizRoot {
  height: 100dvh;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  background: var(--purple);
  overflow: hidden;
}

.squares-column { display: contents; }

.box {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 0;
  min-width: 0;
}

.title-box { display: flex; flex-direction: column; }
.title-cell { padding: 14px 16px; }
.title-top-cell { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-bottom-cell { display: none; border-top: 1px solid var(--line); }
.combination-mark { height: 24px; width: auto; display: block; }

.quiz-title {
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.15;
  margin: 0;
}

.numbers-box {
  container-type: size;
  position: relative;
  overflow: hidden;
  width: 42vw;
  height: 26vw;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.image-box {
  width: 42vw;
  height: 26vw;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-box img { display: block; max-width: 70%; max-height: 70%; width: auto; height: auto; }

.squares-column { }
@media (max-width: 767px) {
  .squares-column {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
  }
  .numbers-box, .image-box { flex: 0 0 auto; }
  .number-label { display: none; }
}

.number-digits {
  font-weight: 700;
  font-size: min(73.5cqi, 73.5cqb);
  line-height: 0.9;
  margin: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}
.number-digits.is-dim { color: rgba(250, 243, 249, 0.5); }
.number-digits.is-result { color: var(--orange); }
.number-digits.is-changing { opacity: 0; transform: translateY(-10px); }

.number-label {
  font-weight: 500;
  font-size: 18px;
  color: var(--lavender);
  margin: 8px 0 0;
}

@media (min-width: 768px) {
  #quizRoot {
    grid-template-columns: var(--square-size, clamp(280px, 26vw, 400px)) 1fr;
    grid-template-rows: auto 1fr;
  }
  .title-box { grid-column: 1; grid-row: 1; }
  .title-bottom-cell { display: block; padding-left: 15%; padding-right: 15%; }
  .squares-column {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
  }
  .numbers-box, .image-box { width: 100%; height: 100%; min-height: 0; }
  .numbers-box { flex-direction: column; padding: 0; }
  .number-label { position: absolute; right: 15%; bottom: 20px; margin: 0; }
  .quiz-panel { grid-column: 2; grid-row: 2; }
}
@media (min-width: 768px) and (max-height: 700px) {
  .image-box { display: none; }
  .squares-column { grid-template-rows: 1fr; }
}

.quiz-panel {
  position: relative;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.quiz-panel::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .quiz-panel { padding: clamp(24px, 5vw, 72px); } }

.panel-content {
  max-width: 760px;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel-content.is-wide { max-width: 1000px; }

.stage-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 230ms ease, transform 230ms ease;
}
.stage-inner.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .stage-inner, .number-digits { transition: none; transform: none; }
  .answer-row { transition: none; }
}

.back-link {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0 0 0 0;
  margin: 0 0 12px;
  min-height: 48px;
  font-family: inherit;
  font-size: 16px;
  color: var(--lavender);
  cursor: pointer;
  text-decoration: underline;
}

.headline {
  font-weight: 700;
  font-size: clamp(26px, 8vw, 36px);
  line-height: 1.15;
  margin: 0 0 16px;
  outline: none;
}
.headline.question { font-weight: 600; font-size: clamp(20px, 5.8vw, 28px); line-height: 1.25; margin: 0 0 20px; }
@media (min-width: 768px) {
  .headline { font-size: clamp(34px, 4.2vw, 56px); }
  .headline.question { font-size: clamp(26px, 3vw, 40px); }
}

.body-text { font-size: 16px; line-height: 1.5; margin: 0 0 20px; }
@media (min-width: 768px) { .body-text { font-size: 18px; } }
.small-text { font-size: 14px; line-height: 1.5; color: var(--lavender); margin: 0; }
.small-text a { color: var(--paper); }
.accent { color: var(--orange); }

.primary-btn, .secondary-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  padding: 14px 20px;
  text-align: center;
  text-decoration: none;
}
.primary-btn { background: var(--orange); color: var(--ink); border: none; }
.primary-btn:disabled { opacity: 0.6; cursor: default; }
.secondary-btn { background: transparent; color: var(--paper); border: 1.5px solid var(--lavender); }
@media (min-width: 768px) { .start-btn { width: 240px; } }
a.primary-btn, a.secondary-btn { display: flex; align-items: center; justify-content: center; }

.primary-btn:focus-visible, .secondary-btn:focus-visible, .answer-row:focus-visible,
.back-link:focus-visible, .choice:focus-within, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible, video:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.answers-group { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.answer-row {
  display: block;
  width: 100%;
  min-height: 56px;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--lavender);
  border-radius: 6px;
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.answer-row.is-selected { background: var(--paper); color: var(--purple); }
.answer-row.is-pressed { transform: scale(0.98); }
@media (min-width: 768px) { .answers-group { max-width: 480px; } }

/* ----- forms ----- */
.field-group { margin-bottom: 18px; border: 0; padding: 0; min-width: 0; }
.field-label { display: block; font-size: 16px; line-height: 1.4; color: var(--paper); margin-bottom: 6px; padding: 0; }
.field-input {
  display: block;
  width: 100%;
  min-height: 52px;
  background: transparent;
  border: 1px solid var(--lavender);
  border-radius: 6px;
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
}
select.field-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B195C1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
select.field-input option { color: var(--ink); background: var(--paper); }
.field-input::placeholder { color: var(--lavender); }
.field-textarea { min-height: 120px; resize: vertical; }
.field-input[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: 16px; line-height: 1.4; margin: 6px 0 0; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--lavender);
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.choice input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--orange); margin: 0; }
.choice:has(input:checked) { background: rgba(250, 176, 122, 0.15); border-color: var(--orange); }
.form-actions { margin-top: 8px; }
.form-actions .small-text { margin-top: 14px; }

.working { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ----- results ----- */
.section-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 8px 0 28px; }
@media (min-width: 1000px) { .section-cards { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title { font-weight: 600; font-size: 18px; margin: 0; }
.status-tag { flex: 0 0 auto; font-weight: 600; font-size: 14px; border-radius: 4px; padding: 4px 8px; white-space: nowrap; }
.status-tag.is-bad, .status-tag.is-mid { color: var(--orange); border: 1px solid var(--orange); }
.status-tag.is-good { color: var(--lavender); border: 1px solid var(--line); }
.fix-card { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 12px; }
.fix-heading { font-weight: 700; font-size: 18px; line-height: 1.3; margin: 0 0 8px; }
.fix-text { font-size: 16px; line-height: 1.5; margin: 0 0 12px; }
.fix-do { margin-bottom: 6px; }
.fix-list { margin: 0 0 12px; padding-left: 22px; font-size: 16px; line-height: 1.5; }
.fix-list li { margin-bottom: 6px; }
.fix-btn { margin: 4px 0 12px; }
.no-fixes { margin: 0; color: var(--lavender); }
.draw-line { font-weight: 600; font-size: 20px; line-height: 1.3; margin: 0 0 28px; color: var(--orange); }
.results-end { margin-top: auto; padding-top: 8px; }

/* ----- video ----- */
.vsl-block { margin: 0 0 28px; }
.vsl-block h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.player-wrap { display: flex; justify-content: center; background: #000; border-radius: 6px; overflow: hidden; }
.player-wrap video {
  --r: 1.7778;
  --max-h: min(60dvh, calc(100dvh - 300px));
  display: block;
  width: min(100%, calc(var(--max-h) * var(--r)));
  aspect-ratio: var(--r);
  height: auto;
  max-height: var(--max-h);
  object-fit: contain;
  background: #000;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 5, 5, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal-card {
  background: var(--purple);
  border: 1px solid var(--lavender);
  border-radius: 8px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 24px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.modal-card h2 { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; outline: none; }
.modal-card p { font-size: 16px; line-height: 1.4; margin: 0; }
.modal-card .player-wrap { flex: 0 1 auto; min-height: 0; }
.modal-card .player-wrap video { --max-h: min(60dvh, calc(100dvh - 250px)); }
.modal-card .primary-btn { flex: 0 0 auto; }

/* ----- /growth/next page ----- */
.next-page { min-height: 100dvh; padding: 16px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
body.next-body, html.next-html { height: auto; overflow: auto; }
.next-page .player-wrap video { --max-h: min(60dvh, 560px); }
.next-page .combination-mark { align-self: flex-start; }
fieldset.field-group { margin: 0 0 18px; }

/* ----- results: one container per question ----- */
.section-groups { display: flex; flex-direction: column; gap: 28px; margin: 8px 0 28px; }
.sec-group .card-header { margin-bottom: 12px; }
.q-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1000px) { .q-cards { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.q-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.q-card.needs-fix { border-color: var(--lavender); }
.q-text { font-size: 15px; line-height: 1.45; color: var(--lavender); margin: 0 0 10px; }
.q-answer { font-size: 16px; line-height: 1.4; margin: 0; }
.q-answer-label { color: var(--lavender); }
.q-card .no-fixes { margin-top: 12px; }

/* ---------- start screen ---------- */
.start-headline { font-size: 34px; line-height: 1.1; margin: 0 0 16px; }
.start-prize { color: var(--orange); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 0 0 14px; }
.start-pill {
  display: inline-block;
  align-self: flex-start;
  color: var(--lavender);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  border: 1px solid var(--lavender);
  border-radius: 6px;
  padding: 6px 14px;
  margin: 0 0 20px;
}
.start-results { color: rgba(250, 243, 249, 0.85); font-weight: 400; font-size: 16px; line-height: 1.5; margin: 0 0 28px; }
.terms-toggle { margin-top: 14px; }
.terms-toggle summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--lavender);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}
.terms-toggle summary::-webkit-details-marker { display: none; }
.terms-toggle summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.terms-toggle[open] .terms-body { margin-top: 4px; }
.terms-heading { color: var(--paper); font-weight: 700; font-size: 16px; line-height: 1.3; margin: 0 0 8px; }
.terms-list { margin: 0; padding-left: 20px; color: rgba(250, 243, 249, 0.85); font-size: 14px; line-height: 1.5; }
.terms-list li { margin: 0 0 6px; }
.form-actions .terms-body { margin-bottom: 20px; }

@media (min-width: 768px) {
  .start-headline { font-size: 52px; margin-bottom: 20px; }
  .start-prize { font-size: 30px; margin-bottom: 16px; }
  .start-pill { font-size: 16px; margin-bottom: 24px; }
  .start-results { font-size: 20px; margin-bottom: 32px; }
  .start-btn { width: 100%; max-width: 360px; }
  .terms-toggle summary { font-size: 14px; }
}

/* ---------- offer page + join card ---------- */
.offer-headline { font-size: clamp(26px, 7.5vw, 32px); line-height: 1.15; margin: 0 0 16px; }
.offer-thanks { color: rgba(250, 243, 249, 0.85); margin: 0 0 20px; }
.offer-intro { color: var(--orange); font-weight: 700; font-size: 18px; line-height: 1.3; margin: 0 0 12px; }
.offer-list { margin: 0 0 28px; padding: 0; list-style: none; }
.offer-list li { position: relative; padding: 0 0 0 28px; margin: 0 0 10px; font-size: 16px; line-height: 1.45; }
.offer-list li::before { content: ""; position: absolute; left: 4px; top: 0.35em; width: 6px; height: 11px; border: solid var(--orange); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.offer-btn { margin-bottom: 4px; }
.text-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; color: var(--lavender); font-family: inherit; font-size: 15px;
  text-decoration: underline; cursor: pointer;
}
.text-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.join-card { border: 1px solid var(--line); border-radius: 6px; padding: 20px 16px; margin: 0 0 28px; }
.join-heading { color: var(--orange); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 0 0 8px; }
.join-card .body-text { margin-bottom: 16px; }
@media (min-width: 768px) {
  .offer-headline { font-size: clamp(30px, 3.4vw, 44px); }
  .offer-list li { font-size: 18px; }
  .offer-btn, .join-card .primary-btn { max-width: 360px; }
  .offer-intro { font-size: 20px; }
}

/* Offer page: the Join button stays at the bottom of the screen while the list scrolls. */
.offer-list { margin-bottom: 8px; }
.offer-terms { margin: 0 0 8px; }
.offer-actions {
  position: sticky;
  bottom: -20px;
  margin: 0 -16px -20px;
  padding: 14px 16px 12px;
  background: linear-gradient(to bottom, rgba(60, 31, 67, 0), var(--purple) 22%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.offer-actions .primary-btn { margin: 0 0 2px; }
@media (min-width: 768px) {
  .offer-actions { bottom: calc(-1 * clamp(24px, 5vw, 72px)); margin: 0 calc(-1 * clamp(24px, 5vw, 72px)) calc(-1 * clamp(24px, 5vw, 72px)); padding: 16px clamp(24px, 5vw, 72px) 14px; }
}
