.login-page {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background: var(--brand-background);
  padding: 32px;
}

.login-page img,
.login-page svg,
.login-shell img,
.login-shell svg {
  max-width: 100%;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand-secondary) 10%, transparent), transparent 60%);
  pointer-events: none;
}

.login-brand-mark {
  position: absolute;
  top: clamp(18px, 4vw, 32px);
  left: clamp(18px, 4vw, 34px);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.login-brand-mark img {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 13px;
  object-fit: contain;
}

.login-brand-text {
  display: grid;
  gap: 1px;
}

.login-brand-tagline {
  color: var(--brand-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.login-card-logo {
  display: grid;
  justify-self: center;
  place-items: center;
}

.login-card-logo img {
  display: block;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  object-fit: contain;
}

.login-brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: #04282c;
  font-size: clamp(1.35rem, 3vw, 1.95rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.login-brand-mark .login-brand-wordmark {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.brand-wordmark-primary {
  color: #04282c;
}

.brand-wordmark-secondary {
  color: #4c9db1;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(400px, 100%);
  gap: 22px;
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  background: var(--brand-surface);
  box-shadow: var(--brand-shadow);
  padding: clamp(26px, 4vw, 34px);
  animation: loginEnter 0.42s ease both;
}

.login-heading {
  display: grid;
  gap: 8px;
  text-align: center;
}

.login-heading h1 {
  color: var(--brand-text);
  font-size: clamp(1.6rem, 4vw, 1.95rem);
  line-height: 1.1;
}

.login-heading p,
.login-note {
  color: var(--brand-muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.login-input {
  min-height: 48px;
  border-color: var(--brand-border);
  border-radius: 14px;
  background: #ffffff;
}

.login-input[aria-invalid="true"] {
  border-color: #dc2626;
}

.login-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.password-field {
  position: relative;
}

.password-field .login-input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-primary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 10px;
  transform: translateY(-50%);
}

.password-toggle:hover,
.forgot-link:hover {
  background: color-mix(in srgb, var(--brand-secondary) 14%, transparent);
}

.forgot-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-primary);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0 8px;
}

.login-card .button {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

.login-message {
  min-height: 22px;
  color: #dc2626;
  font-size: 0.9rem;
}

.login-message.is-success {
  color: #047857;
}

.login-note {
  font-size: 0.85rem;
  text-align: center;
}

@keyframes loginEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  .login-page {
    align-content: center;
    padding: calc(82px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .login-brand-mark {
    gap: 9px;
  }

  .login-brand-mark img {
    width: 38px;
    height: 38px;
  }

  .login-brand-tagline {
    display: none;
  }

  .login-card-logo {
    gap: 10px;
  }

  .login-card-logo img {
    width: 48px;
    height: 48px;
  }
}

/* ==========================================================================
   Tela de login do Gestão (/login/) — redesign mobile-first + desktop split.
   Tudo abaixo é escopado em .login-shell. As regras acima (.login-page,
   .login-brand-mark, .login-card, .login-input, .password-toggle, ...)
   seguem em uso pela troca de senha (change-password) e pela seleção de
   empresa (selecionar-empresa) e não devem ser removidas nem redefinidas.

   Contrato com login.js / AppUtils: o JS reescreve o textContent do toggle
   de senha e do botão Entrar e o innerHTML de [data-login-heading]. Por isso
   ícone de olho, seta e spinner vêm de pseudo-elementos (nunca de filhos).
   ========================================================================== */

.login-shell {
  --login-evergreen: var(--color-evergreen, #042A2B);
  --login-evergreen-2: #0A3B3C;
  --login-pacific: var(--color-pacific-blue, #5EB1BF);
  --login-ice: var(--color-neon-ice, #54F2F2);
  --login-bg: var(--brand-background, #FCFCFC);
  --login-surface: #FFFFFF;
  --login-ink: var(--brand-text, #042A2B);
  --login-muted: rgba(4, 42, 43, 0.64);
  --login-line: rgba(4, 42, 43, 0.13);
  /* Pacific Blue escurecido para texto sobre branco (contraste AA). */
  --login-link: #2B6F78;
  --login-wordmark-accent: #2F8E9C;
  --login-danger: #C62828;
  --login-success: #047857;
  --login-radius-field: 16px;
  --login-control-height: 54px;
  --login-gutter: clamp(16px, 5vw, 20px);
  --login-ring: 0 0 0 4px color-mix(in srgb, var(--login-pacific) 26%, transparent);

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--login-pacific) 16%, transparent), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, color-mix(in srgb, var(--login-ice) 12%, transparent), transparent 62%),
    var(--login-bg);
  color: var(--login-ink);
  padding:
    calc(env(safe-area-inset-top, 0px) + clamp(28px, 7vh, 64px))
    calc(env(safe-area-inset-right, 0px) + var(--login-gutter))
    calc(env(safe-area-inset-bottom, 0px) + clamp(20px, 4vh, 36px))
    calc(env(safe-area-inset-left, 0px) + var(--login-gutter));
}

/* Formas abstratas de apoio (somente decoração). */
.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.login-shell::before {
  top: -120px;
  right: -110px;
  width: 300px;
  height: 300px;
  border: 1px solid color-mix(in srgb, var(--login-pacific) 26%, transparent);
  box-shadow:
    0 0 0 30px color-mix(in srgb, var(--login-pacific) 4%, transparent),
    0 0 0 31px color-mix(in srgb, var(--login-pacific) 10%, transparent);
}

.login-shell::after {
  bottom: -150px;
  left: -130px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, color-mix(in srgb, var(--login-ice) 22%, transparent), transparent 68%);
}

.login-shell .login-brand-panel,
.login-shell .login-form-panel {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 420px;
  margin-inline: auto;
}

/* ---------- Marca (mobile) ---------- */

.login-shell .login-brand-panel {
  margin-top: auto;
}

.login-shell .login-brand-panel-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.login-shell .brand-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-radius: 20px;
  color: inherit;
  text-decoration: none;
}

.login-shell .brand-mark-icon {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 22px;
  box-shadow:
    0 14px 30px -12px rgba(4, 42, 43, 0.45),
    0 0 0 6px color-mix(in srgb, var(--login-ice) 12%, transparent);
}

.login-shell .brand-mark-icon img {
  display: block;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  object-fit: contain;
}

.login-shell .brand-mark-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(1.7rem, 7.6vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.login-shell .brand-mark-wordmark-light {
  color: var(--login-evergreen);
}

.login-shell .brand-mark-wordmark-accent {
  color: var(--login-wordmark-accent);
}

.login-shell .brand-panel-copy {
  display: grid;
  gap: 6px;
  max-width: 320px;
}

.login-shell .brand-panel-title {
  color: var(--login-muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.login-shell .brand-panel-tagline,
.login-shell .login-brand-art {
  display: none;
}

/* Wrapper do hero (desktop). No mobile/tablet é neutro: os filhos seguem
   no grid de .login-brand-panel-inner exatamente como antes. */
.login-shell .login-brand-hero {
  display: contents;
}

/* ---------- Formulário (mobile: integrado ao fundo, sem card) ---------- */

.login-shell .login-form-panel {
  margin-top: clamp(18px, 3.4vh, 30px);
  margin-bottom: auto;
}

.login-shell .login-card {
  width: 100%;
  gap: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.login-shell .login-heading {
  gap: 4px;
  text-align: center;
}

.login-shell .login-heading h1 {
  color: var(--login-ink);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.login-shell .login-heading p {
  color: var(--login-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.login-shell .login-heading p,
.login-shell .brand-panel-title,
.login-shell .brand-panel-tagline,
.login-shell .login-note {
  text-wrap: balance;
}

.login-shell .auth-form {
  display: grid;
  gap: 14px;
}

.login-shell .form-group {
  gap: 8px;
  margin-bottom: 0;
}

.login-shell .form-label {
  color: var(--login-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.login-shell .login-field {
  position: relative;
  min-width: 0;
}

.login-shell .login-field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: rgba(4, 42, 43, 0.46);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.18s ease;
}

.login-shell .login-field:focus-within .login-field-icon {
  color: var(--login-evergreen);
}

.login-shell .login-input {
  width: 100%;
  min-width: 0;
  min-height: var(--login-control-height);
  border: 1px solid var(--login-line);
  border-radius: var(--login-radius-field);
  background: var(--login-surface);
  box-shadow: 0 1px 2px rgba(4, 42, 43, 0.04);
  color: var(--login-ink);
  /* 16px evita o zoom automático do iOS ao focar o campo. */
  font-size: 16px;
  padding: 0 16px 0 48px;
}

/* Evergreen clareado: 5,02:1 sobre branco (AA), ainda bem mais leve que o
   texto digitado (#042A2B). */
.login-shell .login-input::placeholder {
  color: #5E7374;
  opacity: 1;
}

.login-shell .login-input:hover {
  border-color: color-mix(in srgb, var(--login-pacific) 45%, var(--login-line));
}

.login-shell .login-input:focus {
  border-color: var(--login-pacific);
  box-shadow: var(--login-ring);
  outline: 0;
}

.login-shell .login-input[aria-invalid="true"] {
  border-color: var(--login-danger);
}

.login-shell .login-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.16);
}

.login-shell .login-field:has(.login-input[aria-invalid="true"]) .login-field-icon {
  color: var(--login-danger);
}

.login-shell .login-input:-webkit-autofill,
.login-shell .login-input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--login-ink);
  -webkit-box-shadow: 0 0 0 1000px #F3FAFB inset;
  box-shadow: 0 0 0 1000px #F3FAFB inset;
}

.login-shell .login-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #F3FAFB inset, var(--login-ring);
  box-shadow: 0 0 0 1000px #F3FAFB inset, var(--login-ring);
}

/* Mostrar/Esconder: o texto continua no DOM (login.js), o nome acessível vem
   do aria-label e o visual é um ícone de olho controlado por aria-pressed. */
.login-shell .password-field .login-input {
  padding-right: 58px;
}

.login-shell .password-toggle {
  top: 50%;
  right: 5px;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  color: rgba(4, 42, 43, 0.58);
  font-size: 0;
  line-height: 0;
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.login-shell .password-toggle::before {
  content: "";
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
}

.login-shell .password-toggle[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 3.5l17 17'/><path d='M10.4 5.65A9.7 9.7 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16.3 16.3 0 0 1-2.85 3.7'/><path d='M6.7 6.75C4 8.5 2.5 12 2.5 12S6 18.5 12 18.5a9.4 9.4 0 0 0 5.05-1.45'/><path d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 3.5l17 17'/><path d='M10.4 5.65A9.7 9.7 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16.3 16.3 0 0 1-2.85 3.7'/><path d='M6.7 6.75C4 8.5 2.5 12 2.5 12S6 18.5 12 18.5a9.4 9.4 0 0 0 5.05-1.45'/><path d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/></svg>");
}

.login-shell .password-toggle:hover,
.login-shell .password-toggle[aria-pressed="true"] {
  background: color-mix(in srgb, var(--login-pacific) 14%, transparent);
  color: var(--login-evergreen);
}

.login-shell .password-toggle:focus-visible,
.login-shell .forgot-link:focus-visible,
.login-shell .button:focus-visible,
.login-shell .brand-mark:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--login-pacific) 70%, transparent);
  outline-offset: 2px;
}

.login-shell .forgot-link {
  justify-self: end;
  min-height: 44px;
  margin: -6px 0 -4px;
  border-radius: 12px;
  color: var(--login-link);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 6px;
}

.login-shell .forgot-link:hover {
  background: color-mix(in srgb, var(--login-pacific) 12%, transparent);
  color: var(--login-evergreen);
}

/* Mensagens: o <p role="alert"> fica sempre no DOM; só ganha caixa quando
   o login.js escreve um texto nele. */
.login-shell .login-message {
  min-height: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Vazio: não consome o gap do grid entre "Esqueceu" e "Entrar". */
.login-shell .login-message:empty {
  margin-bottom: -14px;
}

.login-shell .login-message:not(:empty) {
  border: 1px solid rgba(198, 40, 40, 0.22);
  border-radius: 14px;
  background: rgba(198, 40, 40, 0.06);
  color: var(--login-danger);
  padding: 11px 14px;
}

.login-shell .login-message.is-success:not(:empty) {
  border-color: rgba(4, 120, 87, 0.22);
  background: rgba(4, 120, 87, 0.07);
  color: var(--login-success);
}

/* Botões */
.login-shell .login-card .button {
  position: relative;
  width: 100%;
  min-height: var(--login-control-height);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 24px;
}

.login-shell .login-card .button-primary {
  background: linear-gradient(135deg, var(--login-evergreen-2), var(--login-evergreen));
  box-shadow: 0 14px 28px -14px rgba(4, 42, 43, 0.65);
  color: #FFFFFF;
}

.login-shell .login-card .button-primary:hover {
  background: linear-gradient(135deg, #0D4647, var(--login-evergreen));
  box-shadow:
    0 16px 30px -14px rgba(4, 42, 43, 0.7),
    0 0 0 4px color-mix(in srgb, var(--login-pacific) 22%, transparent);
}

.login-shell .login-card .button-secondary {
  border-color: var(--login-line);
  background: var(--login-surface);
  color: var(--login-ink);
}

.login-shell .login-card .button-secondary:hover {
  border-color: color-mix(in srgb, var(--login-pacific) 60%, var(--login-line));
  background: color-mix(in srgb, var(--login-pacific) 8%, var(--login-surface));
}

/* Entrar: seta em círculo Neon Ice; vira spinner durante "Entrando...". */
.login-shell [data-login-button] {
  padding-inline: 60px;
}

.login-shell [data-login-button]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042A2B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5'/></svg>") center / 20px no-repeat,
    var(--login-ice);
  transform: translateY(-50%);
  transition: transform 0.18s ease;
}

.login-shell [data-login-button]:hover::after {
  transform: translate(2px, -50%);
}

.login-shell [data-login-button]:disabled {
  opacity: 0.86;
}

.login-shell [data-login-button]:disabled::after {
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-width='2.6' stroke-linecap='round'><circle cx='12' cy='12' r='8.5' stroke='%23042A2B' stroke-opacity='0.2'/><path d='M20.5 12A8.5 8.5 0 0 0 12 3.5' stroke='%23042A2B'/></svg>") center / 22px no-repeat,
    var(--login-ice);
  animation: loginSpin 0.8s linear infinite;
}

@keyframes loginSpin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.login-shell .login-note {
  color: var(--login-muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.login-shell .login-reset-note {
  border: 1px solid color-mix(in srgb, var(--login-pacific) 30%, transparent);
  border-radius: var(--login-radius-field);
  background: color-mix(in srgb, var(--login-pacific) 10%, var(--login-surface));
  color: var(--login-ink);
  font-size: 0.93rem;
  padding: 14px 16px;
  text-align: left;
  text-wrap: pretty;
}

.login-shell .login-access-note::before {
  content: "";
  display: inline-block;
  margin-right: 6px;
  vertical-align: -2px;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7.5 3v5.5c0 4.5-3.2 8.2-7.5 9.5-4.3-1.3-7.5-5-7.5-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7.5 3v5.5c0 4.5-3.2 8.2-7.5 9.5-4.3-1.3-7.5-5-7.5-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>") center / contain no-repeat;
}

/* ---------- Mobile estreito / baixo ---------- */

@media (max-width: 359px) {
  .login-shell .brand-mark-icon img {
    width: 58px;
    height: 58px;
  }

  .login-shell .login-heading h1 {
    font-size: 1.2rem;
  }
}

@media (max-width: 959px) and (max-height: 640px) {
  .login-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
  }

  .login-shell .login-brand-panel-inner,
  .login-shell .brand-mark {
    gap: 10px;
  }

  .login-shell .brand-mark-icon img {
    width: 52px;
    height: 52px;
    border-radius: 17px;
  }

  .login-shell .brand-mark-icon {
    border-radius: 17px;
  }

  .login-shell .brand-mark-wordmark {
    font-size: 1.5rem;
  }

  .login-shell .login-form-panel {
    margin-top: 20px;
  }

  .login-shell .login-card {
    gap: 16px;
  }
}

/* ---------- Tablet: mesma composição, formulário ganha superfície ---------- */

@media (min-width: 600px) and (max-width: 959px) {
  .login-shell .brand-panel-tagline {
    display: block;
    color: var(--login-muted);
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .login-shell .brand-panel-copy {
    max-width: 400px;
  }

  .login-shell .login-form-panel {
    max-width: 460px;
  }

  .login-shell .login-card {
    border: 1px solid var(--login-line);
    border-radius: 28px;
    background: var(--login-surface);
    box-shadow: 0 24px 60px -30px rgba(4, 42, 43, 0.28);
    padding: 36px 36px 30px;
  }
}

/* ---------- Desktop: painel de marca + formulário lado a lado ---------- */

@media (min-width: 960px) {
  .login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(500px, 1fr);
    gap: 0;
    padding: 16px;
    background: var(--login-bg);
  }

  .login-shell::before {
    top: auto;
    right: -140px;
    bottom: -160px;
    width: 380px;
    height: 380px;
  }

  .login-shell::after {
    top: -140px;
    right: 18%;
    bottom: auto;
    left: auto;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, color-mix(in srgb, var(--login-pacific) 16%, transparent), transparent 68%);
  }

  .login-shell .login-brand-panel,
  .login-shell .login-form-panel {
    max-width: none;
    margin: 0;
  }

  .login-shell .login-brand-panel {
    overflow: hidden;
    min-height: calc(100dvh - 32px);
    border-radius: 28px;
    background:
      radial-gradient(70% 55% at 85% 12%, color-mix(in srgb, var(--login-ice) 20%, transparent), transparent 70%),
      radial-gradient(60% 50% at 0% 100%, color-mix(in srgb, var(--login-pacific) 26%, transparent), transparent 70%),
      linear-gradient(160deg, #0B3536 0%, var(--login-evergreen) 62%, #031F20 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    padding: clamp(48px, 4.2vw, 72px);
  }

  /* Anéis geométricos do painel de marca. */
  .login-shell .login-brand-panel::before,
  .login-shell .login-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }

  .login-shell .login-brand-panel::before {
    top: -18%;
    right: -14%;
    width: 62%;
    aspect-ratio: 1;
    border: 1px solid rgba(84, 242, 242, 0.16);
    box-shadow:
      0 0 0 48px rgba(84, 242, 242, 0.03),
      0 0 0 49px rgba(84, 242, 242, 0.09);
  }

  .login-shell .login-brand-panel::after {
    bottom: -26%;
    left: -12%;
    width: 46%;
    aspect-ratio: 1;
    border: 1px solid rgba(94, 177, 191, 0.18);
  }

  .login-shell .login-brand-panel-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    text-align: left;
  }

  /* Hero = arte + headline + subtítulo como um único bloco. Ocupa a altura
     restante abaixo do logo e fica centralizado nela: a sobra de altura vai
     para fora do grupo, nunca entre a arte e o texto. */
  .login-shell .login-brand-hero {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    gap: clamp(28px, 4.5vh, 48px);
    width: 100%;
    max-width: 600px;
  }

  .login-shell .brand-mark {
    flex-direction: row;
    gap: 14px;
    border-radius: 16px;
  }

  .login-shell .brand-mark-icon {
    border-radius: 16px;
    box-shadow:
      0 12px 28px -10px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(84, 242, 242, 0.22);
  }

  .login-shell .brand-mark-icon img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .login-shell .brand-mark-wordmark {
    font-size: 1.7rem;
  }

  .login-shell .brand-mark-wordmark-light {
    color: #FFFFFF;
  }

  .login-shell .brand-mark-wordmark-accent {
    background: var(--brand-accent-gradient, linear-gradient(135deg, #1FE8DC, #5EC9D6));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .login-shell .brand-panel-copy {
    gap: 14px;
    max-width: 560px;
  }

  .login-shell .brand-panel-title {
    color: #FFFFFF;
    font-size: clamp(2rem, 2.7vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.12;
  }

  .login-shell .brand-panel-tagline {
    display: block;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(1rem, 1.1vw, 1.12rem);
    font-weight: 500;
    line-height: 1.55;
  }

  /* Composição abstrata do ecossistema: uma identidade (núcleo) ligada a
     ambientes (nós). Sem texto, sem imagem externa. */
  .login-shell .login-brand-art {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
  }

  .login-shell .login-eco-art {
    position: relative;
    width: min(380px, 80%);
    aspect-ratio: 19 / 12;
  }

  .login-shell .login-eco-orbit {
    position: absolute;
    inset: 8% 14%;
    border: 1px dashed rgba(84, 242, 242, 0.28);
    border-radius: 50%;
  }

  .login-shell .login-eco-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border: 1px solid rgba(84, 242, 242, 0.32);
    border-radius: 30px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    box-shadow:
      0 30px 60px -28px rgba(0, 0, 0, 0.65),
      0 0 0 14px rgba(84, 242, 242, 0.05);
    transform: translate(-50%, -50%);
  }

  .login-shell .login-eco-core i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background:
      radial-gradient(circle, #06393A 52%, transparent 53%),
      conic-gradient(var(--login-ice) 0 34%, var(--login-pacific) 34% 67%, rgba(255, 255, 255, 0.55) 67% 100%);
  }

  .login-shell .login-eco-node {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(4, 42, 43, 0.78);
    box-shadow: 0 20px 40px -22px rgba(0, 0, 0, 0.7);
    padding: 11px 14px 11px 11px;
  }

  .login-shell .login-eco-node i {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--node-accent) 34%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--node-accent) 60%, transparent);
  }

  .login-shell .login-eco-node b {
    width: 64px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 0 -1px rgba(255, 255, 255, 0.12);
    transform: translateY(-6px);
  }

  .login-shell .login-eco-node.is-a {
    --node-accent: var(--login-ice);
    top: 0;
    left: 0;
    transform: rotate(-3deg);
  }

  .login-shell .login-eco-node.is-b {
    --node-accent: var(--login-pacific);
    top: 10%;
    right: 0;
    transform: rotate(3deg);
  }

  .login-shell .login-eco-node.is-c {
    --node-accent: rgba(255, 255, 255, 0.7);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
  }

  /* Formulário desktop */
  .login-shell .login-form-panel {
    display: grid;
    place-items: center;
    padding: 40px clamp(20px, 3.5vw, 88px);
  }

  .login-shell .login-card {
    width: min(452px, 100%);
    gap: 22px;
    border: 1px solid var(--login-line);
    border-radius: 28px;
    background: var(--login-surface);
    box-shadow: 0 30px 70px -36px rgba(4, 42, 43, 0.32);
    padding: 44px 40px 34px;
  }

  .login-shell .login-heading {
    gap: 8px;
    text-align: left;
  }

  .login-shell .login-heading h1 {
    font-size: 1.75rem;
  }

  .login-shell .login-heading p {
    font-size: 0.97rem;
  }

  .login-shell .login-access-note {
    text-align: left;
  }
}

/* Desktop com pouca altura (ex.: 1366x768 com barras do navegador). */
@media (min-width: 960px) and (max-height: 760px) {
  .login-shell .login-eco-art {
    width: min(330px, 72%);
  }

  .login-shell .login-card {
    gap: 18px;
    padding: 34px 36px 28px;
  }
}

/* Desktop baixo: o hero não encolhe mais com flex, então compacta arte,
   espaçamentos e padding vertical para caber sem rolagem. */
@media (min-width: 960px) and (max-height: 700px) {
  .login-shell .login-brand-panel {
    padding-block: 36px;
  }

  .login-shell .login-brand-panel-inner {
    gap: 20px;
  }

  .login-shell .login-brand-hero {
    gap: 20px;
  }

  .login-shell .login-eco-art {
    width: min(280px, 64%);
  }

  .login-shell .login-eco-core {
    width: 76px;
    height: 76px;
    border-radius: 24px;
  }
}

@media (min-width: 960px) and (max-height: 620px) {
  .login-shell .login-brand-art {
    display: none;
  }
}

/* Mobile/tablet: labels com um pouco mais de presença e respiro entre o
   botão Entrar e a nota de acesso restrito. */
@media (max-width: 959px) {
  .login-shell .form-label {
    font-size: 0.94rem;
    letter-spacing: 0.005em;
  }

  .login-shell .login-access-note {
    margin-top: 6px;
  }
}

/* Desktop muito largo: o card cresce de forma progressiva (até ~500px) e
   ganha um halo + anel concêntrico para não parecer uma ilha no vazio. */
@media (min-width: 1600px) {
  .login-shell {
    padding: 20px;
  }

  .login-shell .login-brand-panel {
    min-height: calc(100dvh - 40px);
  }

  .login-shell .login-form-panel::before,
  .login-shell .login-form-panel::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
  }

  .login-shell .login-form-panel::before {
    width: min(860px, 100%);
    aspect-ratio: 1;
    background: radial-gradient(circle, color-mix(in srgb, var(--login-pacific) 16%, transparent) 0%, color-mix(in srgb, var(--login-ice) 6%, transparent) 42%, transparent 68%);
  }

  .login-shell .login-form-panel::after {
    width: min(700px, 92%);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--login-pacific) 22%, transparent);
    box-shadow: 0 0 0 56px color-mix(in srgb, var(--login-pacific) 3%, transparent);
  }

  .login-shell .login-card {
    width: min(clamp(460px, 26vw, 500px), 100%);
    gap: 24px;
    padding: 52px 48px 40px;
  }

  .login-shell .login-heading h1 {
    font-size: 2.05rem;
  }

  .login-shell .login-heading p {
    font-size: 1.05rem;
  }

  .login-shell .form-label {
    font-size: 0.98rem;
  }

  .login-shell .login-card .button {
    font-size: 1.05rem;
  }

  .login-shell .login-access-note {
    font-size: 0.88rem;
  }

  .login-shell {
    --login-control-height: 56px;
  }
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--brand-text);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-in-out 0s;
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }

  .login-shell [data-login-button]::after,
  .login-shell .login-field-icon {
    transition: none;
  }
}

/* ==========================================================================
   Autenticação do ecossistema (login único, recuperação, convite).
   Mesma família visual do .login-shell; usado por /login/, /redefinir-senha/
   e /portal-parceiro/convite/.
   ========================================================================== */

.login-shell .login-heading h1:focus {
  outline: none;
}

.login-shell .login-heading h1:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--login-pacific) 70%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.login-shell .login-badge {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--login-pacific) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--login-pacific) 11%, var(--login-surface));
  color: var(--login-link);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 7px 12px;
  text-transform: uppercase;
}

.login-shell .login-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--login-wordmark-accent);
}

.login-shell .login-badge.is-danger {
  border-color: rgba(198, 40, 40, 0.28);
  background: rgba(198, 40, 40, 0.06);
  color: var(--login-danger);
}

.login-shell .login-badge.is-danger::before {
  background: var(--login-danger);
}

.login-shell .login-badge.is-success {
  border-color: rgba(4, 120, 87, 0.26);
  background: rgba(4, 120, 87, 0.07);
  color: var(--login-success);
}

.login-shell .login-badge.is-success::before {
  background: var(--login-success);
}

.login-shell .login-status-note,
.login-shell .login-summary {
  border: 1px solid color-mix(in srgb, var(--login-pacific) 30%, transparent);
  border-radius: var(--login-radius-field);
  background: color-mix(in srgb, var(--login-pacific) 9%, var(--login-surface));
  color: var(--login-ink);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 14px 16px;
  text-wrap: pretty;
}

.login-shell .login-status-note.is-error {
  border-color: rgba(198, 40, 40, 0.22);
  background: rgba(198, 40, 40, 0.06);
  color: var(--login-danger);
  font-weight: 600;
}

.login-shell .login-summary {
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.login-shell .login-summary strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.login-shell .login-summary span {
  color: var(--login-muted);
  font-size: 0.92rem;
}

.login-shell .login-hint {
  margin-top: -4px;
  text-align: left;
}

.login-shell .login-actions {
  display: grid;
  gap: 12px;
}

.login-shell .login-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 44px;
  border-radius: 12px;
  color: var(--login-link);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 0 10px;
  text-decoration: none;
}

.login-shell .login-link-button:hover {
  background: color-mix(in srgb, var(--login-pacific) 12%, transparent);
  color: var(--login-evergreen);
}

.login-shell .login-link-button:focus-visible,
.login-shell .login-choice:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--login-pacific) 70%, transparent);
  outline-offset: 2px;
}

.login-shell a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Escolha de ambiente (somente identidades com mais de um acesso). */
.login-shell .login-choices {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-shell .login-choice {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--login-line);
  border-radius: 20px;
  background: var(--login-surface);
  color: var(--login-ink);
  padding: 16px 64px 16px 18px;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-shell .login-choice strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.login-shell .login-choice span {
  color: var(--login-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.login-shell .login-choice::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042A2B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5'/></svg>") center / 18px no-repeat,
    var(--login-ice);
  transform: translateY(-50%);
}

.login-shell .login-choice:hover {
  border-color: color-mix(in srgb, var(--login-pacific) 60%, var(--login-line));
  box-shadow: 0 14px 30px -22px rgba(4, 42, 43, 0.5);
}

.login-shell .login-choices-logout {
  justify-self: center;
}

.login-shell .login-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 72px;
  color: var(--login-muted);
  font-weight: 700;
}

.login-shell .login-checking span,
.login-shell .login-loading span {
  width: 22px;
  height: 22px;
  border: 3px solid color-mix(in srgb, var(--login-pacific) 30%, transparent);
  border-top-color: var(--login-evergreen);
  border-radius: 50%;
  animation: loginSpinPlain 0.8s linear infinite;
}

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

.login-shell .login-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  color: var(--login-muted);
  font-weight: 700;
}

.login-shell .login-requirements {
  display: grid;
  gap: 6px;
  margin: -2px 0 0;
  padding: 0;
  list-style: none;
  color: var(--login-muted);
  font-size: 0.88rem;
}

.login-shell .login-requirements li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-shell .login-requirements li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.login-shell .login-requirements li.is-met {
  color: var(--login-success);
}

.login-shell .login-requirements li.is-met::before {
  border-color: var(--login-success);
  background: var(--login-success);
  box-shadow: inset 0 0 0 2px #FFFFFF;
}

@media (min-width: 960px) {
  .login-shell .login-badge {
    justify-self: start;
  }

  .login-shell .login-link-button {
    justify-self: start;
  }

  .login-shell .login-choices-logout {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell .login-checking span,
  .login-shell .login-loading span {
    animation-duration: 2.4s;
  }
}

/* ==========================================================================
   D17 - Login com a apresentacao do app nativo
   (mobile/src/screens/auth-screen.tsx: hero de marca + card sobreposto).
   So existe sob html[data-app-experience="native"] (celular/tablet, ver
   assets/js/app-experience.js) e vale em qualquer largura, inclusive iPad
   na horizontal - por isso neutraliza explicitamente o layout desktop.
   Elementos .login-native-only ficam fora do Desktop.
   ========================================================================== */

.login-native-only {
  display: none;
}

:root[data-app-experience="native"] .login-desktop-copy {
  display: none;
}

:root[data-app-experience="native"] .login-shell {
  display: block;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--ah-canvas);
  color: var(--ah-ink);
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 32px);
}

:root[data-app-experience="native"] .login-shell::before,
:root[data-app-experience="native"] .login-shell::after,
:root[data-app-experience="native"] .login-shell .login-form-panel::before,
:root[data-app-experience="native"] .login-shell .login-form-panel::after,
:root[data-app-experience="native"] .login-shell .login-brand-panel::after,
:root[data-app-experience="native"] .login-shell .login-brand-art {
  display: none;
}

/* ---------- Hero de marca ---------- */

:root[data-app-experience="native"] .login-shell .login-brand-panel {
  position: relative;
  display: block;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--ah-brand-gradient);
  color: #FFFFFF;
  padding:
    calc(env(safe-area-inset-top, 0px) + 16px)
    calc(env(safe-area-inset-right, 0px) + var(--ah-gutter))
    72px
    calc(env(safe-area-inset-left, 0px) + var(--ah-gutter));
}

/* BrandRing do nativo. */
:root[data-app-experience="native"] .login-shell .login-brand-panel::before {
  content: "";
  position: absolute;
  top: -170px;
  right: -200px;
  bottom: auto;
  left: auto;
  width: 380px;
  height: 380px;
  aspect-ratio: auto;
  border: 1px solid rgba(84, 242, 242, 0.14);
  border-radius: 50%;
  box-shadow: none;
  pointer-events: none;
}

:root[data-app-experience="native"] .login-shell .login-brand-panel-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 32px;
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

:root[data-app-experience="native"] .login-shell .brand-mark {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 1px;
  border-radius: 14px;
}

:root[data-app-experience="native"] .login-shell .brand-mark-icon {
  grid-row: 1 / span 2;
  border-radius: 13px;
  box-shadow: none;
}

:root[data-app-experience="native"] .login-shell .brand-mark-icon img {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

:root[data-app-experience="native"] .login-shell .brand-mark-wordmark {
  align-self: end;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 26px;
}

:root[data-app-experience="native"] .login-shell .brand-mark-wordmark-light,
:root[data-app-experience="native"] .login-shell .brand-mark-wordmark-accent {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #FFFFFF;
}

:root[data-app-experience="native"] .login-shell .brand-mark-kicker {
  display: block;
  align-self: start;
  color: var(--ah-neon-ice);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
}

:root[data-app-experience="native"] .login-shell .login-brand-hero {
  display: block;
  width: 100%;
  max-width: none;
}

:root[data-app-experience="native"] .login-shell .brand-panel-copy {
  display: grid;
  gap: 8px;
  max-width: 420px;
}

:root[data-app-experience="native"] .login-shell .brand-panel-title {
  color: #FFFFFF;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.027em;
  line-height: 32px;
  text-wrap: balance;
}

:root[data-app-experience="native"] .login-shell .brand-panel-tagline {
  display: block;
  max-width: none;
  color: var(--ah-on-brand-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  text-wrap: pretty;
}

/* ---------- Card do formulario (sobrepoe o hero) ---------- */

:root[data-app-experience="native"] .login-shell .login-form-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: stretch;
  gap: 16px;
  max-width: calc(560px + 2 * var(--ah-gutter));
  margin: -48px auto 0;
  padding:
    0
    calc(env(safe-area-inset-right, 0px) + var(--ah-gutter))
    0
    calc(env(safe-area-inset-left, 0px) + var(--ah-gutter));
}

:root[data-app-experience="native"] .login-shell .login-card {
  width: 100%;
  gap: 16px;
  border: 0;
  border-radius: var(--ah-radius-card);
  background: var(--ah-surface);
  box-shadow: var(--ah-shadow-md);
  padding: 24px;
  animation: appLoginEnter 0.28s ease both;
}

@keyframes appLoginEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root[data-app-experience="native"] .login-shell .login-heading {
  gap: 4px;
  margin-bottom: 4px;
  text-align: left;
}

:root[data-app-experience="native"] .login-shell .login-heading h1 {
  color: var(--ah-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 26px;
}

:root[data-app-experience="native"] .login-shell .login-heading p {
  color: var(--ah-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  text-wrap: pretty;
}

:root[data-app-experience="native"] .login-shell .auth-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}

:root[data-app-experience="native"] .login-shell .auth-form > * {
  grid-column: 1 / -1;
}

:root[data-app-experience="native"] .login-shell .form-group {
  gap: 6px;
}

:root[data-app-experience="native"] .login-shell .form-label {
  color: var(--ah-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
}

:root[data-app-experience="native"] .login-shell .login-field-icon {
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--ah-placeholder);
  stroke-width: 1.8;
}

:root[data-app-experience="native"] .login-shell .login-field:focus-within .login-field-icon {
  color: var(--ah-evergreen);
}

:root[data-app-experience="native"] .login-shell .login-input {
  min-height: 52px;
  border: 1px solid var(--ah-line);
  border-radius: var(--ah-radius-control);
  background: var(--ah-surface);
  box-shadow: none;
  color: var(--ah-ink);
  /* 16px evita o zoom automatico do iOS ao focar. */
  font-size: 16px;
  padding: 0 16px 0 42px;
}

:root[data-app-experience="native"] .login-shell .login-input::placeholder {
  color: var(--ah-placeholder);
}

:root[data-app-experience="native"] .login-shell .login-input:hover {
  border-color: var(--ah-line);
}

:root[data-app-experience="native"] .login-shell .login-input:focus {
  border-color: var(--ah-pacific);
  box-shadow: none;
}

:root[data-app-experience="native"] .login-shell .login-input[aria-invalid="true"] {
  border-color: var(--ah-danger);
}

:root[data-app-experience="native"] .login-shell .login-input[aria-invalid="true"]:focus {
  box-shadow: none;
}

:root[data-app-experience="native"] .login-shell .login-field:has(.login-input[aria-invalid="true"]) .login-field-icon {
  color: var(--ah-danger);
}

:root[data-app-experience="native"] .login-shell .password-field .login-input {
  padding-right: 56px;
}

:root[data-app-experience="native"] .login-shell .password-toggle {
  right: 4px;
  color: var(--ah-evergreen-soft);
}

:root[data-app-experience="native"] .login-shell .password-toggle::before {
  width: 20px;
  height: 20px;
}

:root[data-app-experience="native"] .login-shell .password-toggle:hover,
:root[data-app-experience="native"] .login-shell .password-toggle[aria-pressed="true"] {
  background: transparent;
  color: var(--ah-evergreen-soft);
}

/* "Primeiro acesso?" e "Esqueceu sua senha?" na mesma linha. */
:root[data-app-experience="native"] .login-shell .forgot-link {
  justify-self: end;
  min-height: 44px;
  margin: -12px 0 -8px;
  border-radius: 10px;
  background: transparent;
  color: var(--ah-accent-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  padding: 0;
}

:root[data-app-experience="native"] .login-shell .forgot-link:hover {
  background: transparent;
  color: var(--ah-accent-text);
}

:root[data-app-experience="native"] .login-shell .forgot-link:active {
  opacity: 0.7;
}

:root[data-app-experience="native"] .login-shell .auth-form > .login-first-access {
  display: inline-flex;
  grid-column: 1;
  justify-self: start;
}

:root[data-app-experience="native"] .login-shell .auth-form > .login-first-access + [data-show-reset] {
  grid-column: 2;
}

:root[data-app-experience="native"] .login-shell .forgot-link .login-native-only {
  display: inline;
}

/* Mensagens = InlineNotice do nativo (icone + texto). */
/* Vazio sai do grid (trilhas nao encolhem com margem negativa), mas segue
   na arvore de acessibilidade como live region. */
:root[data-app-experience="native"] .login-shell .login-message:empty {
  position: absolute;
  width: 1px;
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

:root[data-app-experience="native"] .login-shell .login-message:not(:empty) {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--ah-radius-control);
  background: var(--ah-danger-bg);
  color: var(--ah-danger-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  padding: 10px 16px;
}

:root[data-app-experience="native"] .login-shell .login-message:not(:empty)::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7.5v5.5M12 16.4v.1'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7.5v5.5M12 16.4v.1'/></svg>") center / contain no-repeat;
}

:root[data-app-experience="native"] .login-shell .login-message.is-success:not(:empty) {
  background: var(--ah-success-bg);
  color: var(--ah-success-ink);
}

:root[data-app-experience="native"] .login-shell .login-status-note,
:root[data-app-experience="native"] .login-shell .login-reset-note,
:root[data-app-experience="native"] .login-shell .login-summary {
  border: 0;
  border-radius: var(--ah-radius-control);
  background: var(--ah-info-bg);
  color: var(--ah-info-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  padding: 12px 16px;
}

:root[data-app-experience="native"] .login-shell .login-status-note.is-error {
  background: var(--ah-danger-bg);
  color: var(--ah-danger-ink);
}

:root[data-app-experience="native"] .login-shell .login-summary span {
  color: var(--ah-info-ink);
}

:root[data-app-experience="native"] .login-shell .login-note.login-hint {
  color: var(--ah-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
}

/* Botoes (Button do nativo: pilula 54, rotulo 14/800, seta ao lado). */
:root[data-app-experience="native"] .login-shell .login-card .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 24px;
}

:root[data-app-experience="native"] .login-shell .login-card .button-primary,
:root[data-app-experience="native"] .login-shell .login-card .button-primary:hover {
  border-color: var(--ah-evergreen);
  background: var(--ah-evergreen);
  box-shadow: none;
  color: #FFFFFF;
}

:root[data-app-experience="native"] .login-shell .login-card .button-secondary,
:root[data-app-experience="native"] .login-shell .login-card .button-secondary:hover {
  border-color: var(--ah-line-strong);
  background: var(--ah-surface);
  color: var(--ah-evergreen);
}

:root[data-app-experience="native"] .login-shell .login-card .button:active {
  opacity: 0.76;
  transform: scale(0.98);
}

:root[data-app-experience="native"] .login-shell [data-login-button] {
  padding-inline: 24px;
}

:root[data-app-experience="native"] .login-shell [data-login-button]::after {
  position: static;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 0;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5'/></svg>") center / 18px no-repeat;
  transform: none;
}

:root[data-app-experience="native"] .login-shell [data-login-button]:hover::after {
  transform: none;
}

:root[data-app-experience="native"] .login-shell [data-login-button]:disabled {
  opacity: 1;
}

:root[data-app-experience="native"] .login-shell [data-login-button]:disabled::after {
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-width='2.6' stroke-linecap='round'><circle cx='12' cy='12' r='8.5' stroke='white' stroke-opacity='0.25'/><path d='M20.5 12A8.5 8.5 0 0 0 12 3.5' stroke='white'/></svg>") center / 18px no-repeat;
  animation: appLoginSpin 0.8s linear infinite;
}

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

:root[data-app-experience="native"] .login-shell .login-link-button {
  color: var(--ah-evergreen-soft);
  font-size: 14px;
  font-weight: 800;
}

/* Escolha de ambiente (multiacesso). */
:root[data-app-experience="native"] .login-shell .login-choice {
  border-color: var(--ah-line);
  border-radius: var(--ah-radius-card);
  box-shadow: var(--ah-shadow-sm);
}

:root[data-app-experience="native"] .login-shell .login-choice::after {
  width: 32px;
  height: 32px;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042A2B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 6 6 6-6 6'/></svg>") center / 18px no-repeat,
    var(--ah-accent-soft);
}

:root[data-app-experience="native"] .login-shell .login-choices-logout {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 0;
}

/* Nota "Acesso restrito" sai do card (no app ela fica abaixo dele). */
:root[data-app-experience="native"] .login-shell .login-card .login-access-note {
  display: none;
}

:root[data-app-experience="native"] .login-shell .login-native-footer {
  display: grid;
  gap: 16px;
}

:root[data-app-experience="native"] .login-shell .login-trust,
:root[data-app-experience="native"] .login-shell .login-restricted {
  color: var(--ah-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  text-align: center;
}

:root[data-app-experience="native"] .login-shell .login-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

:root[data-app-experience="native"] .login-shell .login-trust::before {
  content: "";
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background: var(--ah-evergreen-soft);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7.5 3v5.5c0 4.5-3.2 8.2-7.5 9.5-4.3-1.3-7.5-5-7.5-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7.5 3v5.5c0 4.5-3.2 8.2-7.5 9.5-4.3-1.3-7.5-5-7.5-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>") center / contain no-repeat;
}

:root[data-app-experience="native"] .login-shell:has(.login-card:is([data-login-view="choose"], [data-login-view="checking"])) .login-native-footer {
  display: none;
}

/* Sessao existente sendo validada = LoadingScreen do app (tela de marca). */
:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ah-brand-gradient);
  padding-bottom: 0;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .login-brand-panel {
  background: transparent;
  padding-bottom: 0;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .login-brand-panel-inner {
  justify-items: center;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .brand-mark {
  grid-template-columns: auto;
  justify-items: center;
  row-gap: 16px;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .brand-mark-icon {
  grid-row: auto;
  border-radius: 22px;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .brand-mark-icon img {
  width: 80px;
  height: 80px;
  border-radius: 22px;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .brand-mark-wordmark {
  font-size: 26px;
  line-height: 32px;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) :is(.brand-mark-kicker, .login-brand-hero) {
  display: none;
}

:root[data-app-experience="native"] .login-shell:has(.login-card[data-login-view="checking"]) .login-form-panel {
  margin-top: 16px;
}

:root[data-app-experience="native"] .login-shell .login-card[data-login-view="checking"] {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

:root[data-app-experience="native"] .login-shell .login-card[data-login-view="checking"] .login-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:root[data-app-experience="native"] .login-shell .login-card[data-login-view="checking"] .login-checking {
  justify-content: center;
  color: var(--ah-on-brand-muted);
  font-size: 15px;
}

/* ---------- Folha "Primeiro acesso" ---------- */

.login-sheet-body {
  display: grid;
  gap: 16px;
  padding-bottom: 8px;
}

.login-sheet-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--ah-accent-soft);
  color: var(--ah-evergreen);
}

.login-sheet-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.login-sheet-title {
  color: var(--ah-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 26px;
}

.login-sheet-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-sheet-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ah-ink);
  font-size: 15px;
  line-height: 22px;
}

.login-sheet-step-number {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--ah-evergreen);
  color: var(--ah-neon-ice);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.login-sheet-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--ah-radius-control);
  background: var(--ah-info-bg);
  color: var(--ah-info-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  padding: 10px 16px;
}

.login-sheet-notice::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='5.5' width='17' height='13' rx='2.5'/><path d='m4.5 7.5 7.5 5.5 7.5-5.5'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='5.5' width='17' height='13' rx='2.5'/><path d='m4.5 7.5 7.5 5.5 7.5-5.5'/></svg>") center / contain no-repeat;
}

.login-sheet-primary,
.login-sheet-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 24px;
  -webkit-tap-highlight-color: transparent;
}

.login-sheet-primary {
  min-height: 54px;
  background: var(--ah-evergreen);
  color: #FFFFFF;
}

.login-sheet-primary::after,
.login-sheet-ghost::after {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h13.5M13 6.5l5.5 5.5-5.5 5.5'/></svg>") center / contain no-repeat;
}

.login-sheet-ghost {
  min-height: 48px;
  background: transparent;
  color: var(--ah-evergreen-soft);
}

.login-sheet-ghost::after {
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M14 4h6v6'/><path d='M20 4l-9 9'/><path d='M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M14 4h6v6'/><path d='M20 4l-9 9'/><path d='M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4'/></svg>");
}

.login-sheet-primary:active,
.login-sheet-ghost:active {
  opacity: 0.76;
  transform: scale(0.98);
}

.login-sheet-primary:focus-visible,
.login-sheet-ghost:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ah-pacific) 70%, transparent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  :root[data-app-experience="native"] .login-shell .login-card {
    animation: none;
  }

  :root[data-app-experience="native"] .login-shell [data-login-button]:disabled::after {
    animation: none;
  }
}

/* ==========================================================================
   D17 - Telas .login-page (troca obrigatoria de senha e selecao de empresa)
   na experiencia de app. Troca de senha = FirstAccessScreen do nativo
   (hero curto de marca + card sobreposto). A selecao de empresa completa a
   composicao em system/selecionar-empresa/selecionar-empresa.css.
   ========================================================================== */

:root[data-app-experience="native"] .login-page {
  display: block;
  /* O Chrome atual aplica place-items/align-content tambem a blocos. */
  place-items: normal;
  align-content: normal;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--ah-canvas);
  padding: 0;
}

:root[data-app-experience="native"] .login-page::before {
  display: none;
}

:root[data-app-experience="native"] .login-page .login-input {
  min-height: 52px;
  border: 1px solid var(--ah-line);
  border-radius: var(--ah-radius-control);
  background: var(--ah-surface);
  box-shadow: none;
  color: var(--ah-ink);
  font-size: 16px;
}

:root[data-app-experience="native"] .login-page .login-input:focus {
  border-color: var(--ah-pacific);
  box-shadow: none;
}

:root[data-app-experience="native"] .login-page .form-label {
  color: var(--ah-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
}

:root[data-app-experience="native"] .login-page .login-card .button {
  min-height: 54px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

:root[data-app-experience="native"] .login-page .login-card .button-primary {
  border-color: var(--ah-evergreen);
  background: var(--ah-evergreen);
  box-shadow: none;
  color: #FFFFFF;
}

:root[data-app-experience="native"] .login-page .login-card .button-secondary {
  border-color: var(--ah-line-strong);
  background: var(--ah-surface);
  color: var(--ah-evergreen);
}

:root[data-app-experience="native"] .login-page .login-message:empty {
  position: absolute;
  width: 1px;
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

:root[data-app-experience="native"] .login-page .login-message:not(:empty) {
  border-radius: var(--ah-radius-control);
  background: var(--ah-danger-bg);
  color: var(--ah-danger-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  padding: 10px 16px;
}

/* ---------- Troca obrigatoria de senha ---------- */

:root[data-app-experience="native"] .login-page:has(.change-password-card) {
  position: relative;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
}

/* Hero curto (gradiente + BrandRing) atras da marca e do topo do card. */
:root[data-app-experience="native"] .login-page:has(.change-password-card)::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 0;
  height: calc(env(safe-area-inset-top, 0px) + 120px);
  background:
    radial-gradient(circle at calc(100% + 10px) -0px, transparent 189px, rgba(84, 242, 242, 0.14) 190px, transparent 191px),
    var(--ah-brand-gradient);
  pointer-events: none;
}

:root[data-app-experience="native"] .login-page:has(.change-password-card) .login-brand-mark {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: calc(560px + 2 * var(--ah-gutter));
  margin: 0 auto;
  gap: 16px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 16px)
    calc(env(safe-area-inset-right, 0px) + var(--ah-gutter))
    0
    calc(env(safe-area-inset-left, 0px) + var(--ah-gutter));
}

:root[data-app-experience="native"] .login-page:has(.change-password-card) .login-brand-mark img {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
}

:root[data-app-experience="native"] .login-page:has(.change-password-card) .login-brand-wordmark {
  position: relative;
  font-size: 20px;
  font-weight: 800;
  line-height: 26px;
}

:root[data-app-experience="native"] .login-page:has(.change-password-card) .login-brand-wordmark span {
  color: #FFFFFF;
}

:root[data-app-experience="native"] .login-page:has(.change-password-card) .login-brand-wordmark::after {
  content: "Ecossistema";
  position: absolute;
  top: 100%;
  left: 0;
  color: var(--ah-neon-ice);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
}

:root[data-app-experience="native"] .change-password-card {
  position: relative;
  z-index: 1;
  width: calc(100% - 2 * var(--ah-gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  max-width: 560px;
  margin: 16px auto 0;
  gap: 16px;
  border: 0;
  border-radius: var(--ah-radius-card);
  background: var(--ah-surface);
  box-shadow: var(--ah-shadow-md);
  padding: 24px;
  animation: appLoginEnter 0.28s ease both;
}

/* Marca circular com chave no lugar do logo do card. */
:root[data-app-experience="native"] .change-password-card .login-card-logo {
  justify-self: start;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042A2B' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='15' cy='9' r='4.5'/><path d='M11.8 12.2 4 20l2 2M7 17l2 2'/><circle cx='16.2' cy='7.8' r='.6' fill='%23042A2B'/></svg>") center / 26px no-repeat,
    var(--ah-accent-soft);
}

:root[data-app-experience="native"] .change-password-card .login-card-logo img {
  display: none;
}

:root[data-app-experience="native"] .change-password-card .login-heading {
  gap: 8px;
  text-align: left;
}

:root[data-app-experience="native"] .change-password-card .login-heading::before {
  content: "Primeiro acesso";
  color: var(--ah-accent-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 14px;
  text-transform: uppercase;
}

:root[data-app-experience="native"] .change-password-card .login-heading h1 {
  color: var(--ah-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 26px;
}

:root[data-app-experience="native"] .change-password-card .login-heading p {
  color: var(--ah-muted);
  font-size: 15px;
  line-height: 22px;
}

:root[data-app-experience="native"] .change-password-card .change-password-step-indicator {
  color: var(--ah-accent-text);
}

@media (prefers-reduced-motion: reduce) {
  :root[data-app-experience="native"] .change-password-card {
    animation: none;
  }
}

/* ------------------------------------------------------------------
   Gate 3A - segunda etapa (verificacao em duas etapas, opcional)
   ------------------------------------------------------------------ */
.login-shell .login-mfa-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--login-pacific) 30%, transparent);
  border-radius: var(--login-radius-field);
  background: color-mix(in srgb, var(--login-pacific) 9%, var(--login-surface));
  color: var(--login-ink);
  padding: 14px 16px;
}

.login-shell .login-mfa-intro p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.login-shell .login-mfa-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--login-evergreen);
  color: var(--login-ice);
}

.login-shell .login-mfa-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-shell .login-code-input {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-align: center;
  padding-left: 0.4em;
}

.login-shell .login-code-input::placeholder {
  letter-spacing: 0.4em;
  opacity: 0.35;
}

.login-shell .login-mfa-select {
  padding-left: 14px;
}

.login-shell .login-mfa-help {
  border-top: 1px solid var(--login-line);
  color: var(--login-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding-top: 12px;
}

.login-shell .login-mfa-help summary {
  min-height: 32px;
  color: var(--login-link, var(--login-evergreen));
  cursor: pointer;
  font-weight: 700;
}

.login-shell .login-mfa-help p {
  margin: 8px 0 0;
}

.login-shell .login-mfa-factors {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.login-shell .login-mfa-factors[hidden] {
  display: none;
}

.login-shell .login-mfa-factor-list {
  display: grid;
  gap: 8px;
}

.login-shell .login-mfa-factor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--login-line);
  border-radius: var(--login-radius-field);
  cursor: pointer;
  font-weight: 700;
  padding: 0 14px;
}

.login-shell .login-mfa-factor:has(input:checked) {
  border-color: var(--login-pacific);
  background: color-mix(in srgb, var(--login-pacific) 9%, var(--login-surface));
}

.login-shell .login-mfa-factor input {
  width: 18px;
  height: 18px;
  accent-color: var(--login-evergreen);
}
