/* Formulário público da Assistência Técnica (ADR 050 do ControleTotal). Tokens copiados de web/src/index.css do
   ControleTotal: só o tema claro, com as cores da RISSI. Um raio só (4px). Sem fonte de fora: a do sistema. */
:root {
  color-scheme: light;
  --navy: #0a2f58; --blue: #0f6e9a; --cyan: #00aad7;
  --canvas: #f7f9fb; --paper: #ffffff; --side: #eef2f6; --hover: #eef2f6;
  --line: #e1e6ec; --line-strong: #cfd6de;
  --ink: #1c2430; --ink-2: #57585a; --ink-3: #6f7276;
  --accent: #0a2f58; --accent-strong: #0a2f58; --selection: #e6f1f7;
  --late: #c4352f; --good: #1c6636; --good-bg: #e3f3e8; --late-bg: #fbe9e8;
  --nav-ink: #b4c3d4; --nav-ink-strong: #fafafa;
  --ring: color-mix(in srgb, var(--cyan) 28%, transparent);
  --radius: 4px;
  --shadow-card: 0 1px 2px rgb(10 47 88 / 0.05), 0 1px 1px rgb(10 47 88 / 0.03);
  --shadow-popover: 0 8px 24px rgb(10 47 88 / 0.14);
  --ease-land: cubic-bezier(.16, .84, .3, 1);
  --ease-exit: cubic-bezier(.6, 0, .9, .4);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.5; background: var(--canvas); color: var(--ink);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100vh; }
input, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: var(--radius); }
[hidden] { display: none !important; }

/* Topo: branco, logo centralizado e "Assistência Técnica" entre dois traços; o WhatsApp fica na direita sem empurrar o logo. */
.top { background: var(--paper); box-shadow: 0 1px 0 var(--line), 0 6px 18px rgb(10 47 88 / 0.05); }
.top-in { position: relative; max-width: 640px; margin: 0 auto; padding: 18px 16px 14px; display: flex; align-items: center; justify-content: center; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand img { display: block; height: 48px; width: auto; }
.brand span { display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); }
.brand span::before, .brand span::after { content: ""; width: 28px; height: 1px; background: var(--line-strong); }
.top-actions { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.top-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--radius);
  color: var(--ink-2); font-size: 14.5px; text-decoration: none; }
.top-link:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 480px) { .top-link span { display: none; } .brand img { height: 40px; } }

main { max-width: 640px; margin: 0 auto; padding: 28px 16px 64px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.center { text-align: center; padding: 40px 20px; }
.center h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.center p { margin: 0 auto; color: var(--ink-2); max-width: 44ch; }
.center .btn { margin-top: 20px; }
.loading { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--ink-2); }

/* Passos */
.intro h1 { margin: 0 0 16px; font-size: clamp(26px, 5vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.steps li { display: grid; gap: 6px; font-size: 13px; color: var(--ink-3); }
.steps li::before { content: ""; height: 4px; border-radius: var(--radius); background: var(--line); transition: background-color .4s var(--ease-land); }
.steps li.is-done::before, .steps li[aria-current="step"]::before { background: var(--accent); }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }
@media (max-width: 480px) {
  .steps li span { display: none; }
  .steps li[aria-current="step"] span { display: none; }
}

/* Passo */
form { display: grid; gap: 14px; }
.step { margin: 0; padding: 20px; min-width: 0; }
.step.in { animation: in-r .4s var(--ease-land) both, fade .2s linear both; }
.step.in-back { animation: in-l .4s var(--ease-land) both, fade .2s linear both; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 18px; display: grid; gap: 2px; }
legend b { font-size: 20px; font-weight: 600; line-height: 1.25; }
legend + * { clear: both; }
legend:focus, .done h2:focus { outline: none; }
@media (max-width: 480px) { .step { padding: 16px; } }

.row { display: grid; gap: 18px; }
.field, .group { display: grid; gap: 6px; min-width: 0; }
.lbl { font-size: 15px; font-weight: 600; }
.lbl i { font-style: normal; font-weight: 400; color: var(--ink-3); }
.group .lbl { margin-bottom: 2px; }
.input { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); font-size: 16px;
  transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink-3)); }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--ink-3); opacity: 1; }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.5; }
.count { font-size: 13px; color: var(--ink-3); text-align: right; }
.count.near { color: var(--late); }
.error { display: none; font-size: 14px; font-weight: 500; color: var(--late); }
.invalid .input { border-color: var(--late); }
.invalid .error { display: block; animation: fade .2s linear both; }
.invalid .opt span { border-color: color-mix(in srgb, var(--late) 55%, var(--line-strong)); }
.field.ok .input { border-color: color-mix(in srgb, var(--good) 55%, var(--line-strong)); }

/* Opções: uma ou várias */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opt span { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); font-size: 15px; user-select: none; transition: background-color .15s, border-color .15s, color .15s; }
.opt span::before { content: ""; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 3px; background: var(--paper) center/12px no-repeat;
  transition: background-color .15s, border-color .15s; }
.opt input[type=radio] + span::before { border-radius: 50%; }
.opt:hover span { background: var(--hover); }
.opt input:checked + span { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent-strong) 9%, var(--paper)); color: var(--ink); font-weight: 600; }
.opt input:checked + span::before { border-color: var(--accent-strong); background-color: var(--accent-strong); background-image: var(--check); }
.opt input[type=radio]:checked + span::before { background-image: none; box-shadow: inset 0 0 0 3px var(--paper); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.other { animation: rise .3s var(--ease-land) both, fade .2s linear both; }

/* Conferir */
.review { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.review div { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.review div:last-child { border-bottom: 0; }
.review dt { color: var(--ink-3); }
.review dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.review button { min-height: 36px; margin: -6px -6px -6px 0; padding: 0 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--accent); font-size: 14px; font-weight: 500; }
.review button:hover { background: var(--hover); }
@media (max-width: 480px) { .review div { grid-template-columns: 1fr auto; } .review dt { grid-column: 1 / -1; font-size: 13px; margin-bottom: -8px; } }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent-strong); cursor: pointer; }
.consent.invalid { border-color: var(--late); }
.consent .error { margin-top: 6px; }
.turnstile { min-height: 65px; margin-top: 16px; }

/* Botões */
.nav { display: flex; gap: 10px; justify-content: flex-end; }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); margin-right: auto; }
.btn[aria-busy="true"] { cursor: progress; pointer-events: none; opacity: .85; }
.btn[aria-busy="true"]::before, .spinner { content: ""; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; }
.spinner { display: inline-block; }
@media (max-width: 480px) { .nav .btn-primary { flex: 1; } }

.send-error { margin-top: 16px; padding: 12px; border-radius: var(--radius); background: var(--late-bg); color: var(--late); }
.send-error p { margin: 0; font-size: 15px; font-weight: 500; }
.send-error .btn { margin-top: 10px; min-height: 44px; font-size: 15px; }

/* Sucesso */
.done { animation: rise .45s var(--ease-land) both, fade .2s linear both; }
.done .seal { width: 76px; height: 76px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--good-bg); color: var(--good); }
.done .seal :is(circle, path) { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw .55s var(--ease-land) .1s forwards; }
.done .seal path { animation-duration: .35s; animation-delay: .5s; }
.code-label { display: block; margin-top: 18px; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.code { display: inline-block; margin: 4px 0 16px; padding: 6px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--side);
  font-size: 28px; font-weight: 700; letter-spacing: .04em; }

/* Campo-armadilha: fora da tela para gente, preenchido só por robô. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); } }
@keyframes in-r { from { transform: translateX(28px); } }
@keyframes in-l { from { transform: translateX(-28px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .done .seal :is(circle, path) { stroke-dashoffset: 0; }
  .spinner, .btn[aria-busy="true"]::before { animation: spin 2s linear infinite !important; }
}
