/* ── Reset e variáveis ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Pérola fria + ardósia + índigo — mesma paleta do guia */
  --preto:        #f1f4f9;   /* fundo base (não é mais preto, mas mantém nome do token) */
  --preto-1:      #f5f8fc;
  --preto-2:      #ffffff;
  --preto-3:      #e8ecf3;
  --preto-4:      #dde3ee;
  --carbono:      #cbd5e1;

  --branco:       #0f172a;   /* "branco" agora é ardósia escura (texto principal) */
  --prata:        #1e293b;
  --prata-2:      #475569;
  --prata-3:      #94a3b8;
  --prata-4:      #cbd5e1;

  --linha:        rgba(15, 23, 42, 0.08);
  --linha-forte:  rgba(15, 23, 42, 0.16);
  --linha-acento: rgba(15, 23, 42, 0.32);

  --erro:         #b91c1c;
  --ok:           #15803d;

  /* Acento índigo — autoridade judicial */
  --indigo:       #1e3a8a;
  --indigo-claro: #2f4fb0;
  --indigo-escuro:#15296e;
  --indigo-suave: rgba(30, 58, 138, 0.08);
  --indigo-borda: rgba(30, 58, 138, 0.30);

  --mono:         'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --display:      'Space Grotesk', sans-serif;
}

html, body {
  height: 100%;
  background: var(--preto);
  color: var(--prata);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* ── Background — Pérola fria com blueprint técnico ─────────── */
.bg-noir {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, #f5f8fc 0%, #eef2f8 50%, #e6ecf4 100%);
  z-index: 0;
}

/* Grid sutil em tinta escura translúcida — blueprint */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 70% 70% at center, black 35%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at center, black 35%, transparent 95%);
}

/* Scanline horizontal em índigo translúcido */
.bg-scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(30,58,138,0.10) 50%, transparent 100%);
  height: 2px;
  animation: scan 9s linear infinite;
}
@keyframes scan {
  0%   { top: -2%; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 102%; opacity: 0; }
}

/* Vinheta — toque azul-escuro nas bordas */
.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(30, 41, 90, 0.14) 100%);
}

/* ── HUD lateral ────────────────────────────────────────────── */
.hud {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 2;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--prata-3);
}
.hud-left  { left: 22px; }
.hud-right { right: 22px; }
.hud-tick {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, transparent, var(--linha-acento), transparent);
}
.hud-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.hud-right .hud-label {
  transform: rotate(0deg);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--prata-2);
  padding: 8px 18px;
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.topbar-dot {
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(21, 128, 61, 0.55);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.topbar-text { color: var(--prata-2); font-weight: 500; }
.topbar-clock {
  color: var(--branco);
  font-weight: 600;
  padding-left: 12px;
  border-left: 1px solid var(--linha-forte);
}

/* ── Container ───────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px;
  padding: 80px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Frame com cantos arquitetônicos ─────────────────────────── */
.frame {
  position: relative;
  padding: 44px 36px 40px;
  border: 1px solid var(--linha-forte);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.06);
}
.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--indigo);
  opacity: 0.9;
}
.corner-tl { top: -1px; left: -1px;  border-right: none; border-bottom: none; }
.corner-tr { top: -1px; right: -1px; border-left:  none; border-bottom: none; }
.corner-bl { bottom: -1px; left: -1px;  border-right: none; border-top: none; }
.corner-br { bottom: -1px; right: -1px; border-left:  none; border-top: none; }

/* ── Logo (PNG oficial) ──────────────────────────────────────── */
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.logo-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 14px;
  isolation: isolate;
  user-select: none;
}
/* Halo radial sutil atrás da logo */
.logo-wrap::before {
  content: '';
  position: absolute;
  inset: -20% -10%;
  z-index: -1;
  background: radial-gradient(ellipse 60% 70% at center, rgba(30, 58, 138, 0.10) 0%, rgba(30, 58, 138, 0.04) 35%, transparent 70%);
  filter: blur(8px);
}
/* Marca em texto — mesma fonte display da página */
.logo-text {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--branco);
  line-height: 1;
}
.logo-plus {
  color: var(--indigo);
  font-weight: 700;
  margin-left: 1px;
}
.logo-conecta {
  display: block;
  margin-top: 10px;
  padding: 5px 16px;
  border: 1px solid var(--indigo-borda);
  background: var(--indigo-suave);
  color: var(--indigo);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}
.logo-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--linha-acento), transparent);
}
.logo-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--prata-3);
  text-transform: uppercase;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--indigo-escuro);
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--indigo-borda);
  background: var(--indigo-suave);
}
.hero-tag-bracket { color: var(--indigo); }

.title {
  font-family: var(--display);
  font-size: clamp(34px, 4.8vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--branco);
}
.title .accent {
  color: var(--indigo);
  font-weight: 600;
  font-style: italic;
}

.subtitle {
  font-size: 13.5px;
  text-align: center;
  color: var(--prata-2);
  max-width: 420px;
  line-height: 1.65;
  margin-top: 4px;
}
.subtitle strong {
  color: var(--indigo);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ── Card de login (terminal claro) ─────────────────────────── */
.card {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--linha-forte);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-top: 8px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.10),
    0 1px 0 var(--linha-forte) inset;
}
.card:focus-within {
  border-color: var(--indigo);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.10),
    0 0 0 3px var(--indigo-suave);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--linha);
  background: var(--preto-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--prata-2);
}
.card-header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 6px rgba(30, 58, 138, 0.45);
}
.card-header-label { flex: 1; }
.card-header-id    { color: var(--indigo); font-weight: 700; }

/* ── Field ──────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 22px 0;
}
.field + .field { padding-top: 8px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--prata-2);
  text-transform: uppercase;
}
.field-num {
  color: var(--indigo);
  font-weight: 700;
  padding: 2px 6px;
  border: 1px solid var(--indigo-borda);
  background: var(--indigo-suave);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--linha-forte);
  background: var(--preto-1);
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}
.input-prefix {
  font-family: var(--mono);
  color: var(--indigo);
  padding-left: 14px;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}
.input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 13px 44px 13px 10px;
  color: var(--branco);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.input-wrap input::placeholder {
  color: var(--prata-3);
  font-weight: 400;
}
.input-wrap input:focus {
  outline: none;
}
.input-wrap:focus-within {
  border-color: var(--indigo);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--indigo-suave);
}
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--branco);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  caret-color: var(--branco);
  font-family: var(--mono) !important;
}

.btn-toggle {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--prata-3);
  padding: 8px;
  display: flex;
  transition: color 0.2s, background 0.2s;
}
.btn-toggle:hover { color: var(--indigo); background: var(--indigo-suave); }

/* ── Checkbox ───────────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--prata-2);
  padding: 14px 22px;
  margin-top: 4px;
  border-top: 1px solid var(--linha);
}
.checkbox-row input { display: none; }
.cb-box {
  width: 14px;
  height: 14px;
  border: 1px solid var(--linha-acento);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all 0.2s;
}
.checkbox-row input:checked ~ .cb-box {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #ffffff;
}

/* ── Botão ──────────────────────────────────────────────────── */
.btn-acessar {
  width: calc(100% - 44px);
  margin: 4px 22px 22px;
  background: var(--indigo);
  border: 1px solid var(--indigo);
  padding: 14px 20px;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, background 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}
.btn-acessar::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent);
  transition: left 0.6s ease;
}
.btn-acessar:hover::before { left: 100%; }
.btn-acessar:hover {
  background: var(--indigo-escuro);
  border-color: var(--indigo-escuro);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.30);
}
.btn-acessar:active { transform: translateY(1px); }
.btn-acessar:disabled { opacity: 0.5; cursor: wait; }
.btn-bracket { opacity: 0.7; }
.btn-acessar svg { transition: transform 0.2s; }
.btn-acessar:hover:not(:disabled) svg { transform: translateX(3px); }

/* ── Erro ───────────────────────────────────────────────────── */
.error-msg {
  display: none;
  margin: 14px 22px 0;
  background: #fdecec;
  border: 1px solid #f3b6b6;
  border-left: 3px solid var(--erro);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--erro);
}
.error-msg.show { display: block; animation: shake 0.4s; }
.error-msg::before { content: '! ERR · '; opacity: 0.7; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Rodapé ─────────────────────────────────────────────────── */
.rodape {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.rodape-grid {
  display: flex;
  gap: 0;
  border: 1px solid var(--linha-forte);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rodape-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  font-family: var(--mono);
  border-right: 1px solid var(--linha);
}
.rodape-cell:last-child { border-right: none; }
.rodape-key {
  font-size: 8.5px;
  letter-spacing: 0.32em;
  color: var(--prata-3);
  text-transform: uppercase;
}
.rodape-val {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--indigo);
  font-weight: 700;
}
.rodape-marca {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--prata-3);
  text-transform: uppercase;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .hud { display: none; }
  .topbar { font-size: 9px; padding: 7px 14px; gap: 8px; }
  .topbar-text { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 600px) {
  .container { padding: 70px 18px 32px; gap: 22px; }
  .frame { padding: 32px 20px 28px; gap: 24px; }
  .logo-text { font-size: 36px; }
  .logo-conecta { font-size: 9.5px; padding: 4px 14px; }
  .field { padding: 14px 16px 0; }
  .checkbox-row { padding: 12px 16px; }
  .btn-acessar { width: calc(100% - 32px); margin: 4px 16px 18px; }
  .error-msg { margin: 12px 16px 0; }
  .rodape-grid { flex-wrap: wrap; }
  .rodape-cell { flex: 1 1 33%; padding: 8px 12px; }
  .title { font-size: 30px; }
}
