/* Gestor STA v3.359.41 — login canônico.
   Substitui a cadeia histórica de overrides por um único contrato visual responsivo. */

:root {
  --login-ink: #071b3d;
  --login-muted: #5f6f86;
  --login-border: #d9e5f2;
  --login-blue: #0f63ff;
  --login-blue-strong: #0a4fd4;
  --login-cyan: #00b8d9;
  --login-surface: rgba(255, 255, 255, 0.97);
  --login-shadow: 0 28px 80px rgba(7, 27, 61, 0.16), 0 4px 18px rgba(15, 99, 255, 0.08);
}

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

body.login-page {
  margin: 0;
  min-width: 320px;
  color: var(--login-ink);
  background: #eef7ff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.email-confirmation-modal-open {
  overflow: hidden;
}

.login-shell {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 52px);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(15, 99, 255, 0.14), transparent 30%),
    radial-gradient(circle at 88% 86%, rgba(0, 184, 217, 0.16), transparent 32%),
    linear-gradient(135deg, #f5fbff 0%, #e9f5ff 52%, #f2fbff 100%);
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  border: 1px solid rgba(15, 99, 255, 0.10);
}

.login-shell::before {
  width: min(48vw, 640px);
  aspect-ratio: 1;
  top: -24vw;
  right: -14vw;
}

.login-shell::after {
  width: min(34vw, 440px);
  aspect-ratio: 1;
  left: -15vw;
  bottom: -18vw;
  border-color: rgba(0, 184, 217, 0.12);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  display: grid;
  gap: 18px;
}

.auth-card {
  width: 100%;
  padding: clamp(28px, 4.6vw, 42px) clamp(22px, 4.4vw, 40px) clamp(24px, 4vw, 34px);
  border: 1px solid rgba(121, 169, 220, 0.34);
  border-radius: 28px;
  background: var(--login-surface);
  box-shadow: var(--login-shadow);
  /* Fundo quase opaco: blur não altera percepção e custa composição no mobile. */
  transition: opacity 160ms ease, transform 160ms ease;
}

html[data-login-session-gate="redirecting"] .auth-card {
  opacity: 0;
  transform: translateY(4px);
}

.login-logo {
  display: block;
  width: min(76%, 252px);
  height: auto;
  margin: 0 auto 12px;
}

.login-heading {
  margin: 0 0 16px;
  color: var(--login-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.auth-title {
  text-align: center;
  margin-bottom: 24px;
}

.auth-title h1,
.auth-title h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(25px, 4.7vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.auth-title p {
  margin: 9px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

.login-form {
  display: grid;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: #243a5c;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 750;
}

.input-shell {
  min-height: 54px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--login-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(7, 27, 61, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(15, 99, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(15, 99, 255, 0.10);
  background: #fff;
}

.input-shell > svg {
  width: 20px;
  height: 20px;
  justify-self: center;
  fill: none;
  stroke: #6b7d96;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  min-width: 0;
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--login-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.input-shell input::placeholder {
  color: #9aa8ba;
  font-weight: 500;
}

.field-help {
  margin: 6px 2px 16px;
  color: #77869c;
  font-size: 11px;
  line-height: 1.4;
}

.icon-button {
  width: 44px;
  height: 44px;
  margin-right: 5px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  overflow: hidden;
}

.icon-button:hover {
  color: var(--login-blue);
  background: rgba(15, 99, 255, 0.06);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 10px 0 20px;
}

.text-link,
.login-legal-links a,
.login-version {
  color: var(--login-blue);
  text-decoration: none;
}

.text-link {
  font-size: 12px;
  font-weight: 750;
}

.text-link:hover,
.login-legal-links a:hover,
.login-version:hover {
  text-decoration: underline;
}

.primary-button,
.secondary-button {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-button {
  width: 100%;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--login-blue), #138cf8 68%, var(--login-cyan));
  box-shadow: 0 12px 24px rgba(15, 99, 255, 0.22);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(15, 99, 255, 0.26);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.64;
  cursor: progress;
}

.account-prompt,
.support-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--login-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.account-prompt {
  margin-top: 18px;
}

.support-line {
  margin-top: 9px;
}

.secure-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: #47617f;
  font-size: 11px;
  font-weight: 700;
}

.secure-seal svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #18855e;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
  color: #9aa8ba;
  font-size: 10.5px;
  line-height: 1.4;
}

.login-legal-links a {
  color: #68798f;
  font-weight: 650;
}

.login-version {
  display: block;
  width: fit-content;
  margin: 9px auto 0;
  color: #8a98aa;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
}

.auth-footer {
  color: #7b8ca2;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
}

.login-status-message {
  margin: -8px 0 18px;
  padding: 11px 12px;
  border: 1px solid #bfddff;
  border-radius: 12px;
  color: #073e71;
  background: #edf7ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  min-height: 44px;
}

/* Reserva a altura do aviso antes da primeira tentativa e evita CLS tardio. */
.login-status-message[hidden] {
  display: block;
  visibility: hidden;
}

.login-status-message[data-type="error"] {
  color: #8a1f2d;
  background: #fff1f2;
  border-color: #fecdd3;
}

.login-status-message[data-type="success"] {
  color: #075c43;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.login-captcha-field {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(15, 99, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 99, 255, 0.06), rgba(0, 184, 217, 0.07));
}

.login-captcha-field[hidden] {
  display: none;
}

.login-captcha-title {
  margin-bottom: 8px;
  color: #0a3268;
  font-size: 11px;
  font-weight: 800;
}

.login-turnstile-widget {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-confirmation-modal[hidden] {
  display: none;
}

.email-confirmation-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.email-confirmation-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 45, 0.62);
  backdrop-filter: blur(10px);
}

.email-confirmation-card {
  position: relative;
  width: min(92vw, 460px);
  padding: 32px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 26px;
  color: #0f172a;
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(15, 111, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 30px 80px rgba(7, 21, 45, 0.28);
}

.email-confirmation-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  color: #334155;
  background: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.email-confirmation-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #0f6fff, #02c7d9);
  box-shadow: 0 16px 30px rgba(15, 111, 255, 0.25);
}

.email-confirmation-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.email-confirmation-card h2 {
  margin: 0 0 10px;
  color: #081733;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.email-confirmation-text {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.email-confirmation-target {
  margin: 18px auto 0;
  padding: 11px 14px;
  max-width: 100%;
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 14px;
  color: #075985;
  background: rgba(224, 247, 255, 0.55);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.email-confirmation-feedback {
  display: none;
  min-height: 42px;
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.email-confirmation-feedback:not(:empty) {
  display: block;
}

.email-confirmation-feedback[data-type="info"] {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.email-confirmation-feedback[data-type="success"] {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.email-confirmation-feedback[data-type="error"] {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.email-confirmation-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 10px;
  margin-top: 18px;
}

.email-confirmation-actions .secondary-button {
  width: 100%;
  border: 1px solid rgba(15, 111, 255, 0.28);
  color: #0f6fff;
  background: #fff;
}

.pressable {
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.pressable.is-pressing {
  transform: scale(0.985);
}

.tap-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  pointer-events: none;
  background: currentColor;
  opacity: 0.14;
  transform: translate(-50%, -50%) scale(0);
  animation: login-ripple 620ms ease-out forwards;
}

@keyframes login-ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 99, 255, 0.24);
  outline-offset: 3px;
}

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

@media (max-width: 560px) {
  .login-shell {
    place-items: start center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    overflow: auto;
  }

  .auth-panel {
    width: min(100%, 430px);
    margin: auto 0;
  }

  .auth-card {
    padding: 26px 20px 22px;
    border-radius: 22px;
  }

  .login-logo {
    width: min(70%, 220px);
    margin-bottom: 12px;
  }

  .auth-title {
    margin-bottom: 20px;
  }

  .auth-title h1,
  .auth-title h2 {
    font-size: clamp(24px, 7.5vw, 29px);
  }

  .auth-title p {
    font-size: 13px;
  }

  .input-shell {
    min-height: 52px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .input-shell input {
    height: 50px;
    font-size: 16px;
  }

  .field-help {
    margin-bottom: 14px;
  }

  .email-confirmation-card {
    padding: 28px 20px 22px;
  }

  .email-confirmation-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 680px) and (max-width: 560px) {
  .login-shell {
    place-items: start center;
  }

  .auth-panel {
    margin: 0;
  }

  .auth-card {
    padding-top: 20px;
  }

  .login-logo {
    width: min(60%, 190px);
    margin-bottom: 14px;
  }

  .auth-title {
    margin-bottom: 16px;
  }

  .secure-seal {
    margin-top: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
