/* ============================================================================
   LOGIN.CSS — estilos das telas de login, cadastro e verificação 2FA
   ============================================================================
   Estas telas seguem o mesmo padrão: painel escuro à esquerda + card branco
   com o formulário à direita.
   ============================================================================ */

/* ============================================================================
   TOGGLE CLIENTE / ADMIN (topo do card de login)
   ============================================================================ */
.login-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 22px;
  background: var(--page);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}

.login-toggle button {
  flex: 1;
  min-height: 40px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--anim-fast);
}

.login-toggle button:hover {
  color: var(--text);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.login-toggle button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(23, 107, 135, 0.25);
}

.login-toggle button.active:hover {
  background: var(--primary-dark);
  color: #fff;
}


/* ============================================================================
   PAINEL TECH ESCURO (Brasil + Lupa + 27 UFs) — login principal
   ============================================================================ */
.login-brand-tech {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-radius: var(--radius-md);
  color: #fff;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(10, 40, 54, 0.94) 0%, rgba(15, 83, 105, 0.90) 100%),
    var(--primary-dark);
  box-shadow: var(--shadow-lg);
}

/* Decorações flutuantes (Brasil + lupa) posicionadas atrás do texto */
.login-brand-tech > * {
  position: relative;
  z-index: 2;
}

/* Silhueta do Brasil no fundo (grande, translúcida) */
.brand-map-brasil {
  position: absolute;
  top: 50%;
  right: -40px;
  transform: translateY(-50%);
  width: 380px;
  height: 380px;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 1;
}
.brand-map-brasil svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
}

/* Lupa decorativa (sobrepõe o mapa) */
.brand-lupa {
  position: absolute;
  top: 40%;
  right: 60px;
  transform: translateY(-50%);
  width: 130px;
  height: 130px;
  color: var(--accent);
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(193, 139, 50, 0.35));
}
.brand-lupa svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Ícones flutuantes de conexão (pontos de UF) */
.brand-dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}
.brand-dots span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(193, 139, 50, 0.6);
}

.login-brand-tech .eyebrow {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.login-brand-tech h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.login-brand-tech > div > p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 480px;
}

/* Estados atendidos no painel tech */
.login-brand-tech .state-grid span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #fff;
  font-weight: 800;
}


/* ============================================================================
   PAINEL AMARELO CHAMATIVO (variante alternativa)
   ============================================================================ */
.login-brand-yellow {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-radius: var(--radius-md);
  color: #0a2836;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.4), transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(23, 107, 135, 0.15), transparent 50%),
    linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #f2ac2b 100%);
  box-shadow:
    0 20px 45px rgba(245, 158, 11, 0.28),
    0 8px 20px rgba(28, 45, 74, 0.10);
}

.login-brand-yellow::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
  pointer-events: none;
}

.login-brand-yellow::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 107, 135, 0.20), transparent 70%);
  pointer-events: none;
}

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

.login-brand-yellow .eyebrow {
  color: #b91c1c;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.login-brand-yellow h1 {
  color: #0a2836;
  font-size: clamp(2.4rem, 5.5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.login-brand-yellow p {
  color: rgba(10, 40, 54, 0.85);
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 620px;
}

.login-brand-yellow .state-grid {
  margin-top: 28px;
}

.login-brand-yellow .state-grid span {
  background: rgba(10, 40, 54, 0.08);
  border: 1px solid rgba(10, 40, 54, 0.15);
  color: #0a2836;
  font-weight: 900;
}

/* Emoji ilustrativo de carro */
.login-brand-yellow .brand-car-emoji {
  font-size: 3.2rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}


/* ============================================================================
   ESCURO CONTRA CLARO NO DARK MODE (correção da auditoria)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-card {
    background: var(--panel);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .consent-box {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
  }
}


/* ============================================================================
   PÁGINA DE CADASTRO (card largo, 2 colunas)
   ============================================================================ */
.cadastro-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.cadastro-card {
  max-width: 760px;
  width: 100%;
}

.cadastro-card > h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.cadastro-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

.cadastro-col-title {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--primary-dark);
}

@media (max-width: 720px) {
  .cadastro-columns {
    grid-template-columns: 1fr;
  }
}


/* Container da tela toda */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px);
  align-items: center;
  gap: 32px;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Painel escuro à esquerda (com foto de fundo) */
.login-brand {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-radius: var(--radius-md);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.88) 100%),
    var(--primary-dark);
  box-shadow: var(--shadow-lg);
}

.login-brand h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.login-brand p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.14rem;
  line-height: 1.6;
}

.login-brand .eyebrow {
  color: var(--accent);
}

/* Grid de estados atendidos */
.state-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  max-width: 620px;
  margin-top: 24px;
}

.state-grid span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Página de login centralizada (sem painel lateral) */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-page .login-card {
  max-width: 440px;
  width: 100%;
}

/* Card branco à direita (formulário) */
.login-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  margin: 0 0 24px;
  font-size: 1.8rem;
}

.login-card .btn + .btn,
.login-card button + button {
  margin-top: 12px;
}

.login-card .hint {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Ações lado a lado (voltar / avançar) */
.login-card .actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.login-card .actions .btn { flex: 1; }

/* Caixinha de LGPD */
.consent-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f6f9fc;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.consent-box input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}


/* ============================================================================
   RESPONSIVO (celular / tablet)
   ============================================================================ */

@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .login-brand {
    min-height: 320px;
    padding: 32px;
  }

  .login-brand h1 {
    font-size: 2.2rem;
  }

  .state-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .login-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .state-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .login-brand p {
    font-size: 1rem;
  }
}

/* Mobile pequeno - esconder painel decorativo para dar prioridade ao form */
@media (max-width: 600px) {
  .login-brand,
  .login-brand-yellow,
  .login-brand-tech {
    min-height: auto;
    padding: 24px;
  }
  .login-brand .state-grid,
  .login-brand-yellow .state-grid,
  .login-brand-tech .state-grid {
    display: none;
  }
  .login-brand h1,
  .login-brand-yellow h1,
  .login-brand-tech h1 {
    font-size: 1.8rem;
  }
  .login-brand p,
  .login-brand-yellow p,
  .login-brand-tech > div > p {
    font-size: 0.95rem;
  }
  .brand-map-brasil,
  .brand-lupa,
  .brand-dots {
    display: none;
  }
}
