/* =========================
   ARQUIVO: login/css/login.css

   Página de login — layout novo, tema claro/escuro e responsivo.
   Substitui login.css, modais_login.css e mobile-login.css antigos.
   Não depende do combinado.php: os padrões do sistema (floating label,
   modal azul, botões, alertas) foram replicados aqui com variáveis de tema.
========================= */

/* =========================
   VARIÁVEIS — TEMA CLARO (padrão)
========================= */
:root {
  --primary: #1672d8;
  --primary-light: #57aff9;
  --primary-hover: #135ba1;
  --primary-soft: rgba(22, 114, 216, 0.10);
  --focus-border: #80bdff;
  --focus-ring: rgba(0, 123, 255, 0.25);

  --page-bg: #eef4fb;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-shadow: 0 20px 45px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-border-hover: #adb5bd;
  --text: #1f2937;
  --text-2: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --footer-bg: #f9fafb;

  --brand-grad: linear-gradient(135deg, #1672d8 0%, #3a8df0 55%, #57aff9 100%);

  --erro: #ff3030;
  --erro-ring: rgba(255, 48, 48, 0.25);
  --alerta-erro-bg: #f8d7da;
  --alerta-erro-text: #842029;
  --alerta-erro-borda: #dc3545;
  --alerta-aviso-bg: #fff3cd;
  --alerta-aviso-text: #856404;
  --alerta-aviso-borda: #ffc107;
  --alerta-info-bg: #d6e9fb;
  --alerta-info-text: #0b4c91;
  --alerta-info-borda: #1672d8;
  --alerta-sucesso-bg: #d1f2e0;
  --alerta-sucesso-text: #0f5132;
  --alerta-sucesso-borda: #28a745;

  --sucesso: #28a745;
  --seguro: #10b981;

  color-scheme: light;
}

/* =========================
   VARIÁVEIS — TEMA ESCURO
========================= */
:root[data-theme="dark"] {
  --primary: #3a8df0;
  --primary-light: #6cb4ff;
  --primary-hover: #5ca1f3;
  --primary-soft: rgba(58, 141, 240, 0.15);
  --focus-border: #3a8df0;
  --focus-ring: rgba(58, 141, 240, 0.30);

  /* Mesma paleta do css/global/modo-escuro.css */
  --page-bg: #1e2532;
  --card-bg: #2d3647;
  --card-border: #3d4860;
  --card-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.22);
  --input-bg: #262e3d;
  --input-border: #3d4860;
  --input-border-hover: #4b5873;
  --text: #e3e8f0;
  --text-2: #c3cad6;
  --muted: #98a3b6;
  --muted-2: #76829a;
  --footer-bg: #262e3d;

  --brand-grad: linear-gradient(135deg, #1b3c66 0%, #24568f 55%, #2d69ad 100%);

  --alerta-erro-bg: rgba(220, 53, 69, 0.14);
  --alerta-erro-text: #fca5a5;
  --alerta-aviso-bg: rgba(255, 193, 7, 0.12);
  --alerta-aviso-text: #fcd34d;
  --alerta-info-bg: rgba(58, 141, 240, 0.15);
  --alerta-info-text: #93c5fd;
  --alerta-info-borda: #3a8df0;
  --alerta-sucesso-bg: rgba(40, 167, 69, 0.15);
  --alerta-sucesso-text: #86efac;

  color-scheme: dark;
}

/* =========================
   RESET / BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--page-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

body.modal-aberto {
  overflow: hidden;
}

button {
  font-family: inherit;
}

/* =========================
   LAYOUT PRINCIPAL (2 colunas)
========================= */
.login-page {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =========================
   LADO DA MARCA
========================= */
.login-brand {
  position: relative;
  overflow: hidden;
  background: var(--brand-grad);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  transition: background 0.3s ease;
}

/* Textura de pontos */
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
  pointer-events: none;
}

/* Círculos decorativos */
.brand-shapes span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.brand-shapes span:nth-child(1) {
  width: 440px;
  height: 440px;
  top: -150px;
  right: -170px;
}

.brand-shapes span:nth-child(2) {
  width: 280px;
  height: 280px;
  bottom: -90px;
  left: -100px;
}

.brand-shapes span:nth-child(3) {
  width: 110px;
  height: 110px;
  top: 42%;
  right: 10%;
  animation: flutuar 7s ease-in-out infinite;
}

.brand-topo,
.brand-conteudo,
.brand-rodape {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: block;
  max-height: 64px;
  max-width: 240px;
  width: auto;
  height: auto;
  border-radius: 10px;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.brand-conteudo h1 {
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 18px 0 12px;
  max-width: 520px;
}

.brand-conteudo > p {
  font-size: 1.02rem;
  opacity: 0.9;
  max-width: 480px;
}

.brand-recursos {
  list-style: none;
  margin-top: 32px;
  display: grid;
  gap: 12px;
  max-width: 480px;
}

.brand-recursos li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, background 0.25s ease;
  animation: subirSuave 0.6s ease both;
}

.brand-recursos li:nth-child(1) { animation-delay: 0.10s; }
.brand-recursos li:nth-child(2) { animation-delay: 0.18s; }
.brand-recursos li:nth-child(3) { animation-delay: 0.26s; }
.brand-recursos li:nth-child(4) { animation-delay: 0.34s; }

.brand-recursos li:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.14);
}

.recurso-icone {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.brand-recursos strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
}

.brand-recursos small {
  display: block;
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1.35;
}

.brand-rodape {
  font-size: 0.82rem;
  opacity: 0.75;
}

/* =========================
   LADO DO FORMULÁRIO
========================= */
.login-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.login-rodape-mobile {
  display: none;
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--muted-2);
  text-align: center;
}

/* =========================
   BOTÃO DE TEMA
========================= */
.btn-tema {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--primary);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-tema:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.btn-tema:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.btn-tema .icone-sol { display: none; color: #fbbf24; }
:root[data-theme="dark"] .btn-tema .icone-lua { display: none; }
:root[data-theme="dark"] .btn-tema .icone-sol { display: inline-block; }

.btn-tema.girando i {
  animation: girarTema 0.45s ease;
}

/* =========================
   CARD DE LOGIN
========================= */
.login-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 38px 32px 26px;
  box-shadow: var(--card-shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  animation: subirSuave 0.55s ease both;
}

/* Linha superior (mesma ideia do .main-content::after do sistema) */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1672d8, #57aff9);
}

.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  animation: brilhoLinha 4s infinite;
}

.login-card.tremer {
  animation: tremer 0.45s ease;
}

.card-topo {
  text-align: center;
}

.card-icone {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-topo h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.card-topo p {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

.line-highlight {
  height: 1px;
  margin: 22px 0;
  border: none;
  background: linear-gradient(to right, transparent, var(--input-border), transparent);
  opacity: 0.8;
}

/* =========================
   ALERTAS (erro / aviso)
========================= */
.alerta {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 22px;
  border-radius: 6px;
  border-left: 4px solid;
  font-size: 0.9rem;
  line-height: 1.45;
}

.alerta.visivel {
  display: flex;
  animation: alertaEntrar 0.35s ease-out;
}

.alerta i {
  font-size: 1.05rem;
  margin-top: 1px;
}

.alerta-erro {
  background: var(--alerta-erro-bg);
  color: var(--alerta-erro-text);
  border-left-color: var(--alerta-erro-borda);
}
.alerta-erro i { color: var(--alerta-erro-borda); }

.alerta-aviso {
  background: var(--alerta-aviso-bg);
  color: var(--alerta-aviso-text);
  border-left-color: var(--alerta-aviso-borda);
}
.alerta-aviso i { color: var(--alerta-aviso-borda); }

.alerta-sucesso {
  background: var(--alerta-sucesso-bg);
  color: var(--alerta-sucesso-text);
  border-left-color: var(--alerta-sucesso-borda);
}
.alerta-sucesso i { color: var(--alerta-sucesso-borda); }

/* =========================
   FLOATING LABEL (padrão do sistema, com ícone)
========================= */
.form-group {
  position: relative;
  margin-bottom: 22px;
}

.floating-label input {
  width: 100%;
  height: 50px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.3s ease;
}

#senha {
  padding-right: 48px;
}

.floating-label input:hover {
  border-color: var(--input-border-hover);
}

.floating-label input:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.campo-icone {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.25s ease;
}

.floating-label:focus-within .campo-icone {
  color: var(--primary);
}

.floating-label label {
  position: absolute;
  left: 38px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  pointer-events: none;
  transition: all 0.25s ease;
}

/* Label flutuando sobre a borda */
.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label.has-value label {
  top: 0;
  left: 10px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--card-bg);
}

/* Separado: se o navegador não reconhecer o seletor, não derruba a regra de cima */
.floating-label input:-webkit-autofill + label {
  top: 0;
  left: 10px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--card-bg);
}

/* Autopreenchimento do navegador no tema certo */
.floating-label input:-webkit-autofill,
.floating-label input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
  animation-name: autofillInicio;
}

.floating-label input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset, 0 0 0 0.2rem var(--focus-ring);
  animation-name: autofillInicio;
}

/* Botão mostrar/ocultar senha */
.btn-ver-senha {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-ver-senha:hover,
.btn-ver-senha.ativo {
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-ver-senha:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

/* Erro no campo (mesmo visual do .input-obrigatorio-error do sistema) */
.form-group.tem-erro input {
  border-color: var(--erro);
  animation: inputErroPulso 2s ease-in-out infinite;
}

.form-group.tem-erro label,
.form-group.tem-erro .campo-icone {
  color: var(--erro) !important;
}

/* =========================
   CAPS LOCK
========================= */
.caps-aviso {
  display: none;
  align-items: center;
  gap: 6px;
  margin: -12px 0 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #d97706;
}

.caps-aviso.visivel {
  display: flex;
  animation: alertaEntrar 0.25s ease-out;
}

/* =========================
   LEMBRAR E-MAIL + ESQUECI A SENHA
========================= */
.linha-opcoes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.checkbox-custom input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 5px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-box i {
  font-size: 10px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.checkbox-custom:hover .checkbox-box {
  border-color: var(--primary);
}

.checkbox-custom input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-custom input:checked + .checkbox-box i {
  opacity: 1;
  transform: scale(1);
}

.checkbox-custom input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.link-acao {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.link-acao::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.link-acao:hover::after,
.link-acao:focus-visible::after {
  width: 100%;
}

.link-acao:focus-visible {
  outline: none;
}

/* =========================
   BOTÃO ENTRAR
========================= */
.btn-entrar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(to bottom, #3a8df0, #1672d8);
  box-shadow: 0 4px 12px rgba(22, 114, 216, 0.35);
  transition: all 0.2s ease;
}

.btn-entrar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transition: left 0.5s ease;
}

.btn-entrar:hover {
  background: linear-gradient(to bottom, #5ca1f3, #1363bd);
  box-shadow: 0 6px 16px rgba(22, 114, 216, 0.45);
  transform: translateY(-2px);
}

.btn-entrar:hover::before {
  left: 100%;
}

.btn-entrar:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(22, 114, 216, 0.5);
}

.btn-entrar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(22, 114, 216, 0.4);
}

.btn-entrar-seta {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.btn-entrar:hover .btn-entrar-seta {
  transform: translateX(3px);
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

.btn-entrar.carregando .btn-spinner { display: inline-block; }
.btn-entrar.carregando .btn-entrar-seta { display: none; }

.btn-entrar:disabled {
  cursor: wait;
  transform: none;
  opacity: 0.9;
}

/* =========================
   DIVISOR + CRIAR CONTA
========================= */
.divisor {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divisor::before,
.divisor::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.btn-criar-conta {
  width: 100%;
  text-decoration: none;
  height: 48px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-criar-conta:hover {
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.btn-criar-conta:active {
  transform: translateY(1px);
}

.btn-criar-conta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.link-voltar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 18px auto 0;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-voltar:hover {
  color: var(--primary);
}

.link-voltar:focus-visible {
  outline: none;
  color: var(--primary);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.card-seguro {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted-2);
}

.card-seguro i {
  color: var(--seguro);
}

/* =========================
   MODAIS (base igual ao modais-geral.css)
========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(-40px);
  transition: transform 0.4s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

/* Header azul (modal-azul.css) */
.header-modal-azul {
  background: linear-gradient(135deg, #1672d8, #57aff9);
  padding: 18px 22px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-wrapper i {
  font-size: 20px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.btn-fechar {
  background: none;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-fechar:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-fechar:active {
  transform: scale(0.9);
}

.modal-body {
  padding: 20px 22px 6px;
}

.line-highlight-azul {
  position: relative;
  overflow: hidden;
  height: 3px;
  margin: 0 0 20px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1672d8, #57aff9);
}

.line-highlight-azul::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  animation: brilhoLinha 4s infinite;
}

.mensagem-inicial-azul {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 6px;
  border-left: 4px solid var(--alerta-info-borda);
  background: var(--alerta-info-bg);
  color: var(--alerta-info-text);
  font-size: 0.93rem;
}

.mensagem-inicial-azul i {
  font-size: 18px;
  color: var(--alerta-info-borda);
}

.modal-texto {
  margin: 16px 0 14px;
  font-size: 0.95rem;
  color: var(--text-2);
  text-align: center;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 22px;
  background: var(--footer-bg);
  border-top: 1px solid var(--card-border);
}

.btn-salvar-azul {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(to bottom, #3a8df0, #1672d8);
  box-shadow: 0 2px 6px rgba(22, 114, 216, 0.4);
  transition: all 0.2s ease;
}

.btn-salvar-azul:hover {
  background: linear-gradient(to bottom, #5ca1f3, #1363bd);
  box-shadow: 0 4px 10px rgba(22, 114, 216, 0.5);
  transform: translateY(-2px);
}

.btn-salvar-azul:active {
  transform: translateY(1px);
}

.btn-salvar-azul:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(22, 114, 216, 0.4);
}

/* =========================
   MODAL DE SUCESSO
========================= */
.modal-content-sucesso {
  max-width: 380px;
  padding: 36px 30px 30px;
  text-align: center;
}

.modal-content-sucesso h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 16px;
}

.modal-content-sucesso p {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.modal-content-sucesso p strong {
  color: var(--text);
}

.checkmark {
  width: 84px;
  height: 84px;
  display: block;
  margin: 0 auto;
}

.checkmark-circle {
  stroke: var(--sucesso);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
}

.checkmark-check {
  stroke: var(--sucesso);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.modal-sucesso.show .checkmark-circle {
  animation: tracar 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.modal-sucesso.show .checkmark-check {
  animation: tracar 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

.barra-progresso {
  height: 6px;
  margin-top: 22px;
  border-radius: 999px;
  background: var(--primary-soft);
  overflow: hidden;
}

.barra-progresso span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1672d8, #57aff9);
}

.modal-sucesso.show .barra-progresso span {
  animation: progresso 2.2s linear forwards;
}

/* =========================
   ANIMAÇÕES
========================= */
@keyframes subirSuave {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flutuar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-18px); }
}

@keyframes brilhoLinha {
  0%   { left: -100%; }
  40%  { left: 100%; }
  100% { left: 100%; }
}

@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

@keyframes alertaEntrar {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes inputErroPulso {
  0%, 100% { box-shadow: 0 0 0 0.2rem rgba(255, 48, 48, 0.20); }
  50%      { box-shadow: 0 0 0 0.2rem rgba(255, 48, 48, 0.40); }
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

@keyframes girarTema {
  from { transform: rotate(-90deg) scale(0.6); opacity: 0; }
  to   { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes tracar {
  to { stroke-dashoffset: 0; }
}

@keyframes progresso {
  to { width: 100%; }
}

/* Usada só para detectar o autopreenchimento no JS */
@keyframes autofillInicio {
  from { opacity: 1; }
  to   { opacity: 1; }
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 1100px) {
  .login-brand {
    padding: 40px;
  }
}

/* Tablet / mobile: marca vira um cabeçalho e o card sobe por cima dele */
@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .login-brand {
    padding: 30px 24px 100px;
    gap: 0;
    align-items: center;
    text-align: center;
  }

  .brand-shapes span:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -140px;
    right: -120px;
  }

  .brand-shapes span:nth-child(3) {
    display: none;
  }

  .brand-logo {
    max-height: 52px;
    margin: 0 auto;
  }

  .brand-tag,
  .brand-recursos,
  .brand-rodape {
    display: none;
  }

  .brand-conteudo h1 {
    font-size: 1.45rem;
    margin: 16px auto 6px;
  }

  .brand-conteudo > p {
    font-size: 0.9rem;
    margin: 0 auto;
  }

  .login-main {
    justify-content: flex-start;
    margin-top: -72px;
    padding: 0 20px 28px;
  }

  .login-rodape-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .btn-tema {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  .login-brand {
    padding: 26px 18px 92px;
  }

  .brand-conteudo h1 {
    font-size: 1.25rem;
    padding: 0 30px; /* não encosta no botão de tema */
  }

  .login-main {
    padding: 0 14px 24px;
  }

  .login-card {
    padding: 30px 20px 22px;
    border-radius: 14px;
  }

  .card-icone {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .card-topo h2 {
    font-size: 1.35rem;
  }

  .card-topo p {
    font-size: 0.86rem;
  }

  .linha-opcoes {
    flex-wrap: wrap;
  }

  /* 16px evita o zoom automático do iOS ao focar */
  .floating-label input {
    font-size: 16px;
  }
}

/* Desktop: lado da marca fica fixo ocupando a altura da tela;
   só a coluna do formulário rola */
@media (min-width: 961px) {
  .login-brand {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
  }
}

/* Telas baixas no desktop (notebook com zoom): marca compacta */
@media (min-width: 961px) and (max-height: 720px) {
  .brand-recursos {
    margin-top: 22px;
    gap: 8px;
  }

  .brand-recursos li {
    padding: 9px 12px;
  }
}

/* =========================
   CONTAS SALVAS
========================= */
.login-card [hidden] { display: none !important; }

/* Lista visível no lugar do formulário */
.contas-salvas { display: none; }
.login-card.modo-contas .contas-salvas { display: block; animation: alertaEntrar 0.3s ease-out; }
.login-card.modo-contas #form-login { display: none; }

.contas-titulo {
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.contas-lista {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.conta-item {
  display: flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.conta-item:hover { border-color: var(--primary); }
.conta-item:focus-within { box-shadow: 0 0 0 0.2rem var(--focus-ring); }

.conta-entrar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.conta-entrar:focus-visible,
.conta-remover:focus-visible { outline: none; }

.conta-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conta-info { min-width: 0; }

.conta-info strong,
.conta-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conta-info small { font-size: 0.8rem; color: var(--muted); }

.conta-remover {
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.conta-remover:hover,
.conta-remover:focus-visible {
  color: var(--erro);
  background: rgba(255, 48, 48, 0.12);
}

/* "Contas salvas" dentro do formulário */
.link-contas {
  display: block;
  margin: 16px auto 0;
}

/* Acessibilidade: usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Nome do sistema no lado da marca (substitui o logo em imagem) */
.brand-nome {
  display: inline-flex;
  text-decoration: none;
  border-radius: 6px;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.brand-nome:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
