/* D2UN brand system — tokens do brandbook v1.0 (cap. 09). Dark-first, roxo é acento. */
:root {
  /* Roxo — alma da marca */
  --brand-purple-primary: #6D28D9;
  --brand-purple-bright: #7C3AED;
  --brand-purple-deep: #4C1D95;
  --brand-purple-glow: rgba(124, 58, 237, 0.15);

  /* Backgrounds & superfícies */
  --bg-obsidian: #0A0A0F;
  --bg-carbon: #14141C;
  --bg-elevated: #1F1F2A;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.15);
  --border-focus: #7C3AED;

  /* Texto */
  --text-primary: #FFFFFF;
  --text-secondary: #D1D5DB;
  --text-tertiary: #9CA3AF;
  --text-muted: #6B7280;

  /* Tipografia */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Estados semânticos */
  --ok: #10B981;
  --err: #EF4444;

  /* Sombras */
  --ring-focus: 0 0 0 3px rgba(124, 58, 237, 0.25);
  --glow-purple: 0 0 40px rgba(124, 58, 237, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 32px 16px;
  position: relative;
  /* base obsidian + glows roxos em camadas + grid técnico fino (vibe "soluções tecnológicas") */
  background:
    radial-gradient(1100px 600px at 50% -12%, rgba(124, 58, 237, 0.22), transparent 70%),
    radial-gradient(900px 700px at 88% 4%, rgba(109, 40, 217, 0.16), transparent 65%),
    radial-gradient(1000px 800px at 6% 96%, rgba(76, 29, 149, 0.20), transparent 60%),
    linear-gradient(rgba(124, 58, 237, 0.035) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(124, 58, 237, 0.035) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg-obsidian);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Blobs de glow roxo à deriva — camada fixa atrás de tudo, não repinta o card */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(124, 58, 237, 0.30), transparent),
    radial-gradient(closest-side, rgba(139, 92, 246, 0.22), transparent);
  background-repeat: no-repeat;
  background-size: 46vmax 46vmax, 38vmax 38vmax;
  background-position: 12% 18%, 82% 78%;
  filter: blur(48px);
  animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { background-position: 12% 18%, 82% 78%; }
  50%  { background-position: 22% 30%, 70% 64%; }
  100% { background-position: 8% 12%, 90% 86%; }
}

.card {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  background: linear-gradient(var(--bg-carbon), var(--bg-carbon)) padding-box,
              linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(124, 58, 237, 0.06) 45%, rgba(139, 92, 246, 0.45)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--glow-purple), 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* Brackets roxos nos cantos — eco do detalhe [ ] do logo */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.card::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--brand-purple-bright);
  border-left: 2px solid var(--brand-purple-bright);
  border-top-left-radius: var(--radius-xl);
}
.card::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--brand-purple-bright);
  border-right: 2px solid var(--brand-purple-bright);
  border-bottom-right-radius: var(--radius-xl);
}

/* Eyebrow mono — assinatura técnica // SEÇÃO */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-purple-bright);
  margin: 0 0 10px;
}

/* Header */
.head .brand { display: flex; justify-content: center; align-items: center; margin-bottom: 22px; }
.head .brand img { height: 68px; width: auto; }

.head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 1.7rem;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.sub { margin: 0 0 22px; color: var(--text-tertiary); }

/* Progresso */
.progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-purple-primary), var(--brand-purple-bright));
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-text {
  margin: 10px 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

/* Passo */
.step h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 22px 0 16px;
}

.field { margin-bottom: 18px; }
.field > label,
.field legend {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  font-size: 0.95rem;
}
.req { color: var(--brand-purple-bright); }

input[type=text], input[type=email], input[type=tel], input[type=url], textarea {
  width: 100%;
  background: var(--bg-obsidian);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 11px 13px;
  font: inherit;
}
textarea { resize: vertical; min-height: 78px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--ring-focus);
}

input[type=file] {
  width: 100%;
  font: inherit;
  color: var(--text-tertiary);
  padding: 9px 0;
}
input[type=file]::file-selector-button {
  font: inherit;
  font-weight: 500;
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
}

fieldset { border: 0; margin: 0; padding: 0; }
.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 7px 0;
  cursor: pointer;
}
.choice input { width: 18px; height: 18px; accent-color: var(--brand-purple-bright); }

.detail { margin-top: 9px; }
.detail.hidden, .hidden { display: none; }

.hint {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 5px;
}

.error { color: var(--err); font-size: 0.82rem; min-height: 1em; margin-top: 5px; }
.field.has-error input,
.field.has-error textarea { border-color: var(--err); }

.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.status { min-height: 1.2em; font-size: 0.9rem; color: var(--text-tertiary); }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }

/* Navegação */
.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.btn {
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--brand-purple-bright); color: var(--text-primary); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Spinner no botão durante o envio */
.btn.loading { position: relative; color: transparent !important; opacity: 1; }
.btn.loading::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.ghost { background: transparent; color: var(--text-muted); }
/* CTA primário roxo sólido */
.btn.primary, .btn#btn-next {
  background: var(--brand-purple-primary);
  color: #fff;
  border-color: var(--brand-purple-primary);
  margin-left: auto;
}
.btn.primary:hover:not(:disabled), .btn#btn-next:hover:not(:disabled) {
  background: var(--brand-purple-bright);
  border-color: var(--brand-purple-bright);
  color: #fff;
}

/* Tela de sucesso */
.done { text-align: center; padding: 40px 0; }
.done h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.5rem;
}
.done .check { color: var(--ok); }
.done p { color: var(--text-tertiary); }

.cf-turnstile { margin: 8px 0; }
.cf-turnstile:empty { display: none; }

/* Rodapé de marca */
.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

@media (max-width: 520px) {
  body { padding: 16px 10px; }
  .card { padding: 20px; }
  .nav { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .btn.primary, .btn#btn-next { margin-left: 0; }
  .foot { flex-direction: column; gap: 4px; }
}
