/* World IT Mission: formulários v3 (modal da lista de espera, telas de acesso, páginas legais).
   Usa tokens.css + components.css. Cantos 12 / 20 / 28. Só transform/opacity animam. */

:root { --r-sm: 12px; --r: 20px; --r-lg: 28px; }

/* ---------- Componentes de formulário (escopo .wl e .auth) ---------- */
.wl .btn, .auth .btn { border-radius: 999px; }
.wl .input, .auth .input { border-radius: var(--r-sm); }
.wl .tag, .auth .tag { border-radius: 999px; }
.wl select.input, .auth select.input {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efefea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.wl select.input option, .auth select.input option { background: var(--ink-2); color: var(--paper); }
.f-grid { display: grid; gap: var(--s-4); }
.f-hint { margin: 0; color: var(--text-faint); font-size: var(--fs-small); }
.f-opt { font-weight: 400; color: var(--text-faint); }
.field .error::before { content: "! "; font-weight: 900; }

/* Honeypot: fora da tela, invisível para pessoas e leitores de tela */
.f-trap { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Consentimento: alvo de toque grande, caixa nativa com accent acid */
.f-check { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: start; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(239, 239, 234, .03); cursor: pointer; font-size: var(--fs-small); line-height: 1.5; color: var(--text-muted); }
.f-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--acid); cursor: pointer; }
.f-check input:focus-visible { outline: var(--focus); outline-offset: 2px; }
.f-check a { color: var(--text); font-weight: 700; }
.f-check:has(input[aria-invalid="true"]) { border-color: var(--rust); }
.f-check .error { grid-column: 2; }

.f-status { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); font-size: var(--fs-small); line-height: 1.5; border: 1px solid var(--line-strong); }
.f-status[hidden] { display: none; }
.f-status.is-error { border-color: var(--rust); color: #ffb3a1; background: rgba(255, 79, 36, .08); }
.f-status.is-ok { border-color: var(--acid); color: var(--acid); background: rgba(217, 255, 63, .06); }
.f-actions { display: grid; gap: var(--s-3); }
.btn-block { width: 100%; }
.btn[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: f-spin .8s linear infinite; }
@keyframes f-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation: none; border-right-color: currentColor; opacity: .6; } }
.btn-link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--text); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.btn-link:hover { color: var(--acid); }

/* Campo de senha com botão de mostrar */
.pw { position: relative; }
.pw .input { padding-right: 96px; }
.pw button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; min-height: 40px; padding: 0 var(--s-3); border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font: 700 var(--fs-small)/1 var(--font-sans); cursor: pointer; }
.pw button:hover { color: var(--text); background: var(--ink-3); }

/* Regras de senha */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-small); color: var(--text-faint); }
.rules li::before { content: "○"; display: inline-block; width: 1.4em; }
.rules li.ok { color: var(--text); }
.rules li.ok::before { content: "●"; color: var(--acid); }

/* ---------- Modal da lista de espera ---------- */
.wl { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 12px; visibility: hidden; opacity: 0; transition: opacity var(--t-base) var(--ease-out), visibility 0s linear var(--t-base); }
.wl[data-open] { visibility: visible; opacity: 1; transition-delay: 0s; }
.wl-backdrop { position: absolute; inset: 0; background: rgba(17, 19, 21, .78); }
.wl-panel { position: relative; width: min(100%, 540px); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--ink-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 32px); transform: translateY(16px) scale(.98); transition: transform var(--t-base) var(--ease-out); box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.wl[data-open] .wl-panel { transform: none; }
.wl-panel:focus { outline: none; }
.wl-head { display: grid; gap: var(--s-3); padding-right: 52px; margin-bottom: var(--s-5); }
.wl-title { margin: 0; font-size: clamp(1.5rem, 6vw, 2.125rem); font-weight: 900; line-height: 1.02; letter-spacing: var(--track-heading); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.wl-title:focus { outline: none; }
.wl-lead { margin: 0; color: var(--text-muted); font-size: .9375rem; line-height: 1.55; }
.wl-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.wl-close:hover { background: var(--ink-3); }
.wl-close svg { width: 20px; height: 20px; }
.wl-done { display: grid; gap: var(--s-4); justify-items: start; padding-top: var(--s-2); }
.wl-done[hidden], .wl-form[hidden] { display: none; }
.wl-mark { width: 40px; height: 40px; background: var(--acid); border-radius: 10px; }
.wl-ts { min-height: 0; }
@media (max-width: 560px) {
  .wl { padding: 0; place-items: end center; }
  .wl-panel { max-height: 100dvh; width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; }
}

/* Botão de CTA com rótulo curto no celular */
.cta-short { display: none; }
@media (max-width: 560px) { .cta-long { display: none; } .cta-short { display: inline; } }

/* Faixa de CTA no meio da página e bloco antes do rodapé */
.cta-strip { padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.cta-strip .container { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); align-items: center; justify-content: space-between; }
.cta-strip p { margin: 0; max-width: 40ch; font: 900 clamp(1.5rem, 3.4vw, 2.5rem)/1.05 var(--font-sans); letter-spacing: var(--track-heading); text-transform: uppercase; text-wrap: balance; }
.final-cta { display: grid; gap: var(--s-4); justify-items: start; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--ink-2); }
.final-cta p { margin: 0; color: var(--text-muted); max-width: 44ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.footer-links button { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links button:hover { color: var(--acid); }

/* ---------- Telas de acesso (login, definir senha, esqueci a senha) ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; background: var(--ink); }
.auth-top { padding: var(--s-4) var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.auth-top .back { color: var(--text-muted); font-size: var(--fs-small); font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.auth-top .back:hover { color: var(--acid); }
.auth-main { flex: 1; width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-8); display: grid; gap: var(--s-7); align-content: center; grid-template-columns: minmax(0, 1fr); }
.auth-intro { display: grid; gap: var(--s-4); align-content: center; }
.auth-title { margin: 0; font-size: clamp(2.25rem, 9vw, 4.5rem); font-weight: 900; line-height: .95; letter-spacing: var(--track-display); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.auth-title .em { text-transform: none; }
.auth-card { position: relative; width: 100%; max-width: 480px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 5vw, 36px); display: grid; gap: var(--s-5); }
.auth-card::before { content: ""; position: absolute; top: -1px; left: 28px; width: 28px; height: 10px; background: var(--acid); border-radius: 0 0 6px 6px; }
.auth-card h2 { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; }
.auth-links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); font-size: var(--fs-small); color: var(--text-muted); }
.auth-links a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; color: var(--text); }
.auth-links a:hover { color: var(--acid); }
.auth-note { margin: 0; padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--text-muted); }
.auth-note button { font-size: inherit; }
.auth-foot { padding: var(--s-5) var(--gutter); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); justify-content: center; font-size: var(--fs-small); color: var(--text-faint); border-top: 1px solid var(--line); }
.auth-foot a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.auth-foot a:hover { color: var(--acid); }
@media (min-width: 900px) {
  .auth-main { grid-template-columns: minmax(0, 1.1fr) minmax(380px, 480px); gap: var(--s-9); }
  .auth-card { justify-self: end; }
}

/* ---------- Portal: guarda de sessão ---------- */
.auth-pending .app { visibility: hidden; }
button.nav-item { width: calc(100% - 24px); background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; }
.auth-fallback { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--s-4); background: var(--ink); }
.auth-fallback[hidden] { display: none; }
.auth-fallback .auth-card { max-width: 440px; }
.auth-fallback .row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- Páginas legais ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-9); }
.legal h1 { margin: 0 0 var(--s-4); font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 900; line-height: 1; letter-spacing: var(--track-display); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.legal h1 .em { text-transform: none; }
.legal .meta { color: var(--text-faint); font-size: var(--fs-small); margin: 0 0 var(--s-5); }
.legal-warn { margin: 0 0 var(--s-6); padding: var(--s-4) var(--s-5); border: 1px solid var(--acid); border-radius: var(--r-sm); background: rgba(217, 255, 63, .06); font-size: var(--fs-small); color: var(--text); }
.legal h2 { margin: var(--s-8) 0 var(--s-3); font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; scroll-margin-top: var(--s-5); }
.legal h3 { margin: var(--s-5) 0 var(--s-2); font-size: 1.0625rem; font-weight: 700; }
.legal p, .legal li { color: var(--text-muted); max-width: 68ch; overflow-wrap: anywhere; }
.legal li { margin: 6px 0; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal a { color: var(--text); }
.legal a:hover { color: var(--acid); }
.legal mark.todo { background: var(--acid); color: var(--ink); padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: .9em; }
.toc { margin: 0 0 var(--s-6); padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-2); }
.toc summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.toc ol { margin: 0 0 var(--s-2); columns: 1; }
.toc a { text-decoration: none; color: var(--text-muted); display: inline-block; min-height: 28px; }
.toc a:hover { color: var(--acid); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); margin: var(--s-4) 0; }
.legal table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: var(--fs-small); }
.legal th, .legal td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); color: var(--text-muted); }
.legal th { color: var(--text); font-weight: 700; background: var(--ink-2); }
.legal tr:last-child td { border-bottom: 0; }

.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 200; padding: var(--s-3) var(--s-4); background: var(--acid); color: var(--ink); font-weight: 700; border-radius: 999px; }
.skip-link:focus { top: var(--s-3); }
main:focus { outline: none; }
.auth-fallback .btn { border-radius: 999px; }
.auth-fallback .btn-primary { min-height: 48px; }

/* Cabeçalho da landing: o botão de lista de espera é mais largo; o menu não quebra linha */
.site-nav { gap: var(--s-5); }
.site-nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 24px; }
@media (max-width: 1100px) { .site-nav a:nth-child(n+5) { display: none; } }
.legal { min-width: 0; width: 100%; }
.toc a { padding: 5px 0; min-height: 36px; }
.auth-foot { align-items: center; }
.auth-note .btn-link { display: inline; min-height: 0; }

/* Checkbox de aceite (definir senha): alvo de toque de 44px, foco visível e texto legível */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--paper-dim, #c9c9c3); cursor: pointer; }
.check input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: #d9ff3f; cursor: pointer; }
.check input[type="checkbox"]:focus-visible { outline: 3px solid #d9ff3f; outline-offset: 3px; }
.check a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Checkbox do formulário da lista de espera: contorno visível (WCAG 1.4.11) e marcação em acid */
#wl-consent, .wl-check input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; flex: none; border: 2px solid rgba(239,239,234,.65); border-radius: 6px; background: transparent; display: inline-grid; place-content: center; margin-top: .15em; cursor: pointer; }
#wl-consent:checked, .wl-check input[type="checkbox"]:checked { background: #d9ff3f; border-color: #d9ff3f; }
#wl-consent:checked::after, .wl-check input[type="checkbox"]:checked::after { content: ""; width: 6px; height: 11px; border: solid #111315; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
#wl-consent:focus-visible { outline: 3px solid #d9ff3f; outline-offset: 3px; }
