/* =====================================================================
   Autenticação (login, esqueci a senha, nova senha) — mesma linguagem da
   home e do rastreamento: tokens --hm-*, vidro fosco, Plus Jakarta Sans.
   Mobile first; o tema segue html[data-bs-theme].
   ===================================================================== */

:root {
  --au-acc: #4f46e5;
  --au-acc2: #0891b2;
  --au-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --au-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --au-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Claro (padrão) */
  --au-bg: #eef0fb;
  --au-ink: #12142b;
  --au-muted: #585d78;
  --au-b1: #818cf8;
  --au-b2: #67e8f9;
  --au-b3: #c4b5fd;
  --au-b4: #93c5fd;
  --au-blob-op: 0.75;
  --au-glass: rgba(255, 255, 255, 0.62);
  --au-glass-line: rgba(255, 255, 255, 0.9);
  --au-glass-hi: rgba(255, 255, 255, 0.95);
  --au-shadow: rgba(18, 20, 43, 0.28);
  --au-fld: rgba(255, 255, 255, 0.78);
  --au-fld-line: #dfe2f1;
  --au-fld-ink: #6b7090;
  --au-focus: #4f46e5;
  --au-link: #4338ca;
  --au-danger: #b42318;
  --au-danger-b: #fee4e2;
  --au-ok: #067647;
  --au-ok-b: #dcfae6;
  --au-warn: #b54708;
  --au-track: #e4e6f2;

  color-scheme: light;
}

[data-bs-theme="dark"] {
  --au-bg: #0b0d1c;
  --au-ink: #f1f2fa;
  --au-muted: #b6bad6;
  --au-b1: #4f46e5;
  --au-b2: #06b6d4;
  --au-b3: #7c3aed;
  --au-b4: #1d4ed8;
  --au-blob-op: 0.7;
  --au-glass: rgba(21, 24, 51, 0.5);
  --au-glass-line: rgba(255, 255, 255, 0.12);
  --au-glass-hi: rgba(255, 255, 255, 0.08);
  --au-shadow: rgba(0, 0, 0, 0.75);
  --au-fld: rgba(255, 255, 255, 0.06);
  --au-fld-line: rgba(255, 255, 255, 0.13);
  --au-fld-ink: #a9aecb;
  --au-focus: #8b8cff;
  --au-link: #a5b4fc;
  --au-danger: #fda29b;
  --au-danger-b: rgba(240, 68, 56, 0.16);
  --au-ok: #6ce9a6;
  --au-ok-b: rgba(18, 183, 106, 0.16);
  --au-warn: #fec84b;
  --au-track: rgba(255, 255, 255, 0.1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--au-bg);
  color: var(--au-ink);
  font-family: var(--au-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.5s var(--au-ease), color 0.5s var(--au-ease);
}

/* ------------------------------------------------------------- Aurora */

.au-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Parallax leve do ponteiro (só desktop, via auth-ui.js). */
  transform: translate3d(var(--au-px, 0), var(--au-py, 0), 0);
  transition: transform 1.2s var(--au-ease);
}

/* Manchas em gradiente radial: bordas suaves sem filter: blur, que pesa no celular. */
.au-blob {
  position: absolute;
  border-radius: 50%;
  opacity: var(--au-blob-op);
  will-change: transform;
  transition: opacity 0.8s var(--au-ease);
}

.au-blob--1 {
  width: 120vmax;
  height: 120vmax;
  left: -50vmax;
  top: -60vmax;
  background: radial-gradient(closest-side, var(--au-b1), transparent);
  animation: au-drift-1 22s ease-in-out infinite alternate;
  animation-delay: var(--au-clock, 0s);
}

.au-blob--2 {
  width: 100vmax;
  height: 100vmax;
  right: -55vmax;
  top: -15vmax;
  background: radial-gradient(closest-side, var(--au-b2), transparent);
  animation: au-drift-2 26s ease-in-out infinite alternate;
  animation-delay: var(--au-clock, 0s);
}

.au-blob--3 {
  width: 110vmax;
  height: 110vmax;
  left: -20vmax;
  bottom: -75vmax;
  background: radial-gradient(closest-side, var(--au-b3), transparent);
  animation: au-drift-3 30s ease-in-out infinite alternate;
  animation-delay: var(--au-clock, 0s);
}

.au-blob--4 {
  display: none;
  width: 70vmax;
  height: 70vmax;
  right: -15vmax;
  bottom: -40vmax;
  background: radial-gradient(closest-side, var(--au-b4), transparent);
  animation: au-drift-1 24s ease-in-out infinite alternate-reverse;
  animation-delay: var(--au-clock, 0s);
}

@keyframes au-drift-1 {
  to { transform: translate3d(18vmax, 22vmax, 0) scale(1.12) rotate(18deg); }
}

@keyframes au-drift-2 {
  to { transform: translate3d(-22vmax, 18vmax, 0) scale(0.9) rotate(-22deg); }
}

@keyframes au-drift-3 {
  to { transform: translate3d(14vmax, -20vmax, 0) scale(1.15); }
}

/* Aba em segundo plano: a aurora para (auth-ui.js liga a classe). */
.au-paused .au-blob {
  animation-play-state: paused;
}

/* Login aceito: a aurora acende enquanto o card sai. */
.au-leaving .au-blob {
  opacity: 1;
}

/* --------------------------------------------------------- Botão tema */

.au-theme {
  position: fixed;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--au-glass-line);
  background: var(--au-glass);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  backdrop-filter: saturate(170%) blur(16px);
  color: var(--au-ink);
  cursor: pointer;
  box-shadow: 0 8px 24px -14px var(--au-shadow);
  transition: transform 0.25s var(--au-spring), background-color 0.5s, border-color 0.5s;
}

.au-theme:hover {
  transform: translateY(-1px) scale(1.04);
}

.au-theme:active {
  transform: scale(0.94);
}

.au-theme svg {
  position: absolute;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s var(--au-spring), opacity 0.3s var(--au-ease);
}

.au-theme__sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

[data-bs-theme="dark"] .au-theme__sun {
  opacity: 1;
  transform: none;
}

[data-bs-theme="dark"] .au-theme__moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

/* --------------------------------------------------------------- Card */

.au-shell {
  position: relative;
  z-index: 1;
  display: grid;
  /* minmax(0, 1fr): a coluna não cresce até a largura do texto em telas estreitas. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(72px, calc(env(safe-area-inset-top) + 64px))
    max(16px, env(safe-area-inset-right))
    max(24px, calc(env(safe-area-inset-bottom) + 16px))
    max(16px, env(safe-area-inset-left));
}

.au-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 22px 24px;
  border-radius: 28px;
  border: 1px solid var(--au-glass-line);
  background: var(--au-glass);
  -webkit-backdrop-filter: saturate(170%) blur(24px);
  backdrop-filter: saturate(170%) blur(24px);
  box-shadow: 0 1px 0 var(--au-glass-hi) inset, 0 30px 60px -30px var(--au-shadow), 0 2px 8px -2px rgba(18, 20, 43, 0.08);
  isolation: isolate;
  transition: background-color 0.5s var(--au-ease), border-color 0.5s var(--au-ease), box-shadow 0.5s var(--au-ease);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .au-card {
    background: color-mix(in srgb, var(--au-bg) 92%, #ffffff);
  }
}

/* Brilho que segue o ponteiro (desktop). */
.au-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--au-mx, 50%) var(--au-my, -20%), color-mix(in srgb, var(--au-focus) 14%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--au-ease);
  pointer-events: none;
}

.au-card:hover::before {
  opacity: 1;
}

.au-card.is-shaking,
.au-card.au-enter.is-shaking {
  animation: au-shake 0.42s var(--au-ease);
}

@keyframes au-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.au-leaving .au-card,
.au-leaving .au-card.au-enter {
  animation: au-card-out 0.55s var(--au-ease) forwards;
}

@keyframes au-card-out {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); filter: blur(4px); }
}

/* Entrada escalonada: cada item recebe style="--i:n". */
.au-enter {
  animation: au-in 0.6s var(--au-ease) both;
  animation-delay: calc(var(--i, 0) * 60ms + 80ms);
}

.au-card.au-enter {
  animation: au-card-in 0.7s var(--au-spring) both;
}

@keyframes au-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes au-card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
}

/* ------------------------------------- Navegação entre telas de acesso */
/*
 * Login ↔ esqueci a senha ↔ nova senha: card e logo ficam parados (o card só
 * ajusta a altura, via auth-ui.js) e o conteúdo desliza no sentido da
 * navegação. Ida: sai pela esquerda e entra pela direita; volta: o inverso.
 */
.au-nav-forward { --au-dir: 1; }
.au-nav-back { --au-dir: -1; }

.au-nav-out .au-card > :not(.au-logo) {
  animation: au-slide-out 0.24s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

.au-nav-in .au-card.au-enter,
.au-nav-in .au-logo.au-enter {
  animation: none;
}

.au-nav-in .au-enter {
  animation-name: au-slide-in;
  animation-duration: 0.5s;
  animation-timing-function: var(--au-ease);
  animation-delay: calc(var(--i, 0) * 35ms + 60ms);
}

@keyframes au-slide-out {
  to { opacity: 0; transform: translate3d(calc(var(--au-dir, 1) * -32px), 0, 0); }
}

@keyframes au-slide-in {
  from { opacity: 0; transform: translate3d(calc(var(--au-dir, 1) * 40px), 0, 0); }
}

/* --------------------------------------------------------- Cabeçalho */

.au-logo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 14px;
}

.au-logo img {
  display: block;
  /* unic-login-logo.svg: quadrado, com o anel em volta do cubo. */
  width: 72px;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(29, 78, 216, 0.3));
}

.au-logo__word {
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--au-ink);
}

[data-bs-theme="light"] .au-logo__word {
  color: #1e2f5c;
}

/* Selo de homologação: linha própria, abaixo do logo. */
.au-badge {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
}

.au-badge span {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--au-danger-b);
  color: var(--au-danger);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.au-title {
  margin: 22px 0 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-align: center;
}

.au-sub {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--au-muted);
  text-align: center;
}

/* Subtítulo logo abaixo do logo (login, sem título). */
.au-logo + .au-sub {
  margin-top: 16px;
}

.au-sub strong {
  color: var(--au-ink);
  font-weight: 700;
}

/* --------------------------------------------------------------- Form */

.au-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.au-field {
  position: relative;
}

.au-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--au-fld-line);
  background: var(--au-fld);
  color: var(--au-fld-ink);
  transition: border-color 0.2s var(--au-ease), box-shadow 0.2s var(--au-ease), background-color 0.5s var(--au-ease);
}

.au-input-wrap:focus-within {
  border-color: var(--au-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--au-focus) 22%, transparent);
  color: var(--au-ink);
}

.au-field.is-invalid .au-input-wrap {
  border-color: var(--au-danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--au-danger) 18%, transparent);
}

.au-field.is-valid .au-input-wrap {
  border-color: color-mix(in srgb, var(--au-ok) 60%, var(--au-fld-line));
}

.au-input-wrap > .au-ico {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.au-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 18px 14px 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--au-ink);
  /* 16px evita o zoom automático do iOS ao focar. */
  font: 600 16px/1.2 var(--au-font);
  border-radius: 16px;
}

.au-input:disabled,
.au-input[readonly] {
  color: var(--au-muted);
}

/* Nome do campo que sobe quando há foco ou valor. */
.au-label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
  font-size: 15px;
  font-weight: 500;
  color: var(--au-fld-ink);
  pointer-events: none;
  transition: transform 0.2s var(--au-ease), color 0.2s var(--au-ease), top 0.2s var(--au-ease);
}

.au-input:focus + .au-label,
.au-input:not(:placeholder-shown) + .au-label {
  top: 15px;
  transform: translateY(-50%) scale(0.76);
  font-weight: 700;
  color: var(--au-focus);
}

.au-input:not(:focus):not(:placeholder-shown) + .au-label {
  color: var(--au-fld-ink);
}

/* Autofill do navegador: mantém o visual de vidro. */
.au-input:-webkit-autofill {
  -webkit-text-fill-color: var(--au-ink);
  transition: background-color 9999s ease-out 0s;
}

.au-input:-webkit-autofill + .au-label {
  top: 15px;
  transform: translateY(-50%) scale(0.76);
}

.au-eye {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0 16px 16px 0;
  background: transparent;
  color: var(--au-fld-ink);
  cursor: pointer;
}

.au-eye svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--au-spring);
}

.au-eye:active svg {
  transform: scale(0.85);
}

.au-hint {
  margin: 6px 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--au-danger);
  min-height: 0;
}

.au-hint:empty {
  display: none;
}

/* Etiqueta CPF/CNPJ: mostra o tipo detectado enquanto digita. */
.au-doc-tag {
  flex: none;
  margin-right: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--au-focus) 14%, transparent);
  color: var(--au-link);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  animation: au-pop 0.35s var(--au-spring);
}

/* Medidor de força da senha. */
.au-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 4px 0;
}

.au-meter span {
  height: 5px;
  border-radius: 9px;
  background: var(--au-track);
  transition: background-color 0.3s var(--au-ease), transform 0.3s var(--au-spring);
}

.au-meter[data-level="1"] span:nth-child(-n + 1) { background: #f04438; }
.au-meter[data-level="2"] span:nth-child(-n + 2) { background: #f79009; }
.au-meter[data-level="3"] span:nth-child(-n + 3) { background: #0ba5ec; }
.au-meter[data-level="4"] span:nth-child(-n + 4) { background: #12b76a; }

.au-meter-label {
  margin: 6px 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--au-muted);
}

/* ------------------------------------------------- Lembrar matrícula */

.au-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  margin: -4px -4px -2px;
}

.au-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px 0 4px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--au-muted);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.au-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.au-check__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--au-fld-line);
  background: var(--au-fld);
  transition: background-color 0.2s var(--au-ease), border-color 0.2s var(--au-ease), transform 0.25s var(--au-spring);
}

.au-check__box svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.3s var(--au-ease);
}

.au-check:hover .au-check__box {
  border-color: var(--au-focus);
}

.au-check:active .au-check__box {
  transform: scale(0.88);
}

.au-check input:checked + .au-check__box {
  background: var(--au-acc);
  border-color: var(--au-acc);
}

.au-check input:checked + .au-check__box svg {
  stroke-dashoffset: 0;
}

.au-check input:checked ~ .au-check__text {
  color: var(--au-ink);
}

.au-check input:focus-visible + .au-check__box {
  outline: 3px solid var(--au-focus);
  outline-offset: 2px;
}

.au-row .au-link {
  padding: 0 6px;
}

/* -------------------------------------------------------------- Botão */

.au-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  margin-top: 6px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--au-acc), #6366f1 50%, var(--au-acc2));
  background-size: 160% 100%;
  background-position: 0% 0;
  color: #ffffff;
  font: 700 16px/1 var(--au-font);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 28px -12px rgba(79, 70, 229, 0.75);
  transition: transform 0.2s var(--au-spring), box-shadow 0.25s var(--au-ease), background-position 0.5s var(--au-ease), opacity 0.2s;
  text-decoration: none;
}

.au-btn:hover {
  background-position: 100% 0;
  box-shadow: 0 16px 32px -12px rgba(79, 70, 229, 0.85);
}

.au-btn:active {
  transform: scale(0.98);
}

.au-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.au-btn__label,
.au-btn__spin,
.au-btn__ok {
  transition: opacity 0.2s var(--au-ease), transform 0.3s var(--au-spring);
}

.au-btn__spin,
.au-btn__ok {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
}

.au-btn__spin::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: au-spin 0.7s linear infinite;
}

.au-btn__ok svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.au-btn.is-loading,
.au-btn.is-done {
  pointer-events: none;
}

.au-btn.is-loading .au-btn__label,
.au-btn.is-done .au-btn__label {
  opacity: 0;
  transform: translateY(-6px);
}

.au-btn.is-loading .au-btn__spin {
  opacity: 1;
  transform: none;
}

.au-btn.is-done {
  background: linear-gradient(135deg, #079455, #12b76a);
  box-shadow: 0 12px 28px -12px rgba(18, 183, 106, 0.8);
}

.au-btn.is-done .au-btn__ok {
  opacity: 1;
  transform: none;
}

.au-btn.is-done .au-btn__ok svg {
  animation: au-draw 0.45s 0.1s var(--au-ease) forwards;
}

@keyframes au-spin {
  to { transform: rotate(360deg); }
}

@keyframes au-draw {
  to { stroke-dashoffset: 0; }
}

.au-btn--ghost {
  background: var(--au-fld);
  border: 1px solid var(--au-fld-line);
  color: var(--au-ink);
  box-shadow: none;
}

.au-btn--ghost:hover {
  box-shadow: none;
  border-color: var(--au-focus);
}

/* --------------------------------------------------------------- Links */

.au-links {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.au-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--au-link);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s var(--au-ease);
}

.au-link:hover {
  background: color-mix(in srgb, var(--au-focus) 10%, transparent);
}

.au-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--au-spring);
}

.au-link:hover svg {
  transform: translateX(-3px);
}

/* ------------------------------------------------------------- Alertas */

.au-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--au-danger-b);
  color: var(--au-danger);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  animation: au-alert-in 0.35s var(--au-spring);
}

.au-alert[hidden] {
  display: none;
}

.au-alert.is-ok {
  background: var(--au-ok-b);
  color: var(--au-ok);
}

.au-alert svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes au-alert-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

/* Contagem do tempo para trocar a senha. */
.au-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 18px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--au-focus) 12%, transparent);
  color: var(--au-link);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.3s, color 0.3s;
}

.au-timer svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.au-timer.is-low {
  background: color-mix(in srgb, #f79009 16%, transparent);
  color: var(--au-warn);
  animation: au-pulse 1s ease-in-out infinite;
}

@keyframes au-pulse {
  50% { opacity: 0.6; }
}

/* Estado "tempo esgotado" e "senha alterada". */
.au-state {
  text-align: center;
  padding: 8px 0 4px;
}

.au-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 18px auto 4px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--au-focus) 14%, transparent);
  color: var(--au-link);
  animation: au-pop 0.6s var(--au-spring) both 0.1s;
}

.au-state__icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.au-state--ok .au-state__icon {
  background: var(--au-ok-b);
  color: var(--au-ok);
}

.au-state--ok .au-state__icon svg {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: au-draw 0.5s 0.35s var(--au-ease) forwards;
}

@keyframes au-pop {
  from { opacity: 0; transform: scale(0.5) rotate(-12deg); }
}

.au-state .au-title {
  margin-top: 14px;
}

[hidden] {
  display: none !important;
}

/* Troca de tema com revelação circular: só a raiz participa da transição. */
.au-theme-switching *,
.au-theme-switching *::before,
.au-theme-switching *::after {
  transition: none !important;
}

html.au-theme-switching::view-transition-old(root),
html.au-theme-switching::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Acessibilidade */
:focus-visible {
  outline: 3px solid var(--au-focus);
  outline-offset: 2px;
}

.au-input:focus-visible {
  outline: 0;
}

.au-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* -------------------------------------------------------------- Splash */
/*
 * Login aceito: ondas nas cores da empresa sobem em camadas e a última tem
 * a cor de fundo da home (--hm-bg), que abre por baixo sem corte.
 */

:root {
  /* Cores sólidas: com transparência a aurora vaza e marca a emenda da crista. */
  --au-w1: #f5ec4d;
  --au-w2: #3dedc0;
  --au-w3: #38bdf0;
  --au-w4: #004272;
  --au-w5: #f3f4fb;
  --au-splash-ink: #1e2f5c;
}

[data-bs-theme="dark"] {
  --au-w1: #e8e000;
  --au-w2: #00dba4;
  --au-w3: #00a6d6;
  --au-w4: #004272;
  --au-w5: #0b0d1c;
  --au-splash-ink: #f1f2fa;
}

.au-splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

.au-splashing .au-splash {
  visibility: visible;
  pointer-events: auto;
}

.au-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 130vh;
  height: 130dvh;
  transform: translate3d(0, 105vh, 0);
  will-change: transform;
}

/* Corpo sólido abaixo da crista. */
.au-wave::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(16vh - 2px);
  bottom: 0;
  background: var(--au-wave-c);
}

.au-wave__crest {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 16vh;
  fill: var(--au-wave-c);
  overflow: visible;
}

.au-wave__crest use {
  animation: au-wave-sway 2.4s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite alternate;
}

.au-wave--1 { --au-wave-c: var(--au-w1); }
.au-wave--2 { --au-wave-c: var(--au-w2); }
.au-wave--3 { --au-wave-c: var(--au-w3); }
.au-wave--4 { --au-wave-c: var(--au-w4); }
.au-wave--5 { --au-wave-c: var(--au-w5); }

.au-wave--2 .au-wave__crest use { animation-duration: 2s; animation-delay: -0.6s; }
.au-wave--3 .au-wave__crest use { animation-duration: 2.8s; animation-delay: -1.2s; }
.au-wave--4 .au-wave__crest use { animation-duration: 2.2s; animation-delay: -0.3s; }
.au-wave--5 .au-wave__crest use { animation-duration: 3s; animation-delay: -1.6s; }

@keyframes au-wave-sway {
  from { transform: translate3d(-90px, 0, 0); }
  to { transform: translate3d(85px, 0, 0); }
}

.au-splashing .au-wave {
  animation: au-wave-rise 0.95s cubic-bezier(0.65, 0, 0.25, 1) forwards;
}

.au-splashing .au-wave--2 { animation-delay: 0.08s; }
.au-splashing .au-wave--3 { animation-delay: 0.16s; }
.au-splashing .au-wave--4 { animation-delay: 0.24s; }
.au-splashing .au-wave--5 { animation-delay: 0.34s; }

@keyframes au-wave-rise {
  to { transform: translate3d(0, -18vh, 0); }
}

.au-splash__brand {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  opacity: 0;
}

.au-splash__logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.au-splash__brand img {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(29, 78, 216, 0.35));
}

.au-splash__word {
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--au-splash-ink);
}

/* Carregando discreto: fica enquanto a home abre. */
.au-splash__bar {
  position: relative;
  width: 140px;
  height: 4px;
  border-radius: 9px;
  overflow: hidden;
  background: color-mix(in srgb, var(--au-splash-ink) 12%, transparent);
}

.au-splash__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00ebb0, #00c8eb, #f0f000);
  animation: au-bar 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes au-bar {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

.au-splashing .au-splash__brand {
  animation: au-brand-in 0.6s var(--au-spring) 0.85s forwards;
}

.au-splashing .au-splash__brand img {
  animation: au-brand-cube 0.8s var(--au-spring) 0.85s both;
}

@keyframes au-brand-in {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes au-brand-cube {
  from { transform: rotate(-30deg) scale(0.6); }
}

/* No splash a aurora e o card ficam por baixo; sem brilho extra. */
.au-splashing .au-blob {
  opacity: var(--au-blob-op);
}

/* --------------------------------------------------------- Splash saída */
/*
 * Logout: a tela abre na cor da home (--au-w5) com logo e mensagem; as
 * ondas descem de cima (crista virada para baixo) e a última tem a cor de
 * fundo do login (--au-bg), que abre em seguida.
 */

.au-splash--out {
  visibility: visible;
  background: var(--au-w5);
}

.au-splash--out .au-splash__brand {
  z-index: 0;
  opacity: 1;
  animation: au-brand-in 0.5s var(--au-spring) both;
}

.au-splash--out .au-splash__brand img {
  animation: au-brand-cube 0.7s var(--au-spring) both;
}

.au-splash--out .au-wave {
  z-index: 1;
  transform: translate3d(0, -135vh, 0) rotate(180deg);
}

.au-splash--out .au-wave--5 {
  --au-wave-c: var(--au-bg);
}

.au-splashing .au-splash--out .au-wave {
  animation: au-wave-fall 0.9s cubic-bezier(0.65, 0, 0.25, 1) forwards;
  animation-delay: 0.55s;
}

.au-splashing .au-splash--out .au-wave--2 { animation-delay: 0.63s; }
.au-splashing .au-splash--out .au-wave--3 { animation-delay: 0.71s; }
.au-splashing .au-splash--out .au-wave--4 { animation-delay: 0.79s; }
.au-splashing .au-splash--out .au-wave--5 { animation-delay: 0.89s; }

@keyframes au-wave-fall {
  to { transform: translate3d(0, -14vh, 0) rotate(180deg); }
}

.au-splash__msg {
  margin: -6px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: color-mix(in srgb, var(--au-splash-ink) 70%, transparent);
}

/* --------------------------------------------------------- Breakpoints */

@media (min-width: 480px) {
  .au-card {
    padding: 36px 32px 28px;
  }

  .au-title {
    font-size: 26px;
  }
}

@media (min-width: 768px) {
  .au-blob--4 {
    display: block;
  }

  .au-shell {
    padding: 48px 24px;
  }
}

/* Telas baixas (celular deitado, teclado aberto): card encosta no topo. */
@media (max-height: 560px) {
  .au-shell {
    align-items: start;
    padding-top: 64px;
  }

  .au-title {
    margin-top: 14px;
  }

  .au-sub {
    margin-bottom: 16px;
  }
}

@keyframes au-fade {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .au-blob,
  .au-enter,
  .au-card.au-enter,
  .au-leaving .au-card,
  .au-card.is-shaking,
  .au-state__icon,
  .au-timer.is-low {
    animation: none !important;
  }

  .au-bg {
    transform: none !important;
  }

  .au-nav-out .au-card > :not(.au-logo),
  .au-nav-in .au-enter {
    animation: none !important;
  }

  .au-splashing .au-wave {
    animation: none !important;
    transform: none;
  }

  .au-wave:not(.au-wave--5),
  .au-wave__crest {
    display: none;
  }

  .au-wave--5::after {
    top: 0;
  }

  .au-splash--out .au-wave {
    display: none;
  }

  .au-splash--out .au-splash__brand,
  .au-splash--out .au-splash__brand img {
    animation: none !important;
  }

  .au-splashing .au-splash {
    animation: au-fade 0.2s ease both;
  }

  .au-splashing .au-splash__brand {
    animation: none !important;
    opacity: 1;
  }

  .au-splashing .au-splash__brand img,
  .au-splash__bar::after {
    animation: none !important;
  }
}
