:root {
  /* cores da logo NaVe */
  --nave-azul: #02427d;
  --nave-verde: #158d47;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #14212e;
  --muted: #5b6770;
  --border: #d8e0e8;
  --titulo: var(--nave-azul);
  --brand: var(--nave-verde);          /* seleções, bordas, barra */
  --brand-strong: #0f6e37;             /* texto verde sobre fundo claro (AA) */
  --brand-soft: #e8f5ed;
  --primario: var(--nave-azul);        /* botões (texto branco 10:1) */
  --primario-hover: #013463;
  --primario-ink: #ffffff;
  --brand-ink: #ffffff;
  --accent-soft: #fff7e0;
  --accent-border: #e6c867;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(2 66 125 / 6%), 0 2px 10px rgb(2 66 125 / 5%);
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.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;
}

/* ---------- topo ---------- */
.topo {
  background: var(--surface);
  border-bottom: 3px solid var(--nave-verde);
  box-shadow: 0 3px 0 var(--nave-azul);
  margin-bottom: 3px;
}
.topo-conteudo {
  max-width: 680px; margin: 0 auto;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.logo { display: block; height: 52px; width: auto; }

/* ---------- progresso ---------- */
.progresso {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.progresso-info {
  max-width: 680px; margin: 0 auto; padding: 10px 16px 6px;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.progresso-info #progresso-secao { color: var(--ink); font-weight: 600; }
.progresso-trilho { max-width: 680px; margin: 0 auto 10px; padding: 0 16px; }
.progresso-trilho::before {
  content: ""; display: block; height: 6px; border-radius: 999px; background: var(--border);
}
.progresso-barra {
  height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--nave-azul), var(--nave-verde));
  margin-top: -6px; width: 0; transition: width .3s ease;
}

/* ---------- layout ---------- */
.app { max-width: 680px; margin: 0 auto; padding: 20px 16px 48px; outline: none; }

h1 { font-size: clamp(26px, 6vw, 34px); line-height: 1.15; margin: 8px 0 4px; letter-spacing: -.01em; }
h1, h2 { color: var(--titulo); }
h2 { font-size: 22px; line-height: 1.25; margin: 4px 0 16px; }
.subtitulo { color: var(--brand-strong); font-weight: 600; font-size: 18px; margin: 0 0 4px; }
.descricao { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.destaque-ia { color: var(--brand-strong); }

.cartao {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ---------- boas-vindas ---------- */
.boas-vindas .cartao p { margin: 0 0 14px; }
.assinatura { color: var(--muted); font-size: 15px; margin-top: 18px !important; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; padding: 0; list-style: none; }
.meta li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong);
}
.meta svg { width: 16px; height: 16px; }
.retomar {
  margin-top: 16px; padding: 14px 16px;
  border: 1px dashed var(--brand); border-radius: var(--radius-sm);
  background: var(--brand-soft);
}
.retomar p { margin: 0 0 10px; font-size: 15px; }

/* ---------- pergunta ---------- */
.q {
  margin: 0 0 14px; padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.q[hidden] { display: none; }
.q.destaque { border-color: var(--accent-border); background: linear-gradient(var(--accent-soft), var(--surface) 70%); }
.q legend { padding: 0; font-weight: 600; font-size: 17px; line-height: 1.35; float: left; width: 100%; margin-bottom: 4px; }
.q legend + * { clear: both; }
.qnum { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; margin-right: 4px; }
.req { color: var(--danger); margin-left: 3px; }
.help { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.q .corpo { margin-top: 12px; }

/* chips (radio / checkbox) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.lista { flex-direction: column; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 15px; line-height: 1.3;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.chips.lista .chip span { border-radius: var(--radius-sm); width: 100%; }
.chips.lista .chip { display: flex; }
.chip span::before {
  content: ""; flex: none; width: 16px; height: 16px;
  border: 1.5px solid var(--muted); border-radius: 50%;
  transition: inherit;
}
.chip input[type="checkbox"] + span::before { border-radius: 4px; }
.chip:hover span { border-color: var(--brand); }
.chip input:checked + span {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 500;
}
.chip input:checked + span::before {
  border-color: var(--brand); background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.chip input[type="checkbox"]:checked + span::before {
  box-shadow: none;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.chip input:disabled + span { opacity: .45; cursor: not-allowed; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.contador { font-size: 13px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }
.contador.cheio { color: var(--brand-strong); font-weight: 600; }

/* escala em lista (1–5 com descrição) */
.escala-lista .chip span { justify-content: flex-start; }
.escala-lista .chip span::before { display: none; }
.escala-lista .nivel {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.escala-lista .chip input:checked + span .nivel { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }

/* grade de disponibilidade */
.grade { display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 6px; align-items: center; }
.grade .cab { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.grade .turno { font-size: 13px; font-weight: 500; color: var(--muted); }
.celula { position: relative; }
.celula input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.celula span {
  display: grid; place-items: center; height: 48px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.celula span::after { content: ""; width: 18px; height: 18px; }
.celula:hover span { border-color: var(--brand); }
.celula input:checked + span { background: var(--brand); border-color: var(--brand); }
.celula input:checked + span::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}
.celula input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* campos de texto */
textarea, input[type="text"], input[type="email"] {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: var(--muted); opacity: .85; }
textarea:focus, input[type="text"]:focus, input[type="email"]:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.outro-campo { margin-top: 10px; }
.outro-campo[hidden] { display: none; }

/* consentimento */
.consentimento { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.consentimento input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }

/* erro */
.erro { display: none; margin: 10px 0 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.q.com-erro { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.q.com-erro .erro { display: block; }

/* ---------- botões ---------- */
.acoes {
  display: flex; gap: 10px; justify-content: space-between; align-items: center;
  margin-top: 22px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  font: inherit; font-weight: 600; font-size: 16px;
  border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-primario { background: var(--primario); color: var(--primario-ink); }
.btn-primario:hover { background: var(--primario-hover); }
.btn-secundario { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secundario:hover { border-color: var(--brand); }
.btn-link { background: none; border: none; color: var(--muted); padding: 12px 8px; min-height: 44px; font-weight: 500; text-decoration: underline; }
.btn-largo { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.acoes .btn-primario { flex: 1; max-width: 260px; margin-left: auto; }

/* ---------- final ---------- */
.final { text-align: center; padding: 40px 20px; }
.final-icone {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.final-icone svg { width: 36px; height: 36px; }
.final p { color: var(--muted); max-width: 440px; margin: 0 auto 10px; }
.verificacao { margin-top: 18px; }
.verificacao:empty { margin-top: 0; }
.envio-erro {
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--danger); border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  font-size: 15px; font-weight: 500;
}
.envio-erro[hidden] { display: none; }
.btn:disabled { opacity: .7; cursor: progress; }

.noscript { max-width: 680px; margin: 24px auto; padding: 0 16px; }

@media (min-width: 640px) {
  .app { padding-top: 32px; }
  .q { padding: 22px 24px 20px; }
  .cartao { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
