/* QAS — PDCA Consultoria e Treinamentos
 * Tokens conforme Brand Book PDCA v1.0 (2026-05-01).
 * Contexto institucional -> Par A (navy + amarelo). CTA -> magenta brand.
 */
:root {
  --royal: #2957a4;
  --navy: #020678;
  --navy-50: #01022d;
  --amarelo: #fac402;
  --magenta: #cf0298;
  --pink-800: #900169;
  --lilas: #8e99cc;
  --grafite: #373536;
  --offwhite: #fefefe;

  --surface: #ffffff;
  --line: #e4e6f0;
  --line-strong: #c9cde0;
  --muted: #5d5b5c;           /* grafite clareado, contraste AA sobre off-white */
  --navy-tint: #eef0fa;       /* superfície suave derivada do lilás */
  --erro: #7a1218;

  --ff-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --ff-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --gutter: 20px;
  --maxw: 560px;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--grafite);
  font-family: var(--ff-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

.app {
  min-height: 100%;
  min-height: 100dvh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) var(--gutter) env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
}

/* ---------- Tipografia ---------- */
.eyebrow {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--royal);
}
h1, h2, h3 { font-family: var(--ff-display); color: var(--navy); margin: 0; }
h1 { font-size: 32px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.018em; }
.lead { font-size: 19px; line-height: 1.5; letter-spacing: -0.01em; color: var(--grafite); margin: 0; }
.small { font-size: 14px; line-height: 1.4; color: var(--muted); }
p { margin: 0; }

@media (min-width: 600px) {
  h1 { font-size: 40px; letter-spacing: -0.022em; }
}

/* ---------- Estrutura de tela ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-block: 24px 24px;
  outline: none;
}
.stack > * + * { margin-top: 16px; }
.screen__inner { display: flex; flex-direction: column; flex: 1; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.mt-48 { margin-top: 48px; }
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--erro);
  background: #fbeeee;
  color: var(--erro);
  font-size: 15px;
}
.spacer { flex: 1; min-height: 24px; }

.brand { padding-block: 8px 8px; }
.brand img { height: 48px; width: auto; display: block; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 2;
  background: var(--offwhite);
  padding-block: 14px 10px;
}
.topbar__row { display: flex; align-items: center; gap: 10px; }
.topbar__roda { width: 28px; height: 28px; }
.topbar__count { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.progress { margin-top: 10px; height: 6px; border-radius: 99px; background: var(--navy-tint); overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: var(--navy); border-radius: 99px; transition: width .3s ease; }

/* ---------- Botões ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  min-height: 54px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--cta { background: var(--magenta); color: #fff; }
.btn--cta:hover { background: var(--pink-800); }
.btn--cta:disabled { background: var(--line-strong); color: #fff; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line-strong); }
.btn--ghost:hover { border-color: var(--navy); }
.btn--link {
  background: none; border: 0; padding: 10px 4px; min-height: 44px; width: auto;
  color: var(--royal); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn:focus-visible, .opt:focus-visible, .btn--link:focus-visible, input:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 2px;
}

.nav { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-top: 16px; }
.nav .btn { width: auto; flex: 1; }

/* ---------- Abertura ---------- */
.info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
}
.info ul { margin: 0; padding-left: 20px; }
.info li + li { margin-top: 8px; }
.accent-bar { width: 44px; height: 4px; border-radius: 4px; background: var(--amarelo); }

/* ---------- Formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; color: var(--navy); }
.field input {
  font: inherit;
  font-size: 17px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--grafite);
  width: 100%;
}
.field input:focus { border-color: var(--navy); }
.field.is-invalid input { border-color: var(--erro); }
.field .err { font-size: 14px; line-height: 1.4; color: var(--erro); }
.field .err:empty { display: none; }
.field.is-invalid { margin-bottom: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.suffix { position: relative; }
.suffix input { padding-right: 64px; }
.suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }

/* ---------- Situação ---------- */
.q-num { font-family: var(--ff-display); font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--royal); }
.q-text {
  font-family: var(--ff-display);
  font-size: 21px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--navy);
  margin-top: 10px;
}
@media (min-width: 600px) { .q-text { font-size: 24px; } }

.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
.opt {
  appearance: none;
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--grafite);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.opt:hover { border-color: var(--navy); }
.opt__dot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center;
}
.opt[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.opt[aria-checked="true"] .opt__dot { border-color: var(--amarelo); }
.opt[aria-checked="true"] .opt__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--amarelo); }

/* ---------- Revisão ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; border: 1.5px solid var(--erro); color: var(--erro); background: var(--surface);
  border-radius: 99px; min-width: 48px; min-height: 44px; padding: 8px 12px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; color: var(--grafite); font-weight: 500; overflow-wrap: anywhere; }
.ok-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--navy-tint); color: var(--navy); font-size: 14px; font-weight: 600;
}

/* ---------- Final ---------- */
.done-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--navy); display: grid; place-items: center;
}
.done-mark svg { width: 30px; height: 30px; }

.footer-note { padding-block: 16px 8px; text-align: center; }

/* Transição sutil entre telas */
@media (prefers-reduced-motion: no-preference) {
  .screen > .enter { animation: enter .22s ease both; }
  @keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
