/* Telas de acesso (login, definir senha).
   Esquerda: vitrine escura com a topologia animada (acesso.js).
   Direita: o formulário, sobre um fundo com profundidade (claro ou escuro). */
:root {
  color-scheme: light;
  --bg: #eef2f8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: #f3f6fb;
  --line: #dbe2ee;
  --text: #0b1220;
  --text-2: #4a5568;
  --text-3: #8592a6;
  --accent: #2a78d6;
  --accent-2: #20b6d4;
  --good: #0ca30c;
  --bad: #d03b3b;
  --brilho-1: rgba(57, 135, 229, 0.16);
  --brilho-2: rgba(56, 214, 230, 0.12);
  --sombra: 0 30px 70px -36px rgba(16, 42, 92, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #080d18;
    --surface: rgba(16, 24, 42, 0.72);
    --surface-2: rgba(9, 15, 28, 0.9);
    --line: rgba(120, 170, 255, 0.16);
    --text: #eef3ff;
    --text-2: #a9b6cf;
    --text-3: #7d8aa3;
    --accent: #3987e5;
    --accent-2: #38d6e6;
    --bad: #f07a7a;
    --brilho-1: rgba(57, 135, 229, 0.22);
    --brilho-2: rgba(56, 214, 230, 0.12);
    --sombra: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080d18;
  --surface: rgba(16, 24, 42, 0.72);
  --surface-2: rgba(9, 15, 28, 0.9);
  --line: rgba(120, 170, 255, 0.16);
  --text: #eef3ff;
  --text-2: #a9b6cf;
  --text-3: #7d8aa3;
  --accent: #3987e5;
  --accent-2: #38d6e6;
  --bad: #f07a7a;
  --brilho-1: rgba(57, 135, 229, 0.22);
  --brilho-2: rgba(56, 214, 230, 0.12);
  --sombra: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr);
}

/* ================================================================ vitrine (esquerda) */
.vitrine {
  position: relative;
  overflow: hidden;
  background: #070b14;
  color: #eef3ff;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 56px);
  isolation: isolate;
  min-height: 100vh;
}
.vitrine canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.vitrine::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7,11,20,0) 55%, rgba(7,11,20,.7) 100%);
}
.vitrine-marca img { height: 30px; display: block; }

/* topologia */
.topologia-area {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px 0;
}
#topologia { width: 100%; max-width: 760px; height: auto; overflow: visible; }
.topo-estrada { stroke: rgba(120,170,255,.18); stroke-width: 2; stroke-dasharray: 10 10; animation: estrada 1.4s linear infinite; }
.topo-ligacao { fill: none; stroke: rgba(120,170,255,.16); stroke-width: 2; transition: stroke .35s, stroke-width .35s; }
.topo-ligacao.fluxo { stroke-dasharray: 3 9; animation: fluxo 1.6s linear infinite; }
.topo-ligacao.ativa { stroke: rgba(56,214,230,.95); stroke-width: 2.6; stroke-dasharray: none; filter: url(#brilho); }
.topo-ligacao.ativa.verde { stroke: rgba(52,211,153,.95); }

.topo-no .disco { fill: #0c1730; stroke: rgba(120,170,255,.22); stroke-width: 1.5; }
.topo-no .anel { fill: none; stroke: url(#grad-anel); stroke-width: 2.2; opacity: .3; transition: opacity .35s, stroke .35s; }
.topo-no .halo { fill: rgba(56,214,230,.18); opacity: 0; transform-box: fill-box; transform-origin: center; }
.topo-no .icone { fill: none; stroke: #8fb8ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .35s; }
.topo-no .icone .furos circle, .topo-no .icone .janelas rect { fill: #8fb8ff; stroke: none; transition: fill .35s; }
.topo-no .rotulo, .moto .rotulo { fill: #93a3c0; font: 500 13px Inter, system-ui, sans-serif; text-anchor: middle; letter-spacing: .01em; transition: fill .35s; }
.topo-no.ativo .anel { opacity: 1; }
.topo-no.ativo .icone { stroke: #eaf7ff; }
.topo-no.ativo .icone .furos circle, .topo-no.ativo .icone .janelas rect { fill: #eaf7ff; }
.topo-no.ativo .rotulo { fill: #eef3ff; }
.topo-no.ativo .halo { animation: halo 1.5s ease-out infinite; }
.topo-no.verde .anel { stroke: #34d399; }
.topo-no.verde .halo { fill: rgba(52,211,153,.2); }
.topo-no.tocando .icone { animation: tocar .5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

.topo-ia .disco { fill: #0d1b3a; }
.topo-ia .barra { fill: #38d6e6; transform-box: fill-box; transform-origin: center; animation: equalizador 1.1s ease-in-out infinite; }
.topo-ia .barra:nth-child(2) { animation-delay: -.2s; }
.topo-ia .barra:nth-child(3) { animation-delay: -.45s; }
.topo-ia .barra:nth-child(4) { animation-delay: -.7s; }
.topo-ia .barra:nth-child(5) { animation-delay: -.9s; }
.topo-ia .anel { opacity: .6; }

.moto { fill: none; stroke: #8fb8ff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.moto .bau { fill: #12305e; stroke: #38d6e6; }
.moto .bau-faixa { stroke: #38d6e6; }
.moto .carenagem { fill: #1d4f96; stroke: #8fb8ff; }
.moto .banco { fill: #0a1428; stroke: #8fb8ff; stroke-width: 1.6; }
.moto .capacete { fill: #3987e5; stroke: #bfe3ff; }
.moto .viseira { stroke: #070b14; stroke-width: 3; }
.moto .roda circle { fill: #0a1428; stroke: #bfe3ff; stroke-width: 3; }
.moto .roda .aro { fill: none; stroke: #38d6e6; stroke-width: 2; stroke-dasharray: 4 3.5; animation: girar .45s linear infinite; }
.moto .rotulo { stroke: none; }

.topo-pacote { fill: #38d6e6; filter: url(#brilho); }
.topo-rastro { fill: #38d6e6; }
.topo-rastro:nth-of-type(1) { opacity: .5; }
.topo-rastro:nth-of-type(2) { opacity: .3; }
.topo-rastro:nth-of-type(3) { opacity: .15; }
.topo-pacote.verde, .topo-rastro.verde { fill: #34d399; }

.topologia-legenda {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 9px 16px 9px 10px; border-radius: 999px;
  background: rgba(12,20,36,.66); border: 1px solid rgba(120,170,255,.2);
  backdrop-filter: blur(8px);
  color: #dbe7ff; font-size: 14px;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
}
.topologia-legenda.visivel { opacity: 1; transform: none; }
.topologia-legenda .passo {
  flex: none; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #38d6e6; background: rgba(56,214,230,.14); padding: 3px 9px; border-radius: 999px;
}
.topologia-legenda.ok .passo { color: #34d399; background: rgba(52,211,153,.14); }

/* texto */
.vitrine-conteudo { max-width: 640px; animation: subir .9s cubic-bezier(.2,.7,.2,1) both .1s; }
.vitrine h2 {
  font-size: clamp(26px, 3vw, 42px); line-height: 1.1; letter-spacing: -0.025em;
  margin: 0 0 12px; font-weight: 700;
  background: linear-gradient(92deg, #ffffff 0%, #bfe3ff 55%, #8fb8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vitrine p { color: #a9b6cf; font-size: clamp(14px, 1.1vw, 16px); margin: 0; max-width: 540px; }
.destaques { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 12px; flex-wrap: wrap; }
.destaques li {
  padding: 11px 15px; border-radius: 12px; min-width: 128px;
  background: rgba(12,20,36,.55); border: 1px solid rgba(120,170,255,.16);
  backdrop-filter: blur(8px);
  animation: subir .8s cubic-bezier(.2,.7,.2,1) both;
}
.destaques li:nth-child(1) { animation-delay: .35s; }
.destaques li:nth-child(2) { animation-delay: .5s; }
.destaques li:nth-child(3) { animation-delay: .65s; }
.destaques strong { display: block; font-size: 19px; color: #fff; letter-spacing: -0.01em; }
.destaques span { font-size: 12.5px; color: #93a3c0; }

/* ================================================================ formulário (direita) */
.lado-form {
  position: relative;
  display: grid; place-items: center;
  padding: 32px 24px;
  overflow: hidden;
  background:
    radial-gradient(520px 420px at 85% 8%, var(--brilho-1), transparent 70%),
    radial-gradient(460px 380px at 10% 92%, var(--brilho-2), transparent 70%),
    var(--bg);
}
.lado-form::before {
  /* grade bem sutil, continuando a da vitrine */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.35), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.35), transparent 70%);
}
.cartao {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: var(--sombra);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: surgir .7s cubic-bezier(.2,.7,.2,1) both .2s;
}
.cartao::before {
  /* fio de luz no topo do cartão */
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), transparent);
  opacity: .9;
}
.cartao .marca { display: flex; justify-content: center; margin: 0 0 24px; }
.cartao .marca img { height: 36px; width: auto; display: block; }
.cartao .marca .logo-clara { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .cartao .marca .logo-clara { display: block; }
  :root:where(:not([data-theme="light"])) .cartao .marca .logo-escura { display: none; }
}
:root[data-theme="dark"] .cartao .marca .logo-clara { display: block; }
:root[data-theme="dark"] .cartao .marca .logo-escura { display: none; }
h1 { font-size: 19px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--text-2); margin: 0 0 20px; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--text-2); margin: 16px 0 7px; }
form > label:first-of-type { margin-top: 0; }
input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.dica { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
button.principal {
  width: 100%;
  margin-top: 24px;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 160% 100%;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  cursor: pointer;
  transition: background-position .4s, transform .1s, box-shadow .2s;
}
button.principal:hover { background-position: 100% 0; box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
button.principal:active { transform: translateY(1px); }
button.principal:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.rodape { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.aviso { border-radius: 10px; padding: 10px 12px; margin-top: 16px; font-size: 13px; display: none; }
.aviso.erro { display: block; background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.aviso.ok { display: block; background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--text); }

/* ================================================================ animações */
@keyframes subir { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes surgir { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fluxo { to { stroke-dashoffset: -24; } }
@keyframes estrada { to { stroke-dashoffset: -20; } }
@keyframes halo { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes equalizador { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes tocar { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes girar { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .topologia-legenda { opacity: 1; transform: none; }
}

/* ================================================================ responsivo */
@media (max-height: 820px) and (min-width: 961px) {
  .destaques { display: none; }
}
@media (max-width: 960px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .vitrine { min-height: 0; padding: 22px 24px 26px; }
  .topologia-area { padding: 10px 0 18px; gap: 12px; }
  #topologia { max-width: 620px; }
  .vitrine h2 { font-size: clamp(22px, 4.6vw, 32px); }
  .destaques { display: none; }
  .lado-form { padding: 28px 16px 44px; align-items: start; }
  .cartao .marca { display: none; } /* no celular a logo já está no topo da vitrine */
}
@media (max-width: 560px) {
  .vitrine { padding: 18px 12px 20px; }
  .vitrine-marca img { height: 24px; }
  .topologia-area { padding: 4px 0 12px; }
  .topologia-legenda { font-size: 12.5px; padding: 7px 12px 7px 8px; }
  /* o SVG encolhe com a tela: rótulos maiores (em unidades do desenho) para continuar legíveis */
  .topo-no .rotulo, .moto .rotulo { font-size: 24px; }
  .topo-ia .rotulo { font-size: 22px; }
  .moto .rotulo { display: none; } /* encostaria no "Interfone"; a legenda já conta a cena */
  .vitrine p { display: none; }
  .vitrine-conteudo { padding: 0 4px; }
  .cartao { padding: 26px 20px 22px; }
}
