/* Layers Counseling - Therapist Match Quiz.
 * Everything scoped under #tm-quiz so it can sit inside any Webflow page without leaking.
 * Tokens mirror the live site palette (webflow.shared css): old-lace, dark-slate-greys,
 * olive-drab, dark-sea-green, papaya-whip, dim-grey. Fonts come from the host page
 * (Generalsans + Newyork are @font-face'd site-wide; index.html declares them for local preview).
 *
 * GOTCHA: the `#tm-quiz button` reset outranks bare `.tmq-*` classes - every component
 * selector below MUST keep the `#tm-quiz` prefix or it silently loses.
 * Typography rule (user call 2026-08-03): NO Newyork serif anywhere in the quiz -
 * everything is Generalsans, sized generously on desktop via clamp().
 */
#tm-quiz {
  --tmq-cream: #fbf4e6;
  --tmq-paper: #f7e8cb;
  --tmq-ink: #142e29;
  --tmq-green: #1c3a29;
  --tmq-body: #575044;
  --tmq-olive: #708840;      /* bars, fills, focus rings - non-text only (3.6:1 on cream) */
  --tmq-olive-text: #5c7030; /* small olive text - 5.0:1 on cream, clears WCAG AA */
  --tmq-leaf: #c5d3a8;
  --tmq-line: rgba(20, 46, 41, 0.25);
  --tmq-sans: Generalsans, 'Segoe UI', Arial, sans-serif;

  font-family: var(--tmq-sans);
  color: var(--tmq-body);
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  /* fill the viewport under the site nav so the quiz reads as a full screen,
     never shrinking below what the longest question needs */
  min-height: max(560px, calc(100vh - 250px));
  min-height: max(560px, calc(100dvh - 250px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 600px) {
  #tm-quiz { padding: 28px 16px 24px; }
}
@media (min-width: 1920px) {
  #tm-quiz { max-width: 860px; }
}
/* results screens size to their content - no stretched dead space above the crisis line */
#tm-quiz.tmq-fit { min-height: 0; }
#tm-quiz *, #tm-quiz *::before, #tm-quiz *::after { box-sizing: border-box; }

#tm-quiz button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
#tm-quiz :focus-visible {
  outline: 2px solid var(--tmq-olive);
  outline-offset: 3px;
  border-radius: 4px;
}
/* headings receive programmatic focus for screen readers; no visible ring there */
#tm-quiz h1:focus, #tm-quiz h2:focus { outline: none; }

/* ---- persistent progress bar ---- */
#tm-quiz .tmq-progress {
  height: 3px;
  background: rgba(20, 46, 41, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 34px;
  flex: none;
}
#tm-quiz .tmq-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--tmq-olive);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- stage + screen transitions ---- */
#tm-quiz .tmq-stage { flex: 1; display: flex; flex-direction: column; }
#tm-quiz .tmq-view { flex: 1; display: flex; flex-direction: column; }
#tm-quiz .tmq-anim { animation: tmq-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
#tm-quiz .tmq-leave { animation: tmq-out 0.15s ease-in forwards; }
@keyframes tmq-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes tmq-out {
  to { opacity: 0; transform: translateY(-8px); }
}
/* options cascade in, one beat apart */
#tm-quiz .tmq-anim .tmq-opt {
  animation: tmq-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 0.035s + 0.05s);
}
#tm-quiz .tmq-anim .tmq-card {
  animation: tmq-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 0.07s + 0.05s);
}

@media (prefers-reduced-motion: reduce) {
  #tm-quiz .tmq-anim, #tm-quiz .tmq-leave,
  #tm-quiz .tmq-anim .tmq-opt, #tm-quiz .tmq-anim .tmq-card { animation: none; }
  #tm-quiz .tmq-progress-fill { transition: none; }
  #tm-quiz .tmq-opt, #tm-quiz .tmq-cta { transition: none; }
  #tm-quiz .tmq-name-link, #tm-quiz .tmq-name-link::after { transition: none; }
}

#tm-quiz .tmq-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 14px;
}
#tm-quiz .tmq-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--tmq-body);
  /* 44px hit area without moving the visual position */
  padding: 12px 14px 12px 0;
  margin: -12px 0;
}
#tm-quiz .tmq-back:hover { color: var(--tmq-ink); }
#tm-quiz .tmq-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tmq-olive-text);
}

/* question screens: Back/counter stay anchored at the top, the question block
   floats vertically centered between them and the pinned crisis line (the two
   auto top margins - here and on .tmq-foot - split the free space evenly) */
#tm-quiz .tmq-view--q .tmq-question { margin-top: auto; }

/* ---- question typography: sans, built for reading ---- */
#tm-quiz .tmq-question {
  font-weight: 600;
  font-size: clamp(24px, 4.4vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--tmq-ink);
  margin: 8px 0 10px;
}
#tm-quiz .tmq-help {
  font-size: clamp(15.5px, 2.2vw, 17.5px);
  line-height: 1.55;
  margin: 0 0 24px;
}
#tm-quiz .tmq-question + .tmq-options { margin-top: 26px; }

/* ---- option rows (single + multi share one shape) ---- */
#tm-quiz .tmq-options { display: flex; flex-direction: column; gap: 12px; }
#tm-quiz .tmq-options--duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  #tm-quiz .tmq-options--duo { display: flex; flex-direction: column; }
}
#tm-quiz .tmq-opt {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  font-size: clamp(16px, 2.4vw, 18px);
  font-weight: 500;
  line-height: 1.35;
  color: var(--tmq-ink);
  background: transparent;
  border: 1px solid var(--tmq-line);
  border-radius: 12px;
  padding: 16px 20px;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
#tm-quiz .tmq-opt:hover {
  background: rgba(20, 46, 41, 0.05);
  border-color: rgba(20, 46, 41, 0.55);
}
#tm-quiz .tmq-opt:active { transform: scale(0.99); }
#tm-quiz .tmq-opt[aria-pressed="true"] {
  background: var(--tmq-ink);
  border-color: var(--tmq-ink);
  color: var(--tmq-cream);
}
#tm-quiz .tmq-opt.tmq-picked { animation: tmq-pick 0.24s ease; }
@keyframes tmq-pick {
  40% { transform: scale(0.985); }
  100% { transform: none; }
}
#tm-quiz .tmq-opt-label { flex: 1; }

/* number hint - desktop pointer devices only */
#tm-quiz .tmq-key {
  display: none;
  flex: none;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tmq-body);
  border: 1px solid var(--tmq-line);
  border-radius: 6px;
}
@media (hover: hover) and (min-width: 600px) {
  #tm-quiz .tmq-key { display: flex; }
}
#tm-quiz .tmq-opt[aria-pressed="true"] .tmq-key {
  color: var(--tmq-cream);
  border-color: rgba(251, 244, 230, 0.55);
}

/* checkbox tick for multi-select rows */
#tm-quiz .tmq-tick {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--tmq-line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
#tm-quiz .tmq-tick svg { width: 11px; height: 9px; opacity: 0; transition: opacity 0.14s ease; }
#tm-quiz .tmq-opt[aria-pressed="true"] .tmq-tick {
  background: var(--tmq-cream);
  border-color: var(--tmq-cream);
  color: var(--tmq-ink);
}
#tm-quiz .tmq-opt[aria-pressed="true"] .tmq-tick svg { opacity: 1; }

/* ---- CTA pill (site .main-button language) ---- */
#tm-quiz .tmq-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--tmq-cream);
  background: var(--tmq-ink);
  border: 1px solid var(--tmq-ink);
  border-radius: 100px;
  padding: 15px 32px 16px;
  margin-top: 28px;
  align-self: flex-start;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
#tm-quiz .tmq-cta:hover { background: var(--tmq-green); }
#tm-quiz .tmq-cta:active { transform: scale(0.98); }
#tm-quiz .tmq-cta--ghost {
  background: transparent;
  color: var(--tmq-ink);
  border-color: rgba(20, 46, 41, 0.45);
}
#tm-quiz .tmq-cta--ghost:hover { background: var(--tmq-ink); color: var(--tmq-cream); border-color: var(--tmq-ink); }
#tm-quiz .tmq-cta--sm { padding: 11px 22px 12px; font-size: 13px; }
#tm-quiz .tmq-phones-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* secondary actions pushed to the right end of a shared button row */
#tm-quiz .tmq-row-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }

/* ---- footer (crisis + disclaimer) ---- */
#tm-quiz .tmq-foot {
  margin-top: auto;
  padding-top: 36px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(87, 80, 68, 0.85);
}
#tm-quiz .tmq-foot strong { font-weight: 600; color: var(--tmq-body); }

/* ---- intro: centered hero, vertically balanced in the tall section ---- */
#tm-quiz .tmq-view--intro {
  align-items: center;
  text-align: center;
}
/* auto top margins on first content + footer split the free space evenly,
   so the intro block sits vertically centered above the pinned footer */
#tm-quiz .tmq-view--intro .tmq-eyebrow { margin-top: auto; }
#tm-quiz .tmq-view--intro .tmq-cta { align-self: center; }
#tm-quiz .tmq-view--intro .tmq-help { max-width: 560px; }

#tm-quiz .tmq-title {
  font-weight: 600;
  font-size: clamp(32px, 5.6vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--tmq-ink);
  margin: 14px 0 16px;
}
#tm-quiz .tmq-privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tmq-olive-text);
  margin-top: 12px;
}
#tm-quiz .tmq-privacy svg { flex: none; }

/* ---- results ---- */
#tm-quiz .tmq-results-h {
  font-weight: 600;
  font-size: clamp(26px, 4.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--tmq-ink);
  margin: 6px 0 20px;
}
#tm-quiz .tmq-sub-h {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tmq-olive-text);
  margin: 32px 0 14px;
}

#tm-quiz .tmq-card {
  border: 1px solid var(--tmq-line);
  border-radius: 16px;
  padding: clamp(24px, 3.4vw, 32px);
  background: transparent;
}
#tm-quiz .tmq-card + .tmq-card { margin-top: 14px; }

/* strongest fit: the one dark moment on the page */
#tm-quiz .tmq-card--top {
  background: var(--tmq-ink);
  border-color: var(--tmq-ink);
  color: var(--tmq-cream);
}

#tm-quiz .tmq-card-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
#tm-quiz .tmq-avatar {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--tmq-leaf);
  color: var(--tmq-ink);
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#tm-quiz .tmq-avatar img { width: 100%; height: 100%; object-fit: cover; }
#tm-quiz .tmq-card-name {
  font-weight: 600;
  font-size: clamp(20px, 3vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  color: inherit;
}
/* name links hover into a soft chip with an arrow sliding in (house boxed-hover language) */
#tm-quiz .tmq-name-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding: 3px 10px;
  margin: -3px -10px;
  border-radius: 10px;
  transition: background-color 0.16s ease;
}
#tm-quiz .tmq-name-link::after {
  content: '\2192';
  display: inline-block;
  margin-left: 8px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#tm-quiz .tmq-card--alt .tmq-name-link:hover { background: rgba(20, 46, 41, 0.07); }
#tm-quiz .tmq-card--top .tmq-name-link:hover { background: rgba(251, 244, 230, 0.14); }
#tm-quiz .tmq-name-link:hover::after { opacity: 1; transform: none; }
#tm-quiz .tmq-card-cred { font-size: 14.5px; line-height: 1.45; margin: 4px 0 0; opacity: 0.85; }
#tm-quiz .tmq-card-fee { font-size: 14.5px; font-weight: 600; margin: 3px 0 0; opacity: 0.9; }
#tm-quiz .tmq-card-reason { font-size: clamp(15.5px, 2.2vw, 17px); line-height: 1.6; margin: 0; }
#tm-quiz .tmq-card--top .tmq-card-reason { font-size: clamp(16.5px, 2.4vw, 18px); }
#tm-quiz .tmq-card-note { font-size: 14px; line-height: 1.55; margin: 12px 0 0; opacity: 0.85; }
#tm-quiz .tmq-card-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
#tm-quiz .tmq-card-actions .tmq-cta { margin-top: 0; }
#tm-quiz .tmq-bio {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
  padding: 12px 8px;
  margin: -12px -8px;
  margin-left: auto; /* bio link sits at the right edge of the actions row */
}
#tm-quiz .tmq-bio:hover { opacity: 1; }
#tm-quiz .tmq-card--alt .tmq-bio { color: var(--tmq-body); }
#tm-quiz .tmq-card--top .tmq-cta { background: var(--tmq-cream); border-color: var(--tmq-cream); color: var(--tmq-ink); }
#tm-quiz .tmq-card--top .tmq-cta:hover { background: var(--tmq-paper); border-color: var(--tmq-paper); }
#tm-quiz .tmq-card--alt .tmq-card-name { color: var(--tmq-ink); }
#tm-quiz .tmq-card--alt .tmq-card-cred, #tm-quiz .tmq-card--alt .tmq-card-fee { color: var(--tmq-body); }
#tm-quiz .tmq-card--alt .tmq-cta { padding: 12px 26px 13px; font-size: 13px; background: transparent; color: var(--tmq-ink); }
#tm-quiz .tmq-card--alt .tmq-cta:hover { background: var(--tmq-ink); color: var(--tmq-cream); }

#tm-quiz .tmq-alts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#tm-quiz .tmq-alts .tmq-card + .tmq-card { margin-top: 0; }
@media (max-width: 560px) { #tm-quiz .tmq-alts { grid-template-columns: 1fr; } }

#tm-quiz .tmq-hatch {
  background: var(--tmq-paper);
  border-radius: 16px;
  padding: clamp(24px, 3.4vw, 32px); /* matches card padding so its buttons share the same line */
  margin-top: 32px;
}
#tm-quiz .tmq-hatch p { margin: 0 0 4px; font-size: 15.5px; line-height: 1.55; color: var(--tmq-ink); }

#tm-quiz .tmq-expect { font-size: 14px; line-height: 1.6; margin: 22px 0 0; }

/* ghost pills inside the dark strongest-fit card (must follow the top-card cta rules) */
#tm-quiz .tmq-card--top .tmq-cta--ghost {
  background: transparent;
  color: var(--tmq-cream);
  border-color: rgba(251, 244, 230, 0.55);
}
#tm-quiz .tmq-card--top .tmq-cta--ghost:hover { background: rgba(251, 244, 230, 0.14); border-color: var(--tmq-cream); }
