/* Alerta Fiscal | Flirc */

:root {
  --navy: #042334;
  --navy-2: #0a3247;
  --slate: #5D7887;
  --slate-light: #9fb3bf;
  --ink: #0f1e27;
  --muted: #56666f;
  --bg: #f3f5f7;
  --card: #ffffff;
  --line: #dde3e7;
  --focus: #5D7887;

  --verde: #2e7457;
  --verde-bg: #e7f2ec;
  --amarelo: #9a6210;
  --amarelo-bg: #faf0de;
  --vermelho: #a23b3b;
  --vermelho-bg: #f7e8e8;
  --oportunidade: #3f6578;
  --oportunidade-bg: #e8eff3;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(4, 35, 52, .06), 0 6px 24px rgba(4, 35, 52, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
  --max: 680px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.noscript { padding: 24px; text-align: center; }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot-logo { width: 160px; height: auto; opacity: .9; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 24px;
  border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 1.02rem; line-height: 1.25; text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color .18s, border-color .18s, transform .08s, opacity .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--navy-2); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #e9eef1; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--navy); }
.btn-outline:hover:not([disabled]) { border-color: var(--slate); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { border-color: #fff; }
.btn-link {
  background: none; border: none; padding: 8px 4px; min-height: 44px;
  color: var(--slate); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.btn .icon { width: 20px; height: 20px; flex: none; }

/* ---------- Tela inicial ---------- */
.home {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 80% at 100% 0%, #0b3a52 0%, var(--navy) 55%);
  color: #fff;
  display: flex; flex-direction: column;
}
.home .container { flex: 1; display: flex; flex-direction: column; padding-top: 36px; padding-bottom: 28px; }
.home-logo { width: 150px; height: auto; }
.home-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0 32px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  color: var(--slate-light); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--slate); }
.home h1 { font-size: clamp(1.75rem, 6.4vw, 2.6rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 18px; font-weight: 700; }
.home .lead { font-size: 1.08rem; color: #d3dee4; margin: 0 0 36px; max-width: 34em; }
.home-actions { display: grid; gap: 12px; }
.resume-note { font-size: .92rem; color: #c3d0d7; margin: 0 0 4px; }
.home-note {
  font-size: .82rem; color: var(--slate-light); line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; margin: 0;
}
.home-note a { color: #dfe8ed; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.topbar-logo { width: 92px; height: auto; }
.topbar-tag { font-size: .78rem; color: var(--slate-light); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

/* ---------- Questionário ---------- */
.quiz { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.progress-wrap { background: #fff; border-bottom: 1px solid var(--line); }
.progress-wrap .container { padding-top: 14px; padding-bottom: 14px; }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.progress-meta strong { color: var(--navy); font-weight: 600; }
.progress { height: 6px; background: #e5eaee; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--slate), var(--navy)); border-radius: 99px; transition: width .45s cubic-bezier(.4, 0, .2, 1); }

.quiz-body { flex: 1; padding: 28px 0 140px; }
.question-topic { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); margin: 0 0 8px; }
.question-title { font-size: clamp(1.3rem, 4.8vw, 1.65rem); line-height: 1.3; margin: 0 0 24px; color: var(--navy); font-weight: 700; }
.options { display: grid; gap: 10px; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 16px 18px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  text-align: left; cursor: pointer; font-size: 1rem; line-height: 1.4;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--slate-light); }
.option .radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b5c3cb; display: grid; place-items: center; transition: border-color .15s; }
.option .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); transform: scale(0); transition: transform .15s; }
.option[aria-checked="true"] { border-color: var(--navy); background: #f2f6f8; box-shadow: 0 0 0 1px var(--navy) inset; }
.option[aria-checked="true"] .radio { border-color: var(--navy); }
.option[aria-checked="true"] .radio::after { transform: scale(1); }

.notice {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--oportunidade-bg); color: #24475a; font-size: .93rem; border-left: 3px solid var(--slate);
}

.quiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.quiz-nav .container { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.quiz-nav .btn-outline { min-width: 104px; }
.nav-hint { grid-column: 1 / -1; text-align: center; font-size: .82rem; color: var(--muted); margin: 0; min-height: 1.2em; }

/* Transições entre perguntas */
.slide-next { animation: slideNext .32s cubic-bezier(.2, .7, .2, 1); }
.slide-prev { animation: slidePrev .32s cubic-bezier(.2, .7, .2, 1); }
.fade-in { animation: fadeIn .35s ease; }
@keyframes slideNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Formulário ---------- */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-body { flex: 1; padding: 32px 0 48px; }
.page-title { font-size: clamp(1.45rem, 5.2vw, 1.9rem); line-height: 1.22; color: var(--navy); margin: 0 0 10px; }
.page-sub { color: var(--muted); margin: 0 0 28px; }
.form { display: grid; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; color: var(--navy); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"] {
  width: 100%; min-height: 54px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(93, 120, 135, .25); }
.field.invalid input { border-color: var(--vermelho); }
.field-error { color: var(--vermelho); font-size: .86rem; margin: 6px 0 0; min-height: 0; }
.field-hint { color: var(--muted); font-size: .84rem; margin: 6px 0 0; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.privacy-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; font-size: .88rem; color: var(--muted); }
.privacy-box p { margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; cursor: pointer; padding: 4px 0; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); cursor: pointer; }
.form-error { background: var(--vermelho-bg); color: var(--vermelho); padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin: 0; }

/* ---------- Processamento ---------- */
.processing { min-height: 100vh; min-height: 100dvh; background: var(--navy); color: #fff; display: grid; place-items: center; text-align: center; padding: 24px var(--gutter); }
.processing-inner { max-width: 440px; }
.processing .home-logo { margin: 0 auto 48px; width: 130px; }
.loader { width: 54px; height: 54px; margin: 0 auto 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing h1 { font-size: 1.4rem; line-height: 1.3; margin: 0 0 12px; }
.processing p { color: #c8d5dc; margin: 0; }

/* ---------- Resultado ---------- */
.result-hero { background: var(--navy); color: #fff; padding: 28px 0 84px; }
.result-hero .home-logo { width: 120px; margin-bottom: 28px; }
.result-hero .eyebrow { margin-bottom: 10px; }
.result-company { font-size: clamp(1.4rem, 5.6vw, 1.9rem); line-height: 1.2; margin: 0 0 14px; font-weight: 700; word-break: break-word; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: #c3d0d7; margin: 0; padding: 0; list-style: none; }
.result-meta strong { color: #fff; font-weight: 600; }

.result-main { margin-top: -60px; padding-bottom: 56px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }

.class-card { border-top: 5px solid var(--c); }
.class-card .class-label { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.class-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: var(--cbg); color: var(--c); font-weight: 700; font-size: 1.05rem; }
.class-pill .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.class-desc { margin: 14px 0 0; color: var(--muted); font-size: .95rem; }
.is-verde { --c: var(--verde); --cbg: var(--verde-bg); }
.is-amarelo { --c: var(--amarelo); --cbg: var(--amarelo-bg); }
.is-vermelho { --c: var(--vermelho); --cbg: var(--vermelho-bg); }

.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.count { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 10px; text-align: center; }
.count b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--navy); }
.count span { font-size: .8rem; color: var(--muted); }
.count.k-critical b { color: var(--vermelho); }
.count.k-attention b { color: var(--amarelo); }
.count.k-positive b { color: var(--verde); }
.counts-note { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

.card h2 { font-size: 1.12rem; color: var(--navy); margin: 0 0 14px; }
.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.highlights li { display: flex; gap: 12px; align-items: flex-start; font-size: .97rem; }
.lvl-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: .45em; background: var(--slate); }
.lvl-critical { background: var(--vermelho); }
.lvl-attention { background: var(--amarelo); }
.lvl-verify { background: var(--slate-light); }
.lvl-opportunity { background: var(--oportunidade); }
.lvl-positive { background: var(--verde); }
.empty-note { color: var(--muted); margin: 0; }

.result-actions { display: grid; gap: 10px; margin-top: 16px; }

.report h2.report-title { font-size: 1.3rem; margin: 0 0 4px; }
.report-sub { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.report-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.report-section h3 { font-size: 1.06rem; color: var(--navy); margin: 0 0 12px; }
.report-section h4 { font-size: .98rem; color: var(--navy); margin: 18px 0 8px; }
.report-section p { margin: 0 0 12px; color: #26353d; }
.report-section ul { margin: 0 0 12px; padding-left: 20px; color: #26353d; }
.report-section li { margin-bottom: 6px; }
.finding { border-left: 3px solid var(--fc, var(--slate)); background: var(--fbg, #f6f8f9); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 16px; margin: 0 0 12px; }
.finding h4 { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.finding p { margin: 0; font-size: .96rem; }
.badge { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: #fff; color: var(--fc, var(--slate)); border: 1px solid currentColor; }
.f-critical { --fc: var(--vermelho); --fbg: var(--vermelho-bg); }
.f-attention { --fc: var(--amarelo); --fbg: var(--amarelo-bg); }
.f-verify { --fc: var(--slate); --fbg: #f1f4f6; }
.f-opportunity { --fc: var(--oportunidade); --fbg: var(--oportunidade-bg); }
.action-group { margin: 0 0 14px; }
.action-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.action-group h4 .lvl-dot { margin-top: 0; }
.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; }

.schedule { background: var(--navy); color: #fff; }
.schedule h2 { color: #fff; font-size: 1.25rem; line-height: 1.3; }
.schedule p { color: #c8d5dc; margin: 0 0 20px; }
.schedule-pending { font-size: .88rem; color: var(--slate-light); border: 1px dashed rgba(255,255,255,.25); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }

.limits { font-size: .86rem; color: var(--muted); }
.limits h2 { font-size: 1rem; }
.limits p { margin: 0 0 8px; }
.restart { text-align: center; margin-top: 24px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem;
  max-width: calc(100% - 32px); box-shadow: var(--shadow); animation: fadeIn .25s ease;
}

/* ---------- Erro ---------- */
.error-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); text-align: center; background: var(--bg); }
.error-page .inner { max-width: 440px; }
.error-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--amarelo-bg); color: var(--amarelo); display: grid; place-items: center; margin: 0 auto 20px; font-size: 28px; font-weight: 700; }
.error-page h1 { font-size: 1.35rem; color: var(--navy); margin: 0 0 10px; }
.error-page p { color: var(--muted); margin: 0 0 24px; }

/* ---------- Turnstile ---------- */
#turnstile-slot { position: fixed; right: 12px; bottom: 96px; z-index: 30; }
#turnstile-slot:empty { display: none; }

/* ---------- Política de privacidade ---------- */
.doc { padding: 32px 0 56px; }
.doc h1 { color: var(--navy); font-size: 1.6rem; line-height: 1.25; }
.doc h2 { color: var(--navy); font-size: 1.12rem; margin-top: 28px; }
.doc p, .doc li { color: #26353d; }
.draft-banner { background: var(--amarelo-bg); color: #6b440b; border-radius: var(--radius-sm); padding: 14px 16px; font-size: .92rem; }
.placeholder { background: #fff3cd; padding: 0 4px; border-radius: 4px; }

@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .home-actions { grid-template-columns: auto; justify-content: start; }
  .home-actions .btn { min-width: 380px; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  .card { padding: 32px; }
  .quiz-body { padding-top: 48px; }
  .quiz-nav .container { grid-template-columns: 160px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .quiz-nav, .result-actions, .restart, #turnstile-slot { display: none !important; }
}
