/* Pesquisa de Clima Prestus — sem dependências externas (nenhuma fonte/CDN). */

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1b2333;
  --muted: #566074;
  --line: #ced4e0;
  --brand: #1f3864;
  --brand-ink: #ffffff;
  --accent: #2f5fb3;
  --sel-bg: #e4ecfa;
  --sel-line: #2f5fb3;
  --err: #b3261e;
  --err-bg: #fdecea;
  --focus: #1a73e8;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --card: #171c26;
    --ink: #e8ebf2;
    --muted: #a3acbf;
    --line: #2f3748;
    --brand: #9bb8ee;
    --brand-ink: #0b1220;
    --accent: #9bb8ee;
    --sel-bg: #1e2b46;
    --sel-line: #9bb8ee;
    --err: #f5b5b1;
    --err-bg: #3b201e;
    --focus: #8ab4f8;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 1rem; }

/* ---------- topo / progresso ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--brand); }
.progress-label { font-size: .9rem; color: var(--muted); }
.progress { height: 4px; background: var(--line); }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

main.wrap { padding-top: 1.75rem; padding-bottom: 3rem; }

/* ---------- tipografia ---------- */
h1 { font-size: 1.75rem; line-height: 1.2; margin: .25rem 0 1rem; color: var(--brand); }
h2 { font-size: 1.4rem; line-height: 1.25; margin: .15rem 0 .5rem; color: var(--brand); }
h1:focus, h2:focus { outline: none; }
.eyebrow { margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.note { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.loading { color: var(--muted); }

.callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: .85rem 1rem; margin: 1.1rem 0; }
.callout strong { display: block; margin-bottom: .2rem; }
.callout p { margin: 0; }

/* ---------- perguntas ---------- */
.question { margin: 1.75rem 0; padding: 0; border: 0; min-width: 0; }
.question[hidden] { display: none; }
legend, .qlabel { display: block; padding: 0; margin: 0 0 .65rem; font-weight: 600; font-size: 1.02rem; }
.qtag { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: .35rem; }
.hint { margin: -.3rem 0 .65rem; font-size: .9rem; color: var(--muted); }

/* o <input> cobre o "chip": segue clicável e focável por teclado */
.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 46px; padding: .6rem .5rem;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
  text-align: center; transition: border-color .12s, background-color .12s;
}
.opt:hover .chip { border-color: var(--accent); }
.opt input:checked + .chip { background: var(--sel-bg); border-color: var(--sel-line); box-shadow: inset 0 0 0 1px var(--sel-line); }
.opt input:focus-visible + .chip { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt input:disabled { cursor: not-allowed; }
.opt input:disabled + .chip { opacity: .5; }

/* escala de concordância */
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.likert .chip { flex-direction: column; height: 100%; padding: .55rem .35rem; }
.likert .num { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.likert .lbl { font-size: .78rem; line-height: 1.2; color: var(--muted); }
.likert input:checked + .chip .lbl { color: var(--ink); }
.na { margin-top: .5rem; }

/* linhas com indicador (sim/não, múltipla escolha, "não se aplica") */
.chip.row { justify-content: flex-start; text-align: left; }
.chip.row::before {
  content: ""; flex: none; width: 1.15rem; height: 1.15rem;
  border: 2px solid var(--line); background: var(--card);
}
.chip.row.radio::before { border-radius: 50%; }
.chip.row.check::before { border-radius: 4px; }
.opt input:checked + .chip.row::before { border-color: var(--sel-line); background: var(--sel-line); box-shadow: inset 0 0 0 3px var(--sel-bg); }
.stack { display: grid; gap: .5rem; }

/* eNPS 0-10 */
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: .35rem; }
.nps .chip { padding: .55rem 0; font-weight: 700; }
.nps-ends { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .85rem; color: var(--muted); }

/* campo aberto */
textarea {
  display: block; width: 100%; min-height: 7rem; padding: .7rem .8rem; resize: vertical;
  font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 10px;
}
textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--sel-line); }

/* erro */
.err { margin: .55rem 0 0; color: var(--err); font-weight: 600; font-size: .92rem; }
.err[hidden] { display: none; }
.has-error .chip, .has-error textarea { border-color: var(--err); }

.banner { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); border-radius: 10px; padding: .75rem 1rem; margin: 1rem 0; font-weight: 600; }

/* ---------- botões ---------- */
.nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 2.25rem; }
.btn {
  min-height: 46px; padding: .6rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; border: 1.5px solid var(--brand); background: transparent; color: var(--brand);
}
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- telas de mensagem ---------- */
.message { text-align: center; padding: 3rem 0; }
.message p { color: var(--muted); max-width: 34rem; margin: .5rem auto; }

/* ---------- telas estreitas ---------- */
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .likert { grid-template-columns: 1fr; }
  .likert .chip { flex-direction: row; justify-content: flex-start; gap: .75rem; text-align: left; padding: .6rem .8rem; }
  .likert .num { min-width: 1.4rem; text-align: center; }
  .likert .lbl { font-size: .95rem; color: var(--ink); }
  .nps { grid-template-columns: repeat(6, 1fr); }
  .nav { flex-direction: column-reverse; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- link de resposta (tela de retirada) ---------- */
.copyrow { display: flex; gap: .6rem; margin: 1rem 0; }
.linkbox {
  flex: 1; min-width: 0; padding: .65rem .8rem; font: .85rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
}
.linkbox:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
@media (max-width: 600px) { .copyrow { flex-direction: column; } }
