/* ==========================================================================
   TraitPath test-flow skin — the v2 design system for the classic assessment
   flow (comprehensive / career / partswork). One file, recycled by all three
   test shells. Load LAST (after styles.css + auth-modal.css) — it overrides
   the legacy purple-glass chrome by specificity (body.test-mode prefix) and
   by order. The engine (test-handler/*) is untouched: every selector here
   matches the classes the engine already renders.

   Per-test personality dials mirror each assessment's landing page:
     comprehensive → sky/violet (Blueprint)  ·  career → amber  ·  partswork → rose
   The dials feed the SAME --accent-* variables the legacy chrome and the
   career questionnaire already consume, so everything follows automatically.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens + per-test dials
   -------------------------------------------------------------------------- */
body.test-mode {
  --bg: #0e1116;
  --bg-soft: #161b22;
  --card: #1b2129;
  --line: #2a3340;
  --ink: #eef2f7;
  --ink-soft: #aeb9c7;
  --ink-dim: #7d8896;
  --mint: #6ee7b7;
  --sky: #7cc4ff;

  /* Default dial (comprehensive look) — overridden per test type below */
  --accent: #7cc4ff;
  --accent-2: #a5b4fc;
  --accent-ink: #0a1a2e;
  --accent-rgb: 124, 196, 255;
  --accent-gradient: linear-gradient(100deg, #7cc4ff, #a5b4fc);

  --test-bg: radial-gradient(1000px 500px at 50% -10%, #17202b 0%, #0e1116 55%) no-repeat, #0e1116;
}

body.test-mode[data-test-type="comprehensive"] {
  --accent: #7cc4ff;
  --accent-2: #a5b4fc;
  --accent-ink: #0a1a2e;
  --accent-rgb: 124, 196, 255;
  --accent-gradient: linear-gradient(100deg, #7cc4ff, #a5b4fc);
}

body.test-mode[data-test-type="career"] {
  --accent: #fbbf24;
  --accent-2: #fcd34d;
  --accent-ink: #231a05;
  --accent-rgb: 251, 191, 36;
  --accent-gradient: linear-gradient(100deg, #fbbf24, #f59e0b);
}

body.test-mode[data-test-type="partswork"] {
  --accent: #f9a8d4;
  --accent-2: #c4b5fd;
  --accent-ink: #2b0f1f;
  --accent-rgb: 249, 168, 212;
  --accent-gradient: linear-gradient(100deg, #f9a8d4, #c4b5fd);
}

body.test-mode[data-test-type="neurodivergence"] {
  --accent: #6ee7b7;
  --accent-2: #7cc4ff;
  --accent-ink: #06251b;
  --accent-rgb: 110, 231, 183;
  --accent-gradient: linear-gradient(100deg, #6ee7b7, #7cc4ff);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
body.test-mode {
  background: var(--test-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-top: 0; /* header is sticky in-flow, not fixed */
  padding-bottom: 88px; /* room for the fixed bottom question nav */
  -webkit-font-smoothing: antialiased;
}

body.test-mode button {
  font-family: inherit;
}

body.test-mode a {
  color: var(--accent-2);
}

body.test-mode a:hover {
  color: var(--ink);
}

body.test-mode .container.test-mode {
  padding: 14px 20px 0;
  max-width: 860px;
}

/* --------------------------------------------------------------------------
   v2 report on the results page — the report needs the same canvas it gets on
   view-report: full width (the 860px test column squeezes its sidebar+content
   grid) and a working sticky sidebar (the form's overflow:auto made the form
   the sticky scroller, so the section nav never stuck to the page).
   -------------------------------------------------------------------------- */
body.test-mode .container.test-mode:has(.tp-v2-container) {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

body.test-mode form:has(.tp-v2-container) {
  overflow: visible;
}

body.test-mode :is(.comprehensive-test, .career-test, .partswork-test, .neurodivergence-test):has(.tp-v2-container) {
  max-width: none;
}

/* Question-progress chrome is meaningless once the report is showing — and its
   -20px gutters overflow the viewport once the container padding is gone. */
body.test-mode .container.test-mode:has(.tp-v2-container) :is(.progress-info, .progress-bar-container) {
  display: none;
}

/* The report's sticky elements sit under the test flow's sticky .tf-header (56px):
   mobile section pills pin right below it. */
body.test-mode .tp-report-v2 .section-nav {
  top: 56px;
}

/* --------------------------------------------------------------------------
   3. Header (markup lives in the shells — .tf-header is owned by this file)
   -------------------------------------------------------------------------- */
.tf-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(14, 17, 22, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  /* styles.css targets bare <header> with opacity:0 + fadeIn — pin visible here */
  opacity: 1;
  animation: none;
  box-shadow: none;
  width: 100%;
}

.tf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16.5px;
  color: var(--ink) !important;
  text-decoration: none;
  white-space: nowrap;
}

.tf-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.tf-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  text-align: right;
}

/* --------------------------------------------------------------------------
   4. Progress (sticky topbar pair: .progress-info sits on .progress-bar-container)
   -------------------------------------------------------------------------- */
body.test-mode .progress-info {
  position: sticky;
  top: 56px;
  z-index: 50;
  margin: 0 -20px;
  padding: 10px 22px 6px;
  min-height: 0;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  color: var(--ink-dim);
}

body.test-mode .progress-info .domain-label {
  color: var(--accent);
  font-weight: 600;
}

body.test-mode .progress-info .question-counter {
  color: var(--ink-dim);
  font-size: 13px;
}

body.test-mode .progress-bar-container {
  position: sticky;
  top: 92px;
  z-index: 50;
  height: 6px;
  width: auto; /* styles.css sets width:100%, which + content-box padding overflows */
  margin: 0 -20px;
  padding: 0 22px 10px;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0;
  overflow: visible;
  box-sizing: content-box;
}

/* Track: pinned to the strip's own insets so it's correct at every width */
body.test-mode .progress-bar-container::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 6px;
  background: var(--card);
  border-radius: 999px;
}

body.test-mode .progress-bar {
  height: 6px;
  background: var(--accent-gradient);
  border-radius: 999px;
  box-shadow: none;
  position: relative;
}

/* --------------------------------------------------------------------------
   5. Instructions panel (the pre-test notice)
   -------------------------------------------------------------------------- */
body.test-mode .instructions-panel {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  max-width: 640px;
  margin: 40px auto 24px;
  padding: 0;
  font-family: inherit;
}

body.test-mode .instructions-header {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 26px;
  text-align: center;
}

body.test-mode .instructions-header h3 {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
  font-size: clamp(24px, 4.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  display: block;
  margin-bottom: 12px;
}

body.test-mode .instructions-header h3 i {
  display: none; /* clipboard icon — the v2 intro is typographic */
}

body.test-mode .instructions-header p {
  color: var(--ink-soft);
  font-size: 16.5px;
  max-width: 540px;
  margin: 0 auto;
}

body.test-mode .instructions-content {
  gap: 10px;
  margin-bottom: 22px;
}

body.test-mode .instruction-step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  gap: 14px;
}

body.test-mode .instruction-step:hover {
  transform: none;
  background: #20272f;
}

body.test-mode .step-number {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--accent);
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 13px;
  box-shadow: none;
}

body.test-mode .step-content h4 {
  color: var(--ink);
  font-size: 15px;
}

body.test-mode .step-content p {
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

body.test-mode .instructions-footer {
  border-top: 0;
  padding-top: 4px;
  margin-top: 20px;
}

body.test-mode .instructions-footer p {
  color: var(--ink-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

body.test-mode .start-test-button {
  background: var(--accent-gradient);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 40px;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.test-mode .start-test-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 38px rgba(var(--accent-rgb), 0.28);
  filter: none;
}

/* IFS educational-tool disclaimer under the instructions */
body.test-mode .assessment-legal-disclaimer {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0 0;
  max-width: none;
}

body.test-mode .assessment-legal-disclaimer p {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

body.test-mode .assessment-legal-disclaimer strong {
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   6. Questions
   -------------------------------------------------------------------------- */
body.test-mode .question {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  max-width: 680px;
  height: auto;
  min-height: 0;
  margin: 34px auto 0;
  padding: 0 0 20px;
  position: static;
}

body.test-mode .question.active {
  display: block;
}

/* Gentle entrance for every direction — replaces the legacy long slides */
body.test-mode .question.active.slide-up,
body.test-mode .question.active.slide-left,
body.test-mode .question.active.slide-right {
  animation: tfQuestionIn 0.28s ease both;
}

@keyframes tfQuestionIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

body.test-mode .question .qnum {
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

body.test-mode .question p {
  text-align: left;
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 26px;
  padding-bottom: 0;
  border-bottom: 0;
  border-image: none;
}

body.test-mode .choices-container {
  position: static;
  transform: none;
  top: auto;
  left: auto;
  right: auto;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.test-mode .choices {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

body.test-mode .choices::before {
  content: "How much do you agree?";
  font-size: 12.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

/* Neurodivergence uses a frequency scale, not agree/disagree */
body.test-mode[data-test-type="neurodivergence"] .choices::before {
  content: "How often is this true for you?";
}

body.test-mode .choices button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 52px;
  padding: 14px 18px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0;
  backdrop-filter: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

/* Number chip: the 1–5 keyboard shortcut, tinted along the disagree→agree spectrum */
body.test-mode .choices button .key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-dim);
}

body.test-mode .choices button:nth-child(1),
body.test-mode .choices button:nth-child(2),
body.test-mode .choices button:nth-child(3),
body.test-mode .choices button:nth-child(4),
body.test-mode .choices button:nth-child(5) {
  border-bottom: 1px solid var(--line);
}

body.test-mode .choices button:nth-child(1) .key { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
body.test-mode .choices button:nth-child(2) .key { color: #fb923c; border-color: rgba(251, 146, 60, 0.4); }
body.test-mode .choices button:nth-child(3) .key { color: #94a3b8; border-color: rgba(148, 163, 184, 0.4); }
body.test-mode .choices button:nth-child(4) .key { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
body.test-mode .choices button:nth-child(5) .key { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); }

body.test-mode .choices button.selected .key {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--accent-ink);
}

body.test-mode .choices button:hover {
  transform: none;
  box-shadow: none;
  background: #20272f;
  border-color: #3a4a5e;
  color: var(--ink);
}

body.test-mode .choices button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

body.test-mode .choices button.selected {
  background: rgba(var(--accent-rgb), 0.10);
  border: 1px solid var(--accent);
  color: var(--ink);
  transform: none;
  box-shadow: none;
  font-weight: 600;
}

/* Wide screens: lay the scale flat (disagree → agree reads left → right) so the
   question + all five choices + nav fit without scrolling, even zoomed.
   769px = just above the site-wide 768px mobile block, so the two never overlap. */
@media (min-width: 769px) {
  body.test-mode .choices {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  body.test-mode .choices::before {
    flex-basis: 100%;
  }

  body.test-mode .choices button {
    flex: 1 1 0;
    min-width: 106px;
    flex-direction: column;
    justify-content: flex-start; /* chip pinned to one shared top line across all five */
    text-align: center;
    gap: 10px;
    min-height: 92px;
    padding: 14px 10px 12px;
    font-size: 14px;
    line-height: 1.25;
  }

  /* Label centers in the space under the chip, so 1- and 2-line labels both look right */
  body.test-mode .choices button .choice-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Keyboard hint only where a keyboard is likely */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  body.test-mode .choices::after {
    content: "Tip: press 1–5 to answer";
    flex-basis: 100%;
    font-size: 12px;
    color: var(--ink-dim);
    margin-top: 4px;
  }
}

/* Short viewports (laptops, zoomed screens): tighten the vertical rhythm */
@media (max-height: 760px) {
  body.test-mode .question {
    margin-top: 18px;
  }

  body.test-mode .question p {
    font-size: clamp(18px, 3vw, 22px);
    margin-bottom: 18px;
  }

  body.test-mode .question .qnum {
    margin-bottom: 8px;
  }

  body.test-mode .instructions-panel {
    margin-top: 22px;
  }
}

body.test-mode .submit-button {
  background: var(--accent-gradient);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 16px;
  width: 100%;
  max-width: 340px;
  margin: 26px auto 0;
  padding: 14px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.test-mode .submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 38px rgba(var(--accent-rgb), 0.28);
  filter: none;
}

body.test-mode .submit-button:disabled {
  background: var(--card);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   7. Bottom navigation (engine appends .navigation-buttons to <body>)
   -------------------------------------------------------------------------- */
body.test-mode .navigation-buttons {
  background: rgba(14, 17, 22, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: none;
  height: 64px;
  gap: 14px;
}

body.test-mode .navigation-buttons button {
  height: 42px;
  width: 120px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Previous = ghost */
body.test-mode .navigation-buttons button:first-child {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

body.test-mode .navigation-buttons button:first-child:hover:not(:disabled) {
  border-color: #3a4a5e;
  color: var(--ink);
  transform: none;
  filter: none;
}

/* Next = accent */
body.test-mode .navigation-buttons button:last-child {
  background: var(--accent-gradient);
  border: 0;
  color: var(--accent-ink);
}

body.test-mode .navigation-buttons button:last-child:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: none;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.22);
}

body.test-mode .navigation-buttons button:disabled {
  background: none;
  border: 1px solid var(--line);
  color: rgba(125, 136, 150, 0.55);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   8. Loading spinner (analysis overlay)
   -------------------------------------------------------------------------- */
body.test-mode .spinner-container {
  background: rgba(14, 17, 22, 0.97);
}

body.test-mode .spinner-container::before {
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.10) 0%, transparent 70%);
}

body.test-mode .spinner-container::after {
  background: radial-gradient(circle, rgba(110, 231, 183, 0.07) 0%, transparent 70%);
}

body.test-mode .spinner-content {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.test-mode .spinner-ring {
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
}

body.test-mode .spinner-ring-inner {
  border: 2px solid transparent;
  border-bottom-color: var(--accent-2);
  border-left-color: var(--accent);
  opacity: 0.65;
}

body.test-mode .spinner-heading {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

body.test-mode .spinner-text {
  color: var(--ink-soft);
}

body.test-mode .spinner-step {
  color: var(--ink-dim);
}

body.test-mode .spinner-step .step-dot {
  background: var(--line);
}

body.test-mode .spinner-step.active {
  color: var(--ink);
}

body.test-mode .spinner-step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}

body.test-mode .spinner-step.completed {
  color: var(--ink-soft);
}

body.test-mode .spinner-step.completed .step-dot {
  background: var(--mint);
  box-shadow: none;
}

body.test-mode .spinner-progress-bar {
  background: var(--card);
}

body.test-mode .spinner-progress-fill {
  background: var(--accent-gradient);
  box-shadow: none;
}

body.test-mode .progress-indicator {
  color: var(--ink-dim);
}

/* --------------------------------------------------------------------------
   9. Toast, errors, loading
   -------------------------------------------------------------------------- */
body.test-mode .milestone-toast {
  background: var(--bg-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 12px;
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body.test-mode .loading-questions {
  color: var(--ink-dim);
  font-style: normal;
  padding: 60px 0;
}

body.test-mode .error-message {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid #f87171;
  border-radius: 12px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 40px auto;
  padding: 28px 24px;
}

body.test-mode .error-message h3 {
  color: var(--ink);
  margin-bottom: 8px;
}

body.test-mode .error-message button,
body.test-mode .retry-button {
  background: var(--accent-gradient);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  margin: 14px 6px 0;
}

/* The fixed round home button is hidden in test mode (styles.css !important);
   the error card's inline "Return to Home" must stay visible and normal-flow. */
body.test-mode .error-message .return-home-button {
  display: inline-flex !important;
  position: static;
  width: auto;
  height: auto;
  opacity: 1;
  transform: none;
  animation: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   10. Career intake (career-questionnaire.js) — bare v2 screens matching the
       test questions: kicker + heading + field cards, shared progress strip,
       fixed bottom bar. The legacy wizard-card chrome is neutralized first.
   -------------------------------------------------------------------------- */
body.test-mode .career-questionnaire {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: 680px;
  margin: 34px auto 0;
  color: var(--ink-soft);
  font-family: inherit;
}

/* Screen scaffold (mirrors .question's qnum + text) */
body.test-mode .cq .qnum {
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

body.test-mode .cq .cq-heading {
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
}

body.test-mode .cq .cq-hint {
  font-size: 14.5px;
  color: var(--ink-dim);
  margin: 0;
}

body.test-mode .cq .cq-screen-head {
  margin-bottom: 24px;
}

/* Fields */
body.test-mode .cq .form-group {
  margin-bottom: 16px;
}

body.test-mode .cq .form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

body.test-mode .cq .form-select,
body.test-mode .cq .form-input,
body.test-mode .cq .form-textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

body.test-mode .cq .form-select:focus,
body.test-mode .cq .form-input:focus,
body.test-mode .cq .form-textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
  outline: none;
}

body.test-mode .cq .form-textarea {
  min-height: 96px;
  resize: vertical;
}

body.test-mode .cq .form-hint {
  font-size: 12.5px;
  color: var(--ink-dim);
  margin-top: 6px;
}

body.test-mode .cq .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Guidance note (career-direction aware) */
body.test-mode .cq .info-note {
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

body.test-mode .cq .info-note--warn {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.45);
}

/* Checkbox grids → tappable cards */
body.test-mode .cq .checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.test-mode .cq .checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

body.test-mode .cq .checkbox-item:hover {
  border-color: #3a4a5e;
  background: #20272f;
}

body.test-mode .cq .checkbox-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
}

body.test-mode .cq .checkbox-item input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

body.test-mode .cq .checkbox-item label {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  flex: 1;
}

body.test-mode .cq .checkbox-item:has(input:checked) label {
  color: var(--ink);
}

/* Closing note on the last screen */
body.test-mode .cq .cq-done {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 22px 0 0;
}

/* Intro screen: two big choice cards */
body.test-mode .cq .cq-intro-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

body.test-mode .cq .cq-intro-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

body.test-mode .cq .cq-intro-btn:hover {
  border-color: #3a4a5e;
  background: #20272f;
}

body.test-mode .cq .cq-intro-btn .t {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

body.test-mode .cq .cq-intro-btn .d {
  font-size: 13.5px;
  color: var(--ink-dim);
}

body.test-mode .cq .cq-intro-btn--primary {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.08);
}

body.test-mode .cq .cq-intro-btn--primary:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

body.test-mode .cq .cq-intro-btn--primary .t {
  color: var(--accent);
}

/* Bottom bar — mirrors the test's Previous/Next bar */
body.test-mode .cq-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(14, 17, 22, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

body.test-mode .cq-nav .buttons-group {
  display: flex;
}

body.test-mode .cq-back {
  height: 42px;
  width: 110px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, color 0.15s ease;
}

body.test-mode .cq-back:hover:not(:disabled) {
  border-color: #3a4a5e;
  color: var(--ink);
}

body.test-mode .cq-back:disabled {
  color: rgba(125, 136, 150, 0.55);
  cursor: not-allowed;
}

body.test-mode .cq-next {
  height: 42px;
  min-width: 130px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent-gradient);
  border: 0;
  color: var(--accent-ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.test-mode .cq-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.22);
}

body.test-mode .cq-skip {
  background: none;
  border: 0;
  color: var(--ink-dim);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 4px;
}

body.test-mode .cq-skip:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   11. About-this-assessment band (shared .test-info-section)
   -------------------------------------------------------------------------- */
body.test-mode .test-info-section {
  background: #10141a;
  border-top: 1px solid var(--line);
  padding: 56px 0;
  margin-top: 48px;
}

body.test-mode .test-info-section h2 {
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 8px;
}

body.test-mode .test-info-section .info-grid {
  gap: 16px;
  margin-top: 26px;
}

body.test-mode .test-info-section .info-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}

body.test-mode .test-info-section .info-item h3 {
  color: var(--accent);
  font-size: 16px;
  margin-bottom: 8px;
}

body.test-mode .test-info-section .info-item p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. Auth modal (sign-in step) — v2 skin, active whether or not the engine
       has flipped dark-results yet. Wins over auth-modal.css by load order.
   -------------------------------------------------------------------------- */
body.test-mode .auth-modal-overlay {
  background: rgba(8, 10, 14, 0.8);
  backdrop-filter: blur(6px);
}

body.test-mode .auth-modal-container {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color: var(--ink);
}

body.test-mode .auth-modal-header {
  border-bottom-color: var(--line);
}

body.test-mode .auth-modal-header h3 {
  color: var(--ink);
}

body.test-mode .auth-modal-close {
  color: var(--ink-dim);
}

body.test-mode .auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

body.test-mode .auth-form-group label {
  color: var(--ink-soft);
}

body.test-mode .auth-form-group input {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}

body.test-mode .auth-form-group input::placeholder {
  color: var(--ink-dim);
}

body.test-mode .auth-form-group input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

body.test-mode .auth-form-group button {
  background: var(--accent-gradient);
  color: var(--accent-ink);
  box-shadow: none;
  font-weight: 700;
}

body.test-mode .auth-form-group button:hover:not(:disabled) {
  background: var(--accent-gradient);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.22);
}

body.test-mode .auth-google-button {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}

body.test-mode .auth-google-button:hover:not(:disabled) {
  background: #20272f;
  border-color: #3a4a5e;
  box-shadow: none;
}

body.test-mode .auth-divider::before,
body.test-mode .auth-divider::after {
  background: var(--line);
}

body.test-mode .auth-divider span {
  color: var(--ink-dim);
}

body.test-mode .auth-toggle {
  color: var(--ink-dim);
}

body.test-mode .auth-toggle-link {
  color: var(--accent-2);
}

body.test-mode .auth-toggle-link:hover {
  color: var(--ink);
}

body.test-mode .auth-error-message {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border-left-color: #f87171;
}

body.test-mode .auth-error-message.success {
  background: rgba(110, 231, 183, 0.12);
  color: var(--mint, #6ee7b7);
  border-left-color: #6ee7b7;
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body.test-mode {
    padding-bottom: 80px;
  }

  .tf-header {
    height: 52px;
    padding: 0 16px;
  }

  .tf-title {
    font-size: 12px;
    max-width: 52vw;
  }

  body.test-mode .progress-info {
    top: 52px;
    margin: 0 -16px;
    padding: 8px 18px 6px;
  }

  body.test-mode .progress-bar-container {
    top: 84px;
    margin: 0 -16px;
    padding: 0 18px 8px;
  }

  body.test-mode .progress-bar-container::before {
    left: 18px;
    right: 18px;
  }

  body.test-mode .container.test-mode {
    padding: 12px 16px 0;
  }

  body.test-mode .instructions-panel {
    margin-top: 26px;
  }

  body.test-mode .question {
    margin-top: 24px;
  }

  body.test-mode .question p {
    font-size: 19px;
  }

  body.test-mode .choices button {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15px;
  }

  body.test-mode .navigation-buttons {
    height: 60px;
  }

  body.test-mode .navigation-buttons button {
    width: 40%;
    max-width: 160px;
  }

  body.test-mode .career-questionnaire {
    margin-top: 24px;
  }

  body.test-mode .cq .checkbox-grid,
  body.test-mode .cq .form-row {
    grid-template-columns: 1fr;
  }

  body.test-mode .cq-nav {
    height: 60px;
    gap: 10px;
    padding: 0 12px;
  }

  body.test-mode .cq-back {
    width: 84px;
  }

  body.test-mode .cq-next {
    min-width: 112px;
    padding: 0 16px;
  }

  body.test-mode .cq-skip {
    font-size: 12px;
  }
}
