/* ─────────────────────────────────────────────────────────────
   SFERA Soluções Inteligentes — captação de leads
   Direção: instrumento de precisão. Tinta profunda, papel osso,
   âmbar como única luz. Serifa editorial + grotesca + mono.
   ───────────────────────────────────────────────────────────── */

:root {
  /* Palheta oficial da SFERA — espelha /root/sfera (site institucional). */
  --bg:          #08131f;
  --bg-2:        #0b1a2a;
  --bg-3:        #0e2135;
  --painel:      #0d1c2d;
  --painel-alto: #12273c;
  --linha:       #12273c;
  --linha-suave: #0d1c2d;

  --azul-sfera:       #1a3a5c;
  --azul-inteligente: #2563eb;
  --ciano-tech:       #0ea5e9;
  --accent:           #35d7ff;
  --accent-2:         #b8ecff;
  --accent-dim:       rgba(53, 215, 255, 0.16);

  --texto:   #f2f7fc;
  --texto-2: #c9d9e9;
  --texto-3: #9db2ca;
  --texto-4: #8299b4;

  --danger: #ff8f77;
  --ok:     #7ff0a8;

  --fonte-titulo: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
  --fonte:        "Inter", "Helvetica Neue", Helvetica, sans-serif;
  --fonte-mono:   "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

/* Grão sutil sobre tudo, dá textura de impressão */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 8s steps(6) infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

.mono { font-family: var(--fonte-mono); font-size: 0.688rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dim  { color: var(--texto-4); }

/* ── Estrutura ────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100svh;
}

/* ── Painel de marca ──────────────────────────────────────── */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vh, 3.25rem);
  padding: clamp(1.75rem, 4vw, 3.5rem);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(53, 215, 255, 0.12), transparent 58%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
}

/* malha técnica de fundo */
.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--linha-suave) 1px, transparent 1px),
    linear-gradient(90deg, var(--linha-suave) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(80% 70% at 30% 30%, #000 20%, transparent 78%);
  opacity: 0.75;
  pointer-events: none;
}

.brand > * { position: relative; z-index: 1; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.wordmark__glyph {
  width: 34px; height: 34px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.1;
  animation: spin 26s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wordmark__text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark__text strong {
  font-family: var(--fonte-titulo);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.3em;
}
.wordmark__text em {
  font-family: var(--fonte-mono);
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--texto-4);
  margin-top: 0.28rem;
}

.brand__body { max-width: 34rem; }

.eyebrow {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.display {
  font-family: var(--fonte-titulo);
  font-weight: 800;
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.15rem;
}
.display em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.lede {
  margin: 0 0 2.25rem;
  color: var(--texto-2);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  max-width: 30rem;
}

.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; max-width: 30rem; }
.marks li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--linha-suave);
  align-items: start;
}
.marks li:last-child { border-bottom: 1px solid var(--linha-suave); }
.marks span { color: var(--accent); padding-top: 0.22rem; }
.marks b { display: block; font-weight: 600; font-size: 0.94rem; letter-spacing: -0.005em; }
.marks i { display: block; font-style: normal; color: var(--texto-4); font-size: 0.86rem; }

/* Esfera orbital — o motivo da marca, sangra para fora do painel */
.orbit {
  position: absolute;
  right: -14%;
  bottom: -18%;
  width: min(62vw, 640px);
  margin: 0;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.orbit svg { width: 100%; height: auto; display: block; }
.orbit__rings { fill: none; stroke: var(--accent); stroke-width: 0.7; opacity: 0.55; }
.orbit__core { animation: pulse 6s var(--ease) infinite; transform-origin: 50% 50%; }
@keyframes pulse { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.06); } }
.orbit__moon { fill: var(--accent-2); transform-origin: 200px 200px; animation: spin 18s linear infinite; }
.orbit__moon--slow { animation-duration: 31s; animation-direction: reverse; opacity: 0.7; }

.brand__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
  color: var(--texto-4);
  border-top: 1px solid var(--linha-suave);
  padding-top: 1.1rem;
}
.brand__foot .mono:first-child { color: var(--texto-2); }

/* ── Painel do formulário ─────────────────────────────────── */

.panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 3.5rem) clamp(1.25rem, 3vw, 3rem);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-left: 1px solid var(--linha);
}

.card {
  width: 100%;
  max-width: 32rem;
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--r);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(53, 215, 255, 0.06);
  padding: clamp(1.4rem, 2.6vw, 2rem);
  position: relative;
}
/* filete âmbar no topo do cartão */
.card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.card__head { margin-bottom: 1.35rem; }
.card__headline h2 {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
}
.card__sub { margin: 0 0 1.05rem; color: var(--texto-2); font-size: 0.875rem; max-width: 28rem; }

.progress { height: 2px; background: var(--linha); position: relative; overflow: hidden; }
.progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.55s var(--ease);
}

/* ── Campos ───────────────────────────────────────────────── */

.form { display: grid; gap: 1.05rem; }

.field { display: grid; gap: 0.38rem; }

.field label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.005em;
  color: var(--texto);
}
.idx { color: var(--texto-4); font-size: 0.63rem; transition: color 0.25s var(--ease); }
.field:focus-within .idx { color: var(--accent); }

.control {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--linha);
  border-radius: var(--r);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.control:hover { border-color: var(--azul-sfera); }
.control:focus-within {
  border-color: var(--accent);
  background: var(--painel-alto);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.control input,
.control select {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 0.98rem;
  padding: 0.72rem 0.9rem;
  min-width: 0;
}
.control input::placeholder { color: #5d7893; }
.control input:-webkit-autofill {
  -webkit-text-fill-color: var(--texto);
  -webkit-box-shadow: 0 0 0 40rem var(--bg-3) inset;
}
.control input[type="number"]::-webkit-outer-spin-button,
.control input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.control input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.prefix {
  padding-left: 0.9rem;
  color: var(--texto-4);
  border-right: 1px solid var(--linha);
  padding-right: 0.75rem;
  margin-right: -0.2rem;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.control--select select {
  appearance: none;
  cursor: pointer;
  padding-right: 2.4rem;
}
.control--select select option { background: var(--painel); color: var(--texto); }
.chev {
  position: absolute;
  right: 0.85rem;
  width: 14px; height: 14px;
  fill: none;
  stroke: var(--texto-4);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.control__status {
  position: absolute;
  right: 0.85rem;
  font-family: var(--fonte-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-4);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.control__status[data-state] { opacity: 1; }
.control__status[data-state="ok"] { color: var(--ok); }
.control__status[data-state="loading"] { color: var(--accent); }

.hint { margin: 0; font-size: 0.75rem; line-height: 1.4; color: var(--texto-4); }
/* dicas vazias não ocupam espaço — o formulário respira só onde há texto */
.hint:empty, .formerror:empty { display: none; }
.hint--consent { margin: -0.5rem 0 0; }

.field[data-invalid="true"] .control { border-color: var(--danger); }
.field[data-invalid="true"] .hint { color: var(--danger); }
.field[data-invalid="true"] .control { animation: nudge 0.3s var(--ease); }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Checkboxes ───────────────────────────────────────────── */

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--texto-2);
  user-select: none;
  margin-top: 0.15rem;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin-top: 0.1rem;
  border: 1px solid var(--linha);
  border-radius: 2px;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  transition: all 0.18s var(--ease);
}
.check .box svg { width: 11px; height: 11px; fill: none; stroke: var(--bg); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.6); transition: all 0.18s var(--ease); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-dim); }
.check:hover .box { border-color: var(--azul-sfera); }
.check input:checked ~ .check__text { color: var(--texto); }

.check--consent { margin-top: 0.4rem; align-items: flex-start; }

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

.turnstile { display: flex; justify-content: center; margin-top: 0.2rem; }
.turnstile:empty { display: none; }

/* ── Botão ────────────────────────────────────────────────── */

.submit {
  position: relative;
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.92rem 1.2rem;
  border: 0;
  border-radius: var(--r);
  background: var(--accent);
  color: #04121e;
  font-family: var(--fonte);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s var(--ease);
}
.submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.55) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.submit:hover { background: var(--accent-2); box-shadow: 0 14px 34px -14px rgba(53, 215, 255, 0.45); transform: translateY(-1px); }
.submit:hover::after { transform: translateX(120%); }
.submit:active { transform: translateY(0); }
.submit:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.submit__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s var(--ease); }
.submit:hover .submit__arrow svg { transform: translateX(4px); }

.submit__spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(4,18,30,0.25); border-top-color: #04121e; border-radius: 50%; animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.submit[data-loading="true"] { pointer-events: none; opacity: 0.85; }
.submit[data-loading="true"] .submit__arrow { display: none; }
.submit[data-loading="true"] .submit__spinner { display: block; }

.formerror { margin: 0; font-size: 0.8rem; color: var(--danger); text-align: center; }

/* ── Sucesso ──────────────────────────────────────────────── */

.done { text-align: center; padding: 1.5rem 0 0.5rem; animation: rise 0.6s var(--ease) both; }
.done__mark svg { width: 62px; height: 62px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.done__mark svg circle { stroke-dasharray: 132; animation: draw 0.9s var(--ease) both; }
.done__mark svg path { stroke-dasharray: 30; animation: draw 0.5s var(--ease) 0.5s both; }
@keyframes draw { from { stroke-dashoffset: 132; } to { stroke-dashoffset: 0; } }
.done h2 { font-size: clamp(2.1rem, 4vw, 2.9rem); margin: 1rem 0 0.6rem; }
.done p { color: var(--texto-2); font-size: 0.94rem; margin: 0 auto 0.8rem; max-width: 24rem; }
.done p b { color: var(--texto); }
.done__hint { color: var(--texto-4); }

/* ── Revelação na carga ───────────────────────────────────── */

.reveal { animation: rise 0.75s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsivo ───────────────────────────────────────────── */

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--linha); }
  .brand { min-height: auto; padding-bottom: clamp(2.5rem, 8vw, 5rem); }
  .orbit { right: -22%; bottom: -30%; width: min(90vw, 520px); opacity: 0.32; }
  .brand__foot { margin-top: 2rem; }
  .card { margin-inline: auto; }
}

@media (max-width: 560px) {
  .marks li:nth-child(n + 3) { display: none; }
  .display { font-size: clamp(2.25rem, 10vw, 3rem); }
  .card { padding: 1.35rem 1.1rem; }
  .brand { gap: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .grain { animation: none; }
}
