/* ═══════════════════════════════════════════════════════════════
   Auth pages — login, signup e recuperação de senha
   Split layout: painel esquerdo (identidade do tenant) + formulário
   Cor da prefeitura via --auth-brand (injetada de SiteConfig);
   neutros fixos do design system Terreno Firme.

   ── A hierarquia de assinatura ───────────────────────────────
   O brasão do município assina em cima, em placa branca; o Rotier
   Territum assina embaixo, com o símbolo do marco geodésico. A tela
   diz de quem é a prefeitura e de quem é o sistema sem precisar de
   texto explicando.

   Os nomes de classe são os mesmos de antes de propósito: signup,
   recuperação de senha e alteração de dados compartilham esta folha
   e herdam o acabamento sem tocar no markup delas.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --auth-brand: #5e7257;
  --auth-brand-hover: #45533f;
  /* Link legível sobre cream mesmo quando o tenant troca --auth-brand:
     puxa a cor da marca em direção ao ink. */
  --auth-link: color-mix(in srgb, var(--auth-brand) 72%, #2f3835);
  --auth-ink: #2f3835;        /* charcoal-dark — texto principal */
  --auth-ink-soft: #4a5651;   /* charcoal — texto secundário */
  --auth-muted: #6b7a74;      /* charcoal-light — apoio */
  --auth-paper: #f4f1ec;      /* cream — fundo do painel de formulário */
  --auth-paper-mid: #eae6de;  /* cream-mid */
  --auth-line: #d8d2c6;       /* cream-dark — bordas */
  --auth-line-soft: #eae6de;  /* cream-mid — divisórias internas */
  --auth-icon: #5f6d68;       /* ícones/placeholder ≥4.5:1 sobre branco */

  --auth-font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --auth-font-display: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  --auth-font-mono: 'DM Mono', ui-monospace, monospace;

  --auth-r-sm: 6px;
  --auth-r-md: 8px;
  --auth-r-lg: 10px;
  --auth-r-card: 14px;
  --auth-ease: cubic-bezier(.16, 1, .3, 1);
}

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

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--auth-font);
  color: var(--auth-ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ──────────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Painel esquerdo — identidade ────────────────────────────── */
.auth-left {
  position: relative;
  /* 30/70: o painel de identidade é assinatura, não conteúdo — quem chega
     aqui vem para entrar, e o formulário é que merece a área. */
  width: 30%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 48px 56px 36px;
  overflow: hidden;
  color: #fff;
  /* Cor da prefeitura escurecida (chapada, sem gradiente) +
     grade de carta topográfica */
  background:
    repeating-linear-gradient(0deg,
      transparent, transparent 49px,
      rgba(255,255,255,.05) 49px, rgba(255,255,255,.05) 50px),
    repeating-linear-gradient(90deg,
      transparent, transparent 49px,
      rgba(255,255,255,.05) 49px, rgba(255,255,255,.05) 50px),
    color-mix(in srgb, var(--auth-brand) 72%, #1a1e1c);
}

/* Curvas de nível que se desenham uma vez na abertura. É a única
   animação de fundo da tela, e ela para — não fica em laço puxando
   atenção enquanto a pessoa digita a senha. */
.auth-contours {
  position: absolute;
  inset: -10% -20%;
  width: 140%;
  height: 120%;
  pointer-events: none;
}
.auth-contours path {
  fill: none;
  stroke: rgba(255,255,255,.20);
  stroke-width: 1.25;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: auth-traca 2.6s var(--auth-ease) forwards;
}
@keyframes auth-traca { to { stroke-dashoffset: 0; } }
@keyframes auth-entra {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes auth-sobe {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* O miolo ocupa o espaço livre e centraliza a identidade do município;
   a assinatura do produto fica ancorada embaixo. */
.auth-miolo {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand {
  color: #fff;
}

/* Placa branca: brasão municipal é colorido e some no painel escuro.
   O `max-width`/`max-height` deixa qualquer proporção de brasão caber
   sem distorcer. */
.auth-brand-logo {
  display: block;
  max-height: 88px;
  max-width: 172px;
  width: auto;
  object-fit: contain;
}
.auth-brand-placa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 108px;
  padding: 10px 14px;
  margin-bottom: 26px;
  background: #fff;
  border-radius: var(--auth-r-lg);
  box-shadow: 0 2px 8px rgba(26,30,28,.25);
  animation: auth-entra .7s var(--auth-ease) both;
}
/* Sem `site_config.logo` a placa mostra o espaço reservado, tracejado,
   em vez de um ícone genérico fingindo ser brasão. */
.auth-brand-vazia {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 88px;
  border: 1px dashed var(--auth-line);
  border-radius: var(--auth-r-md);
  color: var(--auth-muted);
}
.auth-brand-vazia span {
  font-family: var(--auth-font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-brand-title {
  font-family: var(--auth-font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 12px;
  line-height: 1.18;
  max-width: 15ch;
  text-wrap: balance;
  animation: auth-entra .7s var(--auth-ease) .08s both;
}

.auth-brand-sub {
  font-size: 15.5px;
  color: rgba(255,255,255,.78);
  line-height: 1.6;
  max-width: 34ch;
  margin: 0;
  animation: auth-entra .7s var(--auth-ease) .16s both;
}

/* Tags — o que o sistema faz, em uma linha */
.auth-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  animation: auth-entra .7s var(--auth-ease) .24s both;
}
.auth-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  letter-spacing: .01em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.88);
  transition: background 180ms var(--auth-ease), transform 180ms var(--auth-ease);
}
.auth-tag:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }

/* ── Assinatura do produto ───────────────────────────────────────
   O símbolo é o marco geodésico: placa quadrada, cruz de eixos e ponto
   central — o mesmo elemento de assinatura da tela Meu perfil. */
.auth-assinatura {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.14);
  animation: auth-entra .7s var(--auth-ease) .32s both;
}
.auth-simbolo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.09);
  border-radius: 4px;
  color: #fff;
}
.auth-assinatura-nome {
  display: block;
  font-family: var(--auth-font-display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: rgba(255,255,255,.92);
  margin: 0;
  line-height: 1.2;
}
.auth-datum {
  display: block;
  font-family: var(--auth-font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  /* .72 e não .42: a .42 dava 2,7:1 sobre o painel e a .66 parava em 4,29:1;
     como é texto de 10px, o piso é 4,5:1. */
  color: rgba(255,255,255,.72);
  margin: 3px 0 0;
}

/* Só existe abaixo de 768px — ver o bloco responsivo no fim. */
.auth-assinatura-movel { display: none; }

/* ── Painel direito — formulário ─────────────────────────────── */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--auth-paper);
  overflow-y: auto;
}

.auth-form-box {
  width: 100%;
  max-width: 428px;
  background: #fff;
  border: 1px solid var(--auth-line-soft);
  border-radius: var(--auth-r-card);
  box-shadow: 0 8px 32px rgba(42,50,45,.14);
  padding: 40px 40px 32px;
  animation: auth-sobe .6s var(--auth-ease) both;
}

.auth-form-box h1,
.auth-form-box h2 {
  font-family: var(--auth-font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--auth-ink);
  margin: 0 0 6px;
  text-wrap: balance;
}

.auth-form-box .auth-subtitle {
  font-size: 14px;
  color: var(--auth-muted);
  line-height: 1.55;
  margin: 0 0 28px;
}

/* Entrada escalonada dos blocos do formulário. Aplicada por classe e
   não por `:nth-child` para não depender da ordem que cada tela usa. */
.auth-reveal-1 { animation: auth-entra .5s var(--auth-ease) .10s both; }
.auth-reveal-2 { animation: auth-entra .5s var(--auth-ease) .16s both; }
.auth-reveal-3 { animation: auth-entra .5s var(--auth-ease) .22s both; }
.auth-reveal-4 { animation: auth-entra .5s var(--auth-ease) .28s both; }
.auth-reveal-5 { animation: auth-entra .5s var(--auth-ease) .34s both; }

/* ── Variante ampla ──────────────────────────────────────────────
   O cadastro tem cinco campos e o medidor de senha; no cartão de 428px
   ele vira uma coluna comprida que não cabe na dobra. A variante encolhe
   o painel de identidade e alarga o formulário, e os campos que andam em
   par passam a dividir a linha.

   É modificador e não mudança na base de propósito: o login tem dois
   campos, e alargar o cartão dele deixaria a linha de leitura longa
   demais para o que ele pede. */
.auth-wrapper--amplo .auth-form-box { max-width: 620px; }

.auth-dupla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
/* Abaixo disto as duas colunas ficam estreitas demais para o rótulo e o
   valor conviverem — empilha antes de apertar. */
@media (max-width: 620px) {
  .auth-dupla { grid-template-columns: minmax(0, 1fr); }
}

/* ── Controles de formulário ─────────────────────────────────────
   A borda vive no `.input-group`, não em cada peça: o ícone deixa de
   ser uma caixa cinza colada ao campo e passa a ser um ícone dentro do
   campo. Signup, recuperação e alteração de dados herdam isso sem
   mudar uma linha de markup. */
.auth-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--auth-ink-soft);
  margin-bottom: 7px;
}

.form-control {
  padding: .65rem 1rem;
  border-radius: var(--auth-r-md);
  background-color: #fff;
  border: 1px solid var(--auth-line);
  color: var(--auth-ink);
  font-size: 14px;
  transition: border-color .14s var(--auth-ease), box-shadow .22s var(--auth-ease);
}
.form-control::placeholder { color: var(--auth-icon); }
.form-control:focus {
  background-color: #fff;
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-brand) 20%, transparent);
  outline: none;
  color: var(--auth-ink);
}

.input-group {
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-r-md);
  transition: border-color .14s var(--auth-ease), box-shadow .22s var(--auth-ease);
}
.input-group:hover { border-color: #8a847a; }
.input-group:focus-within {
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-brand) 20%, transparent);
}

.input-group > .input-group-text {
  border: 0;
  background: transparent;
  color: var(--auth-icon);
  padding-left: 12px;
  padding-right: 4px;
  transition: color .14s var(--auth-ease);
}
.input-group:focus-within > .input-group-text { color: var(--auth-brand); }

.input-group > .form-control {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-left: 8px;
  min-height: 44px;
}
.input-group > .form-control:focus {
  box-shadow: none;
  background: transparent;
}
.input-group > .form-control:first-child { padding-left: 14px; }

/* Botão de mostrar/ocultar senha, dentro da caixa */
.input-group > .btn-olho {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  /* A margem vertical de 2px comia a altura: o campo tem 44px, o botão ficava
     com 40 e o alvo caía abaixo do piso. A margem agora é só lateral, e o
     `min-height` garante o piso mesmo se o campo encolher. */
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--auth-icon);
  border-radius: var(--auth-r-sm);
  margin: 0 2px;
  transition: color .14s var(--auth-ease), background .14s var(--auth-ease);
}
.input-group > .btn-olho:hover { color: var(--auth-brand); background: var(--auth-paper-mid); }
.input-group > .btn-olho:focus-visible {
  outline: 2px solid var(--auth-brand);
  outline-offset: -2px;
}

/* Token 2FA: seis dígitos são dado, não frase — mono, largo e centrado. */
.auth-token-input {
  font-family: var(--auth-font-mono) !important;
  font-size: 20px !important;
  letter-spacing: .34em;
  text-align: center;
  text-indent: .34em; /* compensa o espaço que o letter-spacing põe à direita */
}

/* ── Apoio do formulário ─────────────────────────────────────── */
.auth-dica {
  font-size: 12.5px;
  color: var(--auth-muted);
  margin: 7px 0 0;
}
.auth-erro {
  font-size: 12.5px;
  color: #7a2020;
  margin: 7px 0 0;
}

.auth-linha-esqueci {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 22px;
}
.auth-linha-esqueci a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  padding: 0 2px;
}

/* Caminho alternativo (código de reserva ↔ token do aplicativo).
   É ação secundária: peso de link, não de botão. */
.auth-alternativa {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--auth-line-soft);
  text-align: center;
}
.auth-alternativa .btn-link {
  color: var(--auth-link);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--auth-r-sm);
}
.auth-alternativa .btn-link:hover {
  color: var(--auth-brand);
  text-decoration: underline;
}
.auth-alternativa .btn-link:focus-visible {
  outline: 2px solid var(--auth-brand);
  outline-offset: 2px;
}

/* O alerta do Bootstrap vem vermelho-framework; aqui ele usa o par de
   erro do Terreno Firme. */
.alert-danger {
  background-color: #f5dcdc;
  border: 1px solid #e0bfbf;
  color: #7a2020;
  border-radius: var(--auth-r-md);
  margin-bottom: 20px;
}

/* ── Seis casas do token ─────────────────────────────────────────
   O código não é uma frase, é um dado de seis dígitos, e a forma do campo
   diz isso antes de qualquer instrução. Nasce escondido: quem revela é o
   script, depois de esconder o campo único que continua sendo o que vai
   no POST. */
.token-casas { display: flex; gap: 10px; }
.token-casas[hidden] { display: none; }
.token-casas input {
  width: 100%;
  min-width: 0;
  height: 56px;
  text-align: center;
  font-family: var(--auth-font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-r-md);
  outline: none;
  transition: border-color .14s var(--auth-ease), box-shadow .22s var(--auth-ease),
              transform .14s var(--auth-ease), background .14s var(--auth-ease);
}
.token-casas input:hover { border-color: #8a847a; }
.token-casas input:focus {
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-brand) 20%, transparent);
  transform: translateY(-1px);
}
/* A casa preenchida assenta: um pulso curto de escala, uma vez, no dígito
   que acabou de entrar. É o retorno de que a tecla valeu — sem ele, digitar
   seis dígitos em caixas separadas é um ato às cegas. */
.token-casas input.cheia {
  border-color: var(--auth-brand);
  background: color-mix(in srgb, var(--auth-brand) 5%, #fff);
  animation: token-assenta 220ms var(--auth-ease);
}
@keyframes token-assenta {
  0%   { transform: scale(.9); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Volta do servidor com código recusado: as casas tremem uma vez e ficam
   vermelhas. A recusa vem do servidor, então a animação toca no carregamento
   da página seguinte — é o único momento em que existe resposta para animar. */
.token-casas[data-erro="sim"] { animation: token-treme 400ms ease-in-out; }
.token-casas[data-erro="sim"] input { border-color: #9a4040; }
@keyframes token-treme {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50%      { transform: translateX(-4px); }
}

/* Enquanto o servidor confere: as casas travam e esmaecem, e o botão vira
   "Verificando". Sem isso o clique não tem resposta até a página trocar. */
.token-casas.conferindo input {
  opacity: .55;
  border-color: var(--auth-line);
  background: var(--auth-paper-mid);
}
.token-giro {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #fff;
  animation: token-gira .7s linear infinite;
  vertical-align: -3px;
}
@keyframes token-gira { to { transform: rotate(360deg); } }

/* O campo único fica no DOM — é ele que vai no POST — mas sai da vista.
   `opacity` e não `display:none` de propósito: campo `required` escondido
   com `display:none` faz o navegador recusar o envio sem dizer o porquê,
   porque não consegue focar o que não existe na renderização. */
.input-group[data-token-original].token-oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

@media (max-width: 768px) {
  .token-casas { gap: 7px; }
  .token-casas input { height: 52px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .token-casas input,
  .token-casas input.cheia,
  .token-casas[data-erro="sim"],
  .token-giro {
    animation: none !important;
    transition: none;
  }
  .token-casas input:focus { transform: none; }
}

/* ── Botão principal ─────────────────────────────────────────── */
.btn-custom {
  background-color: var(--auth-brand);
  color: #fff;
  min-height: 46px;
  padding: .7rem 1rem;
  border-radius: var(--auth-r-md);
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  border: none;
  transition: background-color .14s var(--auth-ease), transform .14s var(--auth-ease), box-shadow .22s var(--auth-ease);
  letter-spacing: .01em;
}
.btn-custom:hover {
  background-color: var(--auth-brand-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--auth-brand) 32%, transparent);
}
.btn-custom:active {
  background-color: var(--auth-brand-hover);
  transform: translateY(0);
  box-shadow: none;
}
/* `outline` transparente e não `none`: no modo de alto contraste do
   sistema a `box-shadow` some, e sem isto o foco desapareceria. */
.btn-custom:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--auth-brand) 85%, transparent);
}

.btn-outline-secondary,
.btn-outline-primary {
  border-radius: var(--auth-r-md);
  border: 1px solid var(--auth-line);
  background-color: #fff;
  color: var(--auth-ink-soft);
  min-height: 44px;
  padding: .5rem 1rem;
  font-size: 14px;
  font-weight: 500;
  transition: background .14s var(--auth-ease), border-color .14s var(--auth-ease), color .14s var(--auth-ease);
}
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
  background-color: color-mix(in srgb, var(--auth-brand) 5%, #fff);
  border-color: var(--auth-brand);
  color: var(--auth-ink);
}
.btn-outline-secondary:focus-visible,
.btn-outline-primary:focus-visible {
  outline: 2px solid var(--auth-brand);
  outline-offset: 2px;
}

/* Aviso de apoio dentro do cartão — o que o alert-info do Bootstrap era. */
.auth-aviso {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--auth-paper-mid);
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-r-md);
  padding: 12px 14px;
  margin-bottom: 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--auth-ink-soft);
}
.auth-aviso i { color: var(--auth-icon); margin-top: 1px; }

/* Separa "confirme quem você é" de "escolha a senha nova". */
.auth-separador {
  border: 0;
  border-top: 1px solid var(--auth-line-soft);
  margin: 22px 0;
  opacity: 1;
}

/* ── Chip de ícone do cabeçalho do cartão ────────────────────────
   Substitui o círculo com `style=` inline que quatro telas repetiam.
   Quadrado de canto suave, e não círculo: círculo é foto de pessoa. */
.auth-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: var(--auth-r-md);
  background: color-mix(in srgb, var(--auth-brand) 18%, #fff);
  color: var(--auth-brand-hover);
  font-size: 22px;
}

/* ── Etapas do cadastro ──────────────────────────────────────────
   A trilha e os botões de navegação nascem com `hidden` no HTML e só
   aparecem quando o script assume: sem JavaScript as duas seções ficam
   visíveis e o cadastro continua um formulário só. */
.auth-passos {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  font-size: 12.5px;
  color: var(--auth-muted);
}
.auth-passo { display: flex; align-items: center; gap: 8px; }
.auth-passo + .auth-passo::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--auth-line);
  margin-right: 2px;
}
.auth-passo-num {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  font-size: 11px;
}
.auth-passo[data-atual] { color: var(--auth-ink); font-weight: 600; }
.auth-passo[data-atual] .auth-passo-num {
  border-color: var(--auth-brand);
  border-width: 2px;
  color: var(--auth-brand);
}
.auth-passo[data-feito] .auth-passo-num {
  background: var(--auth-brand);
  border-color: var(--auth-brand);
  color: #fff;
}

.auth-secao[hidden] { display: none; }

.auth-acoes { display: flex; gap: 10px; margin-top: 8px; }
.auth-acoes--fim { margin-top: 22px; }
/* O botão principal é `width: 100%` por padrão; na linha com o Voltar ele
   divide o espaço em vez de empurrar o vizinho para fora. */
.auth-acoes .btn-custom { width: auto; flex: 1; }
.auth-acoes .btn-outline-secondary { flex-shrink: 0; }

/* ── Links ───────────────────────────────────────────────────── */
.auth-links {
  font-size: 13px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--auth-line-soft);
  text-align: center;
  color: var(--auth-muted);
}
.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  text-decoration: none;
  color: var(--auth-link);
  font-weight: 600;
}
.auth-links a:hover { text-decoration: underline; }

a { color: var(--auth-link); }
a:hover { color: var(--auth-brand); }
a:focus-visible {
  outline: 2px solid var(--auth-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Misc ────────────────────────────────────────────────────── */
.required::after { content: " *"; color: #9a4040; }
.invalid-tooltip-custom { display: none; }

/* Label acessível invisível — eMAG/WCAG (placeholder não substitui label) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Divisor */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--auth-muted);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 22px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-line);
}


/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .auth-left { padding: 40px 28px 24px; }
  .auth-brand-title { font-size: 22px; }
  .auth-brand-placa { min-width: 168px; min-height: 92px; }
}

@media (max-width: 768px) {
  .auth-wrapper { flex-direction: column; }

  /* Identidade vira faixa compacta no topo — brasão e nome continuam
     visíveis; o resto do painel sai para a dobra não engolir o campo. */
  .auth-left {
    width: 100%;
    padding: 20px 20px 18px;
  }
  .auth-miolo { flex: none; }
  .auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .auth-brand-placa {
    min-width: 92px;
    min-height: 60px;
    padding: 6px 8px;
    margin-bottom: 0;
    border-radius: var(--auth-r-md);
    flex-shrink: 0;
  }
  .auth-brand-logo { max-height: 46px; max-width: 76px; }
  .auth-brand-vazia { min-height: 46px; }
  .auth-brand-vazia span { display: none; }
  .auth-brand-title { font-size: 15.5px; margin: 0; max-width: none; }
  .auth-wrapper--amplo .auth-left { width: 100%; }
  .auth-brand-sub, .auth-tags, .auth-contours { display: none; }
  .auth-assinatura { display: none; }

  .auth-wrapper { min-height: 100dvh; }
  .auth-left  { order: 1; }
  .auth-right { order: 2; padding: 24px 20px 28px; align-items: flex-start; }

  .auth-assinatura-movel {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 32px;
    background: var(--auth-paper);
  }
  .auth-simbolo-claro {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-brand);
    box-shadow: inset 0 0 0 3px var(--auth-paper), inset 0 0 0 4px color-mix(in srgb, var(--auth-brand) 25%, transparent);
    border-radius: 4px;
    color: var(--auth-brand-hover);
  }
  .auth-assinatura-movel .auth-assinatura-nome { color: var(--auth-ink-soft); font-size: 14px; }
  .auth-assinatura-movel .auth-datum { color: var(--auth-icon); }
  .auth-form-box {
    max-width: 100%;
    padding: 28px 22px 24px;
    border-radius: var(--auth-r-lg);
    box-shadow: 0 2px 8px rgba(42,50,45,.10);
  }
  /* 16px é o piso que impede o iOS de dar zoom ao focar o campo. */
  .input-group > .form-control { font-size: 16px; min-height: 48px; }
  .btn-custom { min-height: 50px; font-size: 15.5px; }
}

/* ── Movimento reduzido ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .auth-contours path,
  .auth-brand-placa, .auth-brand-title, .auth-brand-sub, .auth-tags, .auth-assinatura,
  .auth-form-box,
  .auth-reveal-1, .auth-reveal-2, .auth-reveal-3, .auth-reveal-4, .auth-reveal-5 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .form-control, .input-group, .btn-custom, .btn-outline-secondary, .btn-outline-primary { transition: none; }
  .btn-custom:hover, .auth-tag:hover { transform: none; }
}

/* ── Solicitação de acesso ─────────────────────────────────────────────
   O formulário do pedido é o mais longo das telas de acesso: são dados
   funcionais, não credencial. Ganha título por seção para que a leitura tenha
   onde descansar, e marcação explícita do que é opcional — servidor que não
   sabe a secretaria não pode travar no campo. */

/* Escopado em `.auth-form-box` de propósito: `.auth-form-box h2` já existe
   neste arquivo com 26px, e classe+elemento vence classe sozinha. Sem o
   escopo, esta regra perde o `font-size` e o `font-weight` calada — o título
   de seção sai do tamanho do título da tela. */
.auth-form-box .auth-secao-titulo {
  font-family: var(--auth-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--auth-muted);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--auth-line-soft);
}

/* "(opcional)" fica junto do rótulo, não em texto de apoio abaixo: o servidor
   decide pular o campo ao ler o nome dele, não depois de preencher. */
.auth-opcional {
  font-weight: 400;
  color: var(--auth-muted);
}

.auth-ajuda {
  font-size: 12.5px;
  color: var(--auth-ink-soft);
  margin: 7px 0 0;
}

/* Lista numerada do que acontece depois do envio. Distinta de `.auth-passos`,
   que é o indicador HORIZONTAL de etapa do formulário — nomes parecidos,
   papéis opostos. */
.auth-lista-passos {
  margin: 0 0 4px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--auth-ink-soft);
}
.auth-lista-passos li { margin-bottom: 8px; }
.auth-lista-passos li::marker { color: var(--auth-brand); font-weight: 600; }
