/* =============================================================================
   Centro Educacional Colúmbia 2000 — Portal de Admissão
   Design system editorial: papel, azul-marinho profundo e verde-sálvia.
   Sem dependências externas. Organização:
     1. Tokens (claro/escuro)   2. Base            3. Layout
     4. Blocos                  5. Campos + validação em tempo real
     6. Documentos + dropzone   7. Câmera          8. Botões + tema
     9. Avisos                  10. Progresso      11. Sucesso
     12. FAQ/rodapé             13. Responsivo     14. Acessibilidade
   ========================================================================== */

/* -------------------------------------------------- 1. Tokens (tema claro) */
:root {
  color-scheme: light;

  /* superfícies e texto */
  --page: #faf9f6;
  --surface: #ffffff;
  --surface-alt: #f2efe8;
  --text: #1b2430;
  --text-muted: #63676d;
  --text-soft: #8d908a;
  --heading: #17293f;

  /* marca */
  --brand: #17293f;
  --brand-deep: #0f1c2b;
  --accent: #4f6b5a;
  --accent-soft: #eef2ee;
  --accent-line: #cfdcd2;

  /* ações */
  --primary: #17293f;
  --primary-hover: #0f1c2b;
  --on-primary: #ffffff;

  /* linhas e estados */
  --line: #e5e1d8;
  --line-strong: #d5d0c5;
  --danger: #97303f;
  --danger-wash: #fdf4f5;
  --danger-line: #efd6da;
  --warning: #6b4a2f;
  --warning-wash: #fdf8ef;
  --warning-line: #efe2ca;
  --focus: #2f6cb0;
  --focus-halo: rgba(47, 108, 176, .22);

  /* ícone de campo válido (SVG embutido para não depender de fonte/rede) */
  --icon-check: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%234f6b5a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 8 14.5 16 5.5'/%3E%3C/svg%3E");

  --shadow-soft: 0 1px 2px rgba(16, 24, 32, .05), 0 10px 28px -20px rgba(16, 24, 32, .45);
  --shadow-lift: 0 2px 6px rgba(16, 24, 32, .06), 0 18px 40px -24px rgba(16, 24, 32, .5);

  /* tipografia */
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* forma e ritmo (escala 4/8) */
  --radius: 6px;
  --radius-lg: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 40px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --speed: 160ms;

  --camera-max-h: 56vh;
}

/* ------------------------------------------------- 1.1 Tokens (tema escuro) */
/* Um único bloco de sobrescrita: o atributo data-theme é aplicado pelo
   js/theme-init.js (preferência salva ou prefers-color-scheme). */
:root[data-theme="dark"] {
  color-scheme: dark;

  --page: #0e1620;
  --surface: #16202c;
  --surface-alt: #111a24;
  --text: #e6e4de;
  --text-muted: #a9aeb4;
  --text-soft: #7f858c;
  --heading: #d9e6f3;

  --brand: #17293f;
  --brand-deep: #0b1420;
  --accent: #8fb6a0;
  --accent-soft: #16261f;
  --accent-line: #2a3d33;

  --primary: #2f5a86;
  --primary-hover: #3a6c9d;
  --on-primary: #ffffff;

  --line: #24303c;
  --line-strong: #33414f;
  --danger: #f19aa4;
  --danger-wash: #2a1a1f;
  --danger-line: #4a2a31;
  --warning: #e5c39a;
  --warning-wash: #2a2318;
  --warning-line: #453723;
  --focus: #7db2ea;
  --focus-halo: rgba(125, 178, 234, .28);

  --icon-check: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238fb6a0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 8 14.5 16 5.5'/%3E%3C/svg%3E");

  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -20px rgba(0, 0, 0, .8);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 18px 40px -24px rgba(0, 0, 0, .85);
}

/* ------------------------------------------------------------------ 2. Base */
*, *::before, *::after { box-sizing: border-box; }

/* O atributo hidden precisa vencer qualquer display definido no CSS
   (blocos da câmera usam grid/flex e apareceriam vazios). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--heading); text-underline-offset: 2px; }

/* Foco visível único e consistente em todo o portal. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--accent-line); color: var(--heading); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: var(--radius);
  z-index: 30;
}
.skip:focus { left: 12px; }

/* ---------------------------------------------------------------- 3. Layout */
.shell {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-inline: max(var(--space-5), env(safe-area-inset-left));
}

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--page);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark__name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -.01em;
  color: var(--heading);
}
.wordmark__sub {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.masthead__side {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.masthead__tag {
  font-size: 10.5px;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.page { padding-top: var(--space-6); padding-bottom: var(--space-3); }

/* ----------------------------------------------------------------- 4. Blocos */
.kicker {
  margin-bottom: var(--space-3);
  font-size: 10.5px;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede h1 {
  margin-bottom: var(--space-4);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.18;
  letter-spacing: -.015em;
  color: var(--heading);
  text-wrap: balance;
}
.lede__text {
  max-width: 48ch;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-muted);
}
.lede__note {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}
.lede__note span { color: var(--heading); }

.block {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.block__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.block__num {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--accent);
}
.block__head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: -.01em;
  color: var(--heading);
}
.block__count {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-muted);
  white-space: nowrap;
}
.block__intro {
  max-width: 54ch;
  margin-bottom: var(--space-5);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}
.block__intro strong { color: var(--text); font-weight: 600; }
.block__foot {
  margin-top: var(--space-4);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.subhead {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.subhead--spaced { margin-top: var(--space-6); }

/* ------------------------------------------ 5. Campos + validação ao vivo */
.field { margin-bottom: var(--space-5); }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.req, .optional {
  margin-left: 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.req { color: var(--accent); }
.optional { color: var(--text-soft); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: 400 16px/1.4 var(--sans);
  color: var(--text);
  background: var(--surface);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background-color var(--speed) var(--ease);
  appearance: none;
}
.field textarea { min-height: 116px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-soft); }
.field input:hover, .field textarea:hover { border-color: var(--text-soft); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

/* Válido: só o ícone — sem verde gritante, sem borda colorida. */
.field.is-valid input[type="text"],
.field.is-valid input[type="email"],
.field.is-valid input[type="tel"] {
  background-image: var(--icon-check);
  padding-right: 42px;
  border-color: var(--accent-line);
}

/* Inválido: destaque contido, apenas onde há erro. */
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background-color: var(--danger-wash);
}
.field input[aria-invalid="true"]:focus,
.field textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.cols { display: grid; }

.hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Mensagens: aparecem com transição curta, sem empurrar o layout. */
.msg {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--danger);
}
.msg.is-visible { display: block; animation: msg-in 180ms var(--ease) both; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

.field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.field__meta .hint { margin-top: 6px; }
.counter {
  flex: none;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  transition: color var(--speed) var(--ease);
}
.counter.is-near { color: var(--danger); font-weight: 600; }

/* honeypot */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------- 6. Documentos + dropzone */
.docs__tip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: 10px var(--space-3);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    background-color var(--speed) var(--ease);
}
.docs__tip svg { flex: none; color: var(--accent); }
.docs__tip strong { color: var(--text); font-weight: 600; }

/* Em telas de toque o arrastar não existe: a dica só fala em "Anexar". */
@media (hover: none) {
  .docs__tip { display: none; }
}

.docs { border-top: 1px solid var(--line); }
.docs[aria-busy="true"] { opacity: .6; }
.docs__loading { padding: var(--space-4) 0; font-size: 13.5px; color: var(--text-muted); }

.doc {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px var(--space-3);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--speed) var(--ease), transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

/* Convite global: enquanto um arquivo é arrastado pela janela, toda linha
   vira alvo plausível (borda tracejada + leve escala). */
body.is-dragging .docs__tip {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
body.is-dragging .doc {
  border-bottom-color: transparent;
  box-shadow: inset 0 0 0 1px var(--accent-line);
  transform: scale(1.005);
}
body.is-dragging .doc__btn { border-color: var(--accent-line); }

/* Alvo sob o ponteiro: escala maior, borda sólida e halo pulsante.
   O seletor inclui body.is-dragging para vencer a regra de convite global. */
body.is-dragging .doc.is-dropover,
.doc.is-dropover {
  background: var(--accent-soft);
  border-radius: var(--radius);
  transform: scale(1.015);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-lift);
  animation: drop-pulse 1.1s var(--ease) infinite;
}

@keyframes drop-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 0 rgba(79, 107, 90, .22); }
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(79, 107, 90, 0); }
}

.doc__main { min-width: 0; }
.doc__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px var(--space-2);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.doc__tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.doc__tag--opt { color: var(--text-soft); }
.doc__hint {
  display: block;
  margin-top: 4px;
  max-width: 46ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Arquivo anexado: miniatura (jpg/png) ou selo de formato (PDF). */
.doc__file {
  display: none;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-word;
}
.doc__thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}
.doc__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.doc__thumb--pdf {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--danger);
  background: var(--danger-wash);
  border-color: var(--danger-line);
}
.doc__filename { min-width: 0; color: var(--text-muted); }
.doc__error { margin-top: 6px; }

.doc__actions { display: flex; align-items: center; gap: var(--space-1); padding-top: 2px; }

.doc__btn {
  padding: 9px 14px;
  font: 600 12.5px/1 var(--sans);
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease),
    color var(--speed) var(--ease);
}
.doc__btn:hover { border-color: var(--accent); color: var(--heading); }

.doc__remove {
  display: none;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.doc__remove:hover { color: var(--danger); background: var(--danger-wash); }

.doc.is-done .doc__file { display: flex; }
.doc.is-done .doc__remove { display: grid; }
.doc.is-done .doc__label { color: var(--heading); }
.doc.is-invalid { background: var(--danger-wash); }
.doc.is-invalid .doc__label { color: var(--danger); }

/* ----------------------------------------------------------------- 7. Câmera */
/* A largura é limitada pela altura disponível (56vh) para que a moldura 3:4
   caiba inteira em celulares verticais, sem empurrar os botões para fora. */
.camera {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  width: 100%;
}

.camera__stage {
  position: relative;
  width: min(100%, 320px, calc(var(--camera-max-h) * 0.75));
  aspect-ratio: 3 / 4;
  background: #121a22;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.camera__stage.is-live,
.camera__stage.has-photo {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.camera__stage video,
.camera__stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Espelho no preview: o usuário se vê como em um espelho. A captura também é
   espelhada, então a foto salva corresponde exatamente ao que ele viu. */
.camera__stage.is-live video { transform: scaleX(-1); }

.camera__guide { position: absolute; inset: 0; pointer-events: none; }
.camera__guide svg {
  width: 100%; height: 100%;
  fill: none;
  stroke: rgba(255, 255, 255, .65);
  stroke-width: 2;
  stroke-linecap: round;
}
.camera__guide path { stroke-opacity: .5; }
.camera__guide span {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--space-3);
  padding-inline: var(--space-3);
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.camera__start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  font: 600 13px/1.35 var(--sans);
  text-align: center;
  color: var(--heading);
  background: var(--surface);
  border: 0;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease);
}
.camera__start:hover { background: var(--accent-soft); }
.camera__start svg { color: var(--accent); }
.camera__start:disabled { opacity: .7; cursor: progress; }

.camera__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  width: min(100%, 320px, calc(var(--camera-max-h) * 0.75));
}
.camera__actions .btn { flex: 1 1 120px; }

.camera__status {
  min-height: 18px;
  max-width: 46ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  transition: color var(--speed) var(--ease);
}
.camera__status.is-error { color: var(--danger); font-weight: 600; }

.camera__fallback { margin-top: 2px; }
.camera__file {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px 16px;
  font: 600 13px/1 var(--sans);
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease),
    color var(--speed) var(--ease);
}
.camera__file:hover { border-color: var(--accent); }
.camera__file svg { color: var(--accent); }
.camera__file.is-highlighted {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--heading);
}
.camera__file:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------ 8. Botões + tema */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 11px 18px;
  font: 600 14.5px/1 var(--sans);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    color var(--speed) var(--ease), opacity var(--speed) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn--primary { color: var(--on-primary); background: var(--primary); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--quiet {
  color: var(--heading);
  background: var(--surface);
  border-color: var(--line-strong);
}
.btn--quiet:hover:not(:disabled) { border-color: var(--accent); }
.btn--block { width: 100%; min-height: 52px; font-size: 15.5px; margin-top: var(--space-3); }
.btn:disabled { opacity: .75; cursor: progress; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.btn__spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: var(--on-primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn.is-busy .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alternador de tema: discreto por definição — só cor, borda e ícone mudam. */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    background-color var(--speed) var(--ease);
}
.theme-toggle:hover {
  color: var(--heading);
  border-color: var(--line-strong);
  background: var(--surface);
}
.theme-toggle__icon { grid-area: 1 / 1; stroke-width: 1.6; }
.theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }

/* ----------------------------------------------------------------- 9. Avisos */
.alert {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--danger);
  background: var(--danger-wash);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  animation: msg-in 200ms var(--ease) both;
}
.alert--demo {
  margin: var(--space-4) 0 0;
  font-weight: 400;
  color: #7a4b12;
  background: #fdf6e7;
  border-color: #f0dfb9;
}
.alert--demo strong { font-weight: 700; }
:root[data-theme="dark"] .alert--demo {
  color: #f0cf9b;
  background: #2b2317;
  border-color: #4a3a21;
}

.alert--soft {
  margin: var(--space-5) 0 0;
  font-weight: 400;
  color: var(--warning);
  background: var(--warning-wash);
  border-color: var(--warning-line);
}

.consent {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
  padding: var(--space-1) 0;
}
.consent--secondary { margin-top: var(--space-3); }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent__box {
  flex: none;
  width: 19px; height: 19px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.consent__box::after {
  content: "";
  width: 10px; height: 5px;
  margin-top: -2px;
  border-left: 2px solid var(--on-primary);
  border-bottom: 2px solid var(--on-primary);
  transform: rotate(-45deg) scale(.5);
  opacity: 0;
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.consent input:checked + .consent__box { background: var(--primary); border-color: var(--primary); }
.consent input:checked + .consent__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.consent input:focus-visible + .consent__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.consent__text { font-size: 13.5px; line-height: 1.65; color: var(--text-muted); }

.captcha {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.captcha.is-error { border-color: var(--danger); background: var(--danger-wash); }
.captcha__label {
  margin-bottom: var(--space-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* -------------------------------------------------------------- 10. Progresso */
.progress { margin-top: var(--space-4); }
.progress__track {
  height: 5px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}
.progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 260ms var(--ease);
}
.progress__label {
  margin-top: var(--space-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: color var(--speed) var(--ease);
}

/* Etapas sem porcentagem conhecida (validação local e gravação no Drive). */
.progress.is-indeterminate .progress__track span {
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progress-slide 1.15s var(--ease) infinite;
}
@keyframes progress-slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* ---------------------------------------------------------------- 11. Sucesso */
.done {
  margin-top: var(--space-2);
  padding: var(--space-6) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  outline: none;
  animation: msg-in 260ms var(--ease) both;
}
.done h1 {
  margin-bottom: var(--space-3);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 5.5vw, 30px);
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--heading);
}
.done__text {
  max-width: 46ch;
  margin-bottom: var(--space-5);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
}
.done__text strong { color: var(--text); }

.protocol {
  display: grid;
  gap: 1px;
  margin-bottom: var(--space-5);
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.protocol > div { padding: var(--space-3) var(--space-4); background: var(--page); }
.protocol dt {
  margin-bottom: 2px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.protocol dd {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--heading);
  overflow-wrap: anywhere;
}
.protocol dd#protocol-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}

.done__steps {
  display: grid;
  gap: 7px;
  max-width: 50ch;
  margin-bottom: var(--space-5);
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
  list-style: decimal;
}
.done__steps strong { color: var(--text); }

.done__note {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}
.done__note span { color: var(--heading); }

/* --------------------------------------------------------- 12. FAQ e rodapé */
.faq { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.faq h2 {
  margin-bottom: var(--space-2);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  color: var(--heading);
}
.faq details { padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.faq details:first-of-type { border-top: 0; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--accent);
  transition: transform var(--speed) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  max-width: 58ch;
  margin-top: var(--space-2);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

.foot {
  margin-top: var(--space-7);
  padding: var(--space-5) 0 calc(var(--space-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.foot__inner { display: grid; gap: var(--space-2); }
.foot p { font-size: 12px; line-height: 1.65; color: var(--text-muted); }
.foot strong { font-size: 12.5px; color: var(--text); }
.foot__small { font-size: 11.5px; color: var(--text-soft); }

/* ------------------------------------------------------------- 13. Responsivo */
@media (max-width: 519px) {
  /* Em telas estreitas os controles do documento descem para a própria linha. */
  .doc { grid-template-columns: 1fr; }
  .doc__actions { padding-top: var(--space-2); }
  .doc__btn { flex: 1; text-align: center; }
  .camera__file { width: 100%; justify-content: center; }
}

/* Só em telas muito estreitas o selo "Admissão" sai de cena. */
@media (max-width: 359px) {
  .masthead__tag { display: none; }
}

@media (min-width: 560px) {
  .cols { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .protocol { grid-template-columns: 1fr 1.4fr; }
  .camera__actions .btn { flex: 1 1 auto; }
}

@media (min-width: 640px) {
  .page { padding-top: var(--space-7); }
  .masthead__inner { padding-block: var(--space-5); }
  .block { margin-top: 42px; padding-top: var(--space-6); }
  .done { padding: var(--space-7) 34px; }
  .foot__inner { grid-template-columns: 1fr auto; align-items: center; }
  .foot__small { max-width: 34ch; text-align: right; }
}

/* Celular deitado / janelas baixas: a moldura diminui, os botões seguem visíveis. */
@media (max-height: 620px) {
  :root { --camera-max-h: 46vh; }
}

/* --------------------------------------------------------- 14. Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* Sem animação, o pulso da dropzone continua legível pela borda sólida. */
  .doc.is-dropover { box-shadow: 0 0 0 2px var(--accent); }
}

/* Alto contraste forçado (Windows): mantém os contornos visíveis. */
@media (forced-colors: active) {
  .doc__btn, .btn, .camera__file, .theme-toggle { border: 1px solid ButtonBorder; }
  .doc.is-dropover { outline: 2px solid Highlight; }
  .progress__track span { background: Highlight; }
}

@media print {
  .masthead__side, .camera, .faq, .foot, .btn, .docs__tip, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
