/* =========================================================================
   Cogniflux Lab — Industry Survey
   Visual system from the Brand Guidelines + the live waitlist site.
   ========================================================================= */

:root {
  /* Colour system */
  --cream:        #FFF8EE;  /* Porcelain Cream — page background          */
  --canvas:       #FCF0E3;  /* Warm Canvas — cards / panels               */
  --sand:         #F4EBE1;  /* Sandstone Mist — secondary surfaces        */
  --umber:        #200E03;  /* Deep Umber — text, primary CTA             */
  --umber-hover:  #2A1305;
  --copper:       #C9692A;  /* Cogniflux Copper — warm emphasis           */
  --teal:         #2CA898;  /* Signal Teal — progress, focus, interaction */

  --muted:        #6B5A4D;
  --placeholder:  #B5A493;
  --input-line:   #C8B8A6;
  --line:         #ECDFCE;
  --line-soft:    #F0E5D6;

  --font-display: "Fraunces", "Fraunces 72pt Soft", Georgia, "Times New Roman", serif;
  --font-sans:    "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius:       20px;
  --radius-sm:    12px;
  --maxw:         620px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--umber);
  background-color: var(--cream);
  /* Low-contrast ambient peach/copper glow over cream (brand guideline). */
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(201,105,42,0.10), rgba(201,105,42,0) 60%),
    radial-gradient(90% 60% at 100% 0%, rgba(44,168,152,0.06), rgba(44,168,152,0) 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Honeypot — off-screen but not display:none (bots skip display:none). */
.honeypot {
  position: absolute; left: -9999px;
  width: 1px; height: 1px; overflow: hidden; opacity: 0;
}

/* ---------- Progress ---------- */
.progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 4px;
  width: 100%;
  background-color: var(--sand);
}
.progress__bar {
  height: 100%;
  width: 0%;
  background-color: var(--teal);
  border-radius: 0 999px 999px 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Layout ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app__main {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  padding: 22px 18px 40px;
}
.shell {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
}

/* ---------- Top meta row ---------- */
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  min-height: 20px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--umber);
}
.kicker__line {
  width: 24px; height: 2px;
  background-color: var(--teal);
  flex-shrink: 0;
}
.counter {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.meta__right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Language selector (persistent, top-right) ---------- */
.langselect {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--input-line);
  background-color: var(--canvas);
  color: var(--umber);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 6px 28px 6px 12px;
  cursor: pointer;
  /* caret */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.langselect:hover { border-color: var(--umber); }

/* ---------- Welcome language picker (buttons) ---------- */
.langpick { margin: 0 0 22px; }
.langpick__label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.langpick__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.langbtn {
  appearance: none;
  border: 1.5px solid var(--input-line);
  background-color: var(--cream);
  color: var(--umber);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.langbtn:hover { border-color: var(--umber); }
.langbtn:active { transform: translateY(1px); }
.langbtn.is-active {
  background-color: var(--umber);
  border-color: var(--umber);
  color: var(--cream);
}

/* ---------- Card ---------- */
.card {
  background-color: var(--canvas);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  box-shadow:
    0 1px 2px rgba(32,14,3,0.04),
    0 18px 40px -22px rgba(32,14,3,0.22);
}

/* Entrance animation for each screen.
   Opacity-only (no transform) so it doesn't create a containing block that
   would offset/disrupt the sticky top nav. */
.screen { animation: rise 0.35s ease both; }
@keyframes rise {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
}
.context {
  margin: 0 0 16px;
  padding: 9px 13px;
  background-color: var(--sand);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.q-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 5vw, 1.95rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--umber);
}
/* Headings are focused programmatically for screen-reader flow — they are not
   interactive controls, so suppress the visible focus ring on them only. */
.q-title:focus, .q-title:focus-visible,
.info-title:focus, .info-title:focus-visible { outline: none; }
.q-help {
  margin: 0 0 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.q-body {
  margin-top: 16px;
}

/* ---------- Choice rows (radio / checkbox) ---------- */
/* Two columns to reduce scrolling. Multi-column packs items tightly
   (no row-height stretching); each choice stays intact. */
.choices {
  column-count: 2;
  column-gap: 22px;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}
/* Single column only on the very narrowest phones. */
@media (max-width: 330px) { .choices { column-count: 1; } }
.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  transition: padding-left 0.18s ease, opacity 0.18s ease;
}
.choice:hover { padding-left: 5px; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }

.choice__mark {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 1.5px solid var(--input-line);
  background-color: transparent;
  position: relative;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.choice--radio .choice__mark { border-radius: 50%; }
.choice--check .choice__mark { border-radius: 6px; }

/* Radio dot */
.choice--radio .choice__mark::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  background-color: var(--umber);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.16s ease;
}
.choice--radio input:checked + .choice__mark { border-color: var(--umber); }
.choice--radio input:checked + .choice__mark::after { transform: translate(-50%, -50%) scale(1); }

/* Checkbox tick */
.choice--check .choice__mark::after {
  content: ""; position: absolute;
  left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--cream); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.16s ease;
}
.choice--check input:checked + .choice__mark {
  border-color: var(--umber);
  background-color: var(--umber);
}
.choice--check input:checked + .choice__mark::after { transform: rotate(45deg) scale(1); }

.choice input:focus-visible + .choice__mark {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.choice__label { font-size: 1rem; line-height: 1.4; color: var(--umber); }

/* Disabled (cap reached) — only unchecked options dim */
.choice.is-disabled { opacity: 0.4; cursor: not-allowed; }
.choice.is-disabled:hover { padding-left: 2px; }

/* "Other" reveal text box */
.other-wrap { padding: 4px 2px 2px; }
.other-input {
  width: 100%;
  padding: 9px 0;
  border: none;
  border-bottom: 1px solid var(--input-line);
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--umber);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.other-input:focus { outline: none; border-bottom: 2px solid var(--umber); }
.other-input::placeholder { color: var(--placeholder); }

/* ---------- Scale 1–5 ---------- */
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.scale__btn {
  appearance: none;
  border: 1.5px solid var(--input-line);
  background-color: var(--cream);
  color: var(--umber);
  border-radius: 14px;
  padding: 16px 0;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
              color 0.15s ease, transform 0.1s ease;
}
.scale__btn:hover { border-color: var(--umber); }
.scale__btn:active { transform: translateY(1px); }
.scale__btn.is-selected {
  background-color: var(--umber);
  border-color: var(--umber);
  color: var(--cream);
}
.scale__labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Open text ---------- */
.textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background-color: var(--cream);
  font-family: inherit;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--umber);
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}
.textarea:focus { outline: none; border-color: var(--umber); box-shadow: 0 0 0 1px var(--umber); }
.textarea::placeholder { color: var(--placeholder); }

/* ---------- Followup field ---------- */
.followup { margin-top: 20px; }
.followup__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--umber);
}

/* ---------- Dual groups (Q26) ---------- */
.group + .group { margin-top: 26px; }
.group__label {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--umber);
}

/* ---------- Matrix (Q27) ---------- */
.matrix { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.mrow {
  padding: 14px 14px 12px;
  background-color: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.mrow__label {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 11px;
  color: var(--umber);
}
.mopts { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip {
  appearance: none;
  border: 1.5px solid var(--input-line);
  background-color: var(--cream);
  color: var(--umber);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.mchip:hover { border-color: var(--umber); }
.mchip.is-selected {
  background-color: var(--umber);
  border-color: var(--umber);
  color: var(--cream);
}

/* ---------- Contact fields ---------- */
.field { margin-bottom: 20px; }
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--umber);
}
.field__input {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--input-line);
  background: transparent;
  font-family: inherit;
  font-size: 1.0625rem;
  color: var(--umber);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field__input:focus { outline: none; border-bottom: 2px solid var(--umber); padding-bottom: 9px; }
.field__input::placeholder { color: var(--placeholder); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent .choice__mark { width: 20px; height: 20px; border-radius: 6px; margin-top: 1px; }
.consent input:checked + .choice__mark { border-color: var(--umber); background-color: var(--umber); }
.consent input:checked + .choice__mark::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid var(--cream);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.consent input:focus-visible + .choice__mark { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---------- Info / welcome / thanks ---------- */
.lede { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.6; color: var(--umber); }
.lede:last-of-type { margin-bottom: 0; }
.info-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--umber);
}
.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.privacy-note::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background-color: var(--teal); flex-shrink: 0;
}

/* ---------- Navigation ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}
/* Sticky top-of-question nav: Back/Next stay reachable while scrolling. */
.nav--top {
  position: sticky;
  top: 4px;
  z-index: 10;
  margin: 0 0 16px;
  padding: 8px 0;
  background-color: var(--canvas);
  border-bottom: 1px solid var(--line-soft);
}
.nav--end { justify-content: flex-start; }
.spacer { flex: 1 1 auto; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 48px;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.1s ease, opacity 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background-color: var(--umber); color: var(--cream); }
.btn--primary:hover { background-color: var(--umber-hover); }

.btn--secondary {
  background-color: var(--sand);
  color: var(--umber);
}
.btn--secondary:hover { background-color: #ECE0D2; }

.btn--ghost {
  background-color: transparent;
  color: var(--muted);
  padding: 14px 14px;
}
.btn--ghost:hover { color: var(--umber); }

.btn--wide { width: 100%; }

/* ---------- Footer ---------- */
.footer {
  flex-shrink: 0;
  padding: 26px 18px 22px;
  text-align: center;
}
.footer__links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 18px; margin: 0 0 10px; padding: 0; list-style: none;
  font-size: 13px;
}
.footer__links a {
  text-decoration: none; color: var(--umber);
  border-bottom: 1px solid var(--copper); padding-bottom: 1px;
}
.footer__meta { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .app__main { padding: 34px 24px 48px; }
  .card { padding: 40px 38px 34px; }
  .btn--wide { width: auto; min-width: 200px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
