/* ============================================================
   Niswosakit internal questionnaire — styles
   Palette: warm black + paper (the saved values), no accent color.
   Logo: Git Sans Regular, ALL CAPS. Question headings: Formula Condensed.
   ============================================================ */

/* ---- Fonts (self-hosted) ---- */
@font-face { font-family: "Git Sans"; src: url("fonts/git-sans.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Formula Condensed"; src: url("fonts/formula-condensed-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Formula Condensed"; src: url("fonts/formula-condensed-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --surface: #100e0c;   /* warm black ground (saved) */
  --ink: #f3efe8;       /* paper (saved) */
  --ink-soft: #c3bcb0;  /* muted paper: labels, placeholders */
  --line: #2a2521;      /* hairlines, inactive track */
  --green: #5fff78;     /* brand green, the success page */
  --body-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display-font: "Formula Condensed", "Plus Jakarta Sans", sans-serif;
  --logo-font: "Git Sans", "Formula Condensed", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

#form-root { position: relative; height: 100vh; overflow: hidden; }

/* ---- Brand logo (Git Sans Regular, all caps) ---- */
.wordmark {
  position: fixed;
  top: 26px;
  left: 10vw;
  z-index: 500;
  font-family: var(--logo-font);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--ink);
  pointer-events: none;
}

/* ---- Screens ---- */
.screen {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 100svh;
  padding-left: 10vw;
  padding-right: 10vw;
  overflow: clip;
}
.form-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Type ---- */
.form-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.form-h001 {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.08;
  color: var(--ink);
}
.form-p001 {
  margin: 0;
  max-width: 62ch;
  color: var(--ink);
  opacity: 0.85;
  line-height: 1.5;
}
.form-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.form-hint kbd {
  font-family: inherit;
  background: var(--line);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* ---- Choice options ---- */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 660px;
}
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.option:hover { border-color: var(--ink-soft); }
.option:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.option.selected { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.hotkey {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.option.selected .hotkey { border-color: var(--ink); color: var(--ink); }
.opt-label { line-height: 1.35; }

/* ---- Text input ---- */
.q-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1rem, 2vw, 1.2rem);
  padding: 12px 0;
  outline: none;
  caret-color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
}
textarea.q-input { resize: none; line-height: 1.6; overflow: hidden; }
.q-input::placeholder { color: var(--ink-soft); }
.q-input:focus { border-bottom-color: var(--ink); }

/* ---- Button ---- */
.form-button {
  align-self: flex-start;
  background-color: var(--ink);
  color: var(--surface);
  border: 0;
  border-radius: 50px;
  padding: 11px 32px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.form-button:hover { opacity: 0.9; }

/* ---- Progress bar ---- */
.progress-bar {
  position: fixed;
  inset: 8% 0% auto;
  z-index: 400;
  display: flex;
  gap: 4px;
  height: 4px;
  padding-left: 10vw;
  padding-right: 10vw;
  transition: opacity 0.4s ease;
}
.progress-pill {
  flex: 1;
  height: 100%;
  background-color: var(--line);
  border-radius: 50px;
  transition: background-color 0.3s ease;
}

/* ---- Nav chevrons ---- */
#form-nav {
  position: fixed;
  bottom: 30px;
  right: 40px;
  z-index: 999;
  display: flex;
  gap: 6px;
  transition: opacity 0.3s ease;
}
.nav-btn {
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  transition: opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.nav-btn:disabled { cursor: default; }

/* ---- Screen-reader only (live region + honeypot) ---- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Inline required/validation message ---- */
.field-error {
  margin: -8px 0 0;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field-error::before { content: "! "; }

/* ---- Rating scale ---- */
.ratings { display: flex; gap: 8px; flex-wrap: wrap; }
.rating {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit; font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.rating:hover { border-color: var(--ink-soft); }
.rating:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rating.selected { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }

/* ---- Green success page (fully green, dark ink) ---- */
body.thanks-on { background-color: var(--green); }
.screen.is-thanks { background-color: var(--green); }
body.thanks-on .wordmark { color: var(--surface); }
.screen.is-thanks .form-h001,
.screen.is-thanks .form-p001 { color: var(--surface); }
.screen.is-thanks .form-p001 { opacity: 0.92; }
.thanks-rule { width: 56px; height: 2px; margin: 4px 0; background: var(--surface); opacity: 0.5; }
.thanks-section { max-width: 58ch; }
.thanks-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.screen.is-thanks .cta { align-self: auto; }
.screen.is-thanks .cta-primary { background: var(--surface); color: var(--green); }
.screen.is-thanks .cta-secondary { background: transparent; color: var(--surface); border: 1px solid var(--surface); }
.screen.is-thanks .cta:hover { opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  .screen, .progress-pill, .progress-bar, #form-nav, .option, .rating, .form-button { transition: none !important; }
}
