/*
 * Sistema visual do site C&D Blindagem Digital (v4, escuro).
 * Tokens e componentes (.btn, .grid-bg, .hero-light, anéis orbitais, .band, cards de vidro)
 * vêm do globals.css do site, sem Tailwind.
 */
:root {
  --deep: #0a0e15;
  --deep-2: #161d28;
  --deep-3: #10161f;
  --navy: #1b2432;
  --line: #222b38;
  --gold: #d9a93a;
  --gold-deep: #b1841c;
  --bone: #eceae4;
  --fog: #a6adb8;
  --ok: #7cc093;
  --err: #f0b4a8;
  --err-line: #e7937e;

  --ease-reveal: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --aura: 0 0 10px 2px rgb(217 169 58 / 0.65), inset 0 0 7px rgb(236 234 228 / 0.35);
  --aura-hover: 0 0 18px 4px rgb(217 169 58 / 0.8), inset 0 0 10px rgb(236 234 228 / 0.45);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@property --orbit {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  color: var(--bone);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--deep); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Fundo: grade mascarada + feixe de luz ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(217 169 58 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(217 169 58 / 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.hero-light {
  position: absolute;
  inset: -18% -22% -25% -20%;
  filter: blur(65px);
  background: linear-gradient(115deg, transparent 10%, rgb(217 169 58 / 0.16) 40%, rgb(217 169 58 / 0.4) 56%, transparent 85%);
  animation: hero-light-drift 26s ease-in-out infinite;
}
@keyframes hero-light-drift {
  0%, 100% { opacity: 0.3; transform: translate(-5%, 5%) rotate(-4deg); }
  50% { opacity: 0.55; transform: translate(7%, -5%) rotate(5deg); }
}

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background-color: rgb(22 29 40 / 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 768px) { .wrap { padding-inline: 2.5rem; } }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand img { display: block; height: 40px; width: auto; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.micro { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fog); }
.link-btn {
  background: none; border: 0; padding: 8px 4px; color: var(--fog);
  font-size: 0.85rem; transition: color 150ms var(--ease-ui);
}
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--bone); } }

/* ---------- Layout principal ---------- */
main {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
}
.screen { width: 100%; max-width: 760px; margin-inline: auto; }
.screen.narrow { max-width: 460px; }
.center { text-align: center; }

.kicker { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.5; color: var(--gold); }
.h1 { font-size: 2rem; line-height: 2.25rem; font-weight: 300; letter-spacing: -0.01em; }
.h1 b { font-weight: 700; color: var(--gold); }
@media (min-width: 1024px) { .h1 { font-size: 3rem; line-height: 1.08; } }
.h2 { font-size: 1.6rem; line-height: 1.2; font-weight: 300; letter-spacing: -0.005em; }
.h2 b { font-weight: 700; color: var(--gold); }
.lead { font-size: 1rem; line-height: 1.625; color: var(--fog); }
.stack > * + * { margin-top: 1rem; }

/* ---------- Reveal com desfoque + cascata ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); filter: blur(6px);
  transition: opacity 0.9s var(--ease-reveal), transform 0.9s var(--ease-reveal), filter 0.9s ease; }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- Cards de vidro ---------- */
.glass-card {
  background-color: rgb(22 29 40 / 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
}

/* ---------- Botões com aura pulsante ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  white-space: nowrap; border-radius: 9999px; padding: 0.875rem 1.5rem;
  font-size: 0.95rem; line-height: 1.5; min-height: 48px;
  border: 1px solid transparent;
  transition: transform 300ms var(--ease-ui), box-shadow 300ms var(--ease-ui), background-color 300ms var(--ease-ui),
    border-color 300ms var(--ease-ui), color 300ms var(--ease-ui), filter 300ms var(--ease-ui);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn::before {
  content: ""; position: absolute; inset: -2px;
  border: 1px solid rgb(217 169 58 / 0.85); border-radius: inherit;
  box-shadow: var(--aura); pointer-events: none;
  animation: button-aura 5s ease-in-out infinite;
  transition: box-shadow 0.5s ease;
}
.btn:focus-visible::before { box-shadow: var(--aura-hover); }
.btn:active { transform: scale(0.97); transition-duration: 160ms; transition-timing-function: var(--ease-out); }
@keyframes button-aura {
  0%, 100% { opacity: 0.35; filter: blur(4px); }
  50% { opacity: 0.85; filter: blur(7px); }
}
.btn-primary { background: var(--gold); color: var(--deep); font-weight: 700; }
.btn-ghost { background: var(--deep-2); border-color: var(--line); color: var(--bone); }
.btn-ghost::before { display: none; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover::before { box-shadow: var(--aura-hover); }
  .btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 10px 40px -10px rgb(217 169 58 / 0.9); }
  .btn-ghost:hover { background: var(--navy); border-color: var(--gold); color: var(--gold); }
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 560px) { .btn-row .btn { flex: 1 1 100%; } }

/* ---------- Campo de senha ---------- */
.field { display: grid; gap: 6px; text-align: left; }
.field label { font-size: 0.85rem; color: var(--fog); }
.field input {
  width: 100%; background: rgb(10 14 21 / 0.6); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; color: var(--bone); transition: border-color 200ms ease;
}
.field input:focus { border-color: var(--gold); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--err-line); }
.field-err { font-size: 0.85rem; color: var(--err); min-height: 1.3em; }

/* ---------- Anéis orbitais ---------- */
@keyframes orbit { to { --orbit: 360deg; } }
.emblem { position: relative; display: grid; place-items: center; width: 250px; aspect-ratio: 1; margin-inline: auto; }
@media (min-width: 768px) { .emblem { width: 300px; } }
.emblem.small { width: 200px; }
@media (min-width: 768px) { .emblem.small { width: 230px; } }
.emblem-halo { position: absolute; inset: -7%; border-radius: 50%; background: radial-gradient(circle, rgb(177 132 28 / 0.2), transparent 65%); filter: blur(26px); }
.emblem-orb { position: relative; width: 72%; aspect-ratio: 1; display: grid; place-items: center; }
.ring {
  position: absolute; inset: 0; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--orbit), transparent 0deg 190deg, rgb(177 132 28 / 0.3) 235deg, rgb(177 132 28 / 0.85) 300deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: orbit 18s linear infinite;
}
.ring-1 { inset: -9%; padding: 1.5px; background: conic-gradient(from var(--orbit), transparent 0deg 120deg, rgb(177 132 28 / 0.25) 200deg, rgb(177 132 28 / 0.35) 265deg, transparent 360deg); animation-duration: 28s; }
.ring-2 { inset: -17%; padding: 1.5px; background: conic-gradient(from var(--orbit), transparent 0deg 180deg, rgb(177 132 28 / 0.22) 250deg, rgb(177 132 28 / 0.28) 310deg, transparent 360deg); animation-duration: 38s; animation-direction: reverse; }
.ring-3 { inset: -25%; padding: 1.5px; background: conic-gradient(from var(--orbit), transparent 0deg 140deg, rgb(177 132 28 / 0.2) 230deg, rgb(177 132 28 / 0.26) 290deg, transparent 360deg); animation-duration: 48s; }
.is-active .ring { animation-duration: 6s; }
.is-active .ring-1 { animation-duration: 9s; }
.is-active .ring-2 { animation-duration: 12s; }
.is-active .ring-3 { animation-duration: 15s; }
.emblem-core {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 0%, rgb(177 132 28 / 0.18), transparent 70%), linear-gradient(165deg, var(--deep-2), var(--deep-3));
  border: 1px solid var(--line);
}
.emblem-core { position: relative; overflow: hidden; }
.emblem-core img { position: absolute; inset: 21%; width: 58%; height: 58%; object-fit: contain; opacity: 0.95; }
.emblem-core svg { width: 38%; height: 38%; color: var(--gold); }
.float { animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pct { font-weight: 300; font-size: 2.1rem; letter-spacing: -0.02em; line-height: 1; }
.pct small { font-size: 1rem; color: var(--fog); font-weight: 400; }

/* ---------- Área de envio ---------- */
.dropzone {
  position: relative; display: block; width: 100%; text-align: center; padding: 2.25rem 1.25rem 2rem;
  border: 1px dashed rgb(217 169 58 / 0.4); border-radius: 1.75rem; cursor: pointer; overflow: hidden;
  background-color: rgb(22 29 40 / 0.6);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color 300ms var(--ease-ui), background-color 300ms var(--ease-ui), box-shadow 300ms var(--ease-ui);
}
@media (min-width: 768px) { .dropzone { padding: 2.75rem 2rem 2.5rem; } }
.dropzone.drag, .dropzone:focus-visible { border-color: var(--gold); border-style: solid; background-color: rgb(27 36 50 / 0.75); box-shadow: 0 0 60px -12px rgb(217 169 58 / 0.55); }
@media (hover: hover) and (pointer: fine) { .dropzone:hover { border-color: var(--gold); box-shadow: 0 0 60px -20px rgb(217 169 58 / 0.55); } }
.dropzone.drag .ring { animation-duration: 4s; }
.dropzone > * + * { margin-top: 0.9rem; }
.dropzone .emblem { margin-bottom: 0.5rem; }
.formats { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fog); }

/* feixes de luz nas bordas do card */
.band::before, .band::after {
  content: ""; position: absolute; left: 0; width: 30%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgb(232 197 106 / 0), rgb(232 197 106 / 0.55) 45%, rgb(245 225 170 / 0.9), rgb(232 197 106 / 0.55) 55%, rgb(232 197 106 / 0));
  box-shadow: 0 0 26px 7px rgb(217 169 58 / 0.22);
  will-change: transform;
}
.band::before { top: 0; animation: sweep-r 7s linear infinite; }
.band::after { bottom: 0; animation: sweep-l 7s linear infinite; animation-delay: -3.5s; }
@keyframes sweep-r { from { transform: translateX(-110%); } to { transform: translateX(440%); } }
@keyframes sweep-l { from { transform: translateX(440%); } to { transform: translateX(-110%); } }

/* ---------- Arquivo escolhido ---------- */
.file-card { padding: 1.25rem; display: grid; gap: 1.1rem; }
@media (min-width: 768px) { .file-card { padding: 1.5rem 1.75rem; } }
.file-head { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.file-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--deep-3); border: 1px solid var(--line); color: var(--gold); }
.file-ico svg { width: 24px; height: 24px; }
.file-name { font-weight: 500; overflow-wrap: anywhere; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin-top: 4px; }

/* ---------- Progresso ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: left; }
.step { border-top: 2px solid var(--line); padding-top: 0.6rem; font-size: 0.8rem; color: var(--fog); transition: border-color 500ms var(--ease-ui), color 500ms var(--ease-ui); display: flex; align-items: center; gap: 0.45rem; }
.step .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.step.on { border-color: var(--gold); color: var(--bone); }
.step.on .dot { background: var(--gold); animation: pulse-dot 1.6s ease-in-out infinite; }
.step.done { border-color: var(--ok); color: var(--ok); }
.step.done .dot { background: var(--ok); }
@keyframes pulse-dot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.bar { position: relative; height: 8px; border-radius: 9999px; background: var(--deep-3); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); box-shadow: 0 0 14px rgb(217 169 58 / 0.6); transition: width 600ms var(--ease-ui); }
.bar.indet .bar-fill { width: 30%; animation: indet 1.6s ease-in-out infinite; transition: none; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.work-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 1rem; }
.work-meta .val { color: var(--bone); }

/* ---------- Resultado ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 0.9rem 1rem; border-radius: 1rem; }
.stat .n { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.01em; line-height: 1.2; }
.result-text {
  padding: 1.25rem; max-height: min(52vh, 520px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  line-height: 1.7; font-size: 0.98rem; color: var(--bone); scrollbar-color: var(--line) transparent;
}
@media (min-width: 768px) { .result-text { padding: 1.75rem; } }
.screen.wide { max-width: 900px; }

.status-ok { color: var(--ok); }
.alert { border-color: rgb(231 147 126 / 0.5); padding: 1.5rem; }
.alert-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--err-line); color: var(--err); }
.alert-ico svg { width: 22px; height: 22px; }

.note { text-align: center; max-width: 520px; margin: 1.25rem auto 0; line-height: 1.7; }

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; filter: none; transition: opacity 0.2s ease; }
  .btn::before { animation: none; opacity: 0.45; filter: blur(5px); }
  .btn, .btn:active, .btn-primary:hover { transform: none; }
  .hero-light { animation: none; opacity: 0.4; }
  .ring, .ring-1, .ring-2, .ring-3, .is-active .ring, .float, .step.on .dot { animation: none; }
  .band::before, .band::after { animation: none; left: 20%; width: 60%; opacity: 0.5; }
  .bar.indet .bar-fill { animation: none; width: 100%; opacity: 0.5; }
  .bar-fill { transition: none; }
}
