[hidden] {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 56px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 12%, rgba(79, 140, 255, .22), transparent 36%),
    radial-gradient(circle at 88% 85%, rgba(109, 66, 220, .18), transparent 34%),
    #f5f8ff;
}

.auth-card {
  width: min(100%, 440px);
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid #dce6f5;
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(34, 65, 116, .16);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #12335f;
}

.auth-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #edf3ff;
}

.auth-brand svg {
  width: 25px;
  height: 25px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
  line-height: 1.05;
  letter-spacing: .05em;
}

.auth-brand small {
  margin-top: 4px;
  color: #6b7f9c;
  font-size: .68rem;
}

.auth-copy {
  margin: 32px 0 24px;
}

.auth-copy h1 {
  margin: 6px 0 10px;
  color: #102a50;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.12;
}

.auth-copy p:not(.eyebrow),
.auth-note {
  color: #60738e;
  line-height: 1.55;
}

.auth-checking {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #526a89;
}

.auth-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #cad9ee;
  border-top-color: #1554d8;
  border-radius: 50%;
  animation: auth-spin .8s linear infinite;
}

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

.auth-form label {
  margin-top: 4px;
  color: #263f61;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #b9c9df;
  border-radius: 12px;
  background: #fff;
  color: #122b4e;
  font: inherit;
}

.auth-form input:focus-visible {
  outline: 3px solid rgba(79, 140, 255, .24);
  border-color: #2467e8;
}

.auth-status {
  min-height: 1.5em;
  margin: 4px 0 0;
  color: #a62432;
  font-size: .92rem;
  line-height: 1.4;
}

.auth-submit {
  justify-content: center;
  min-height: 48px;
  margin-top: 2px;
}

.auth-submit:disabled,
[data-auth-logout]:disabled {
  cursor: wait;
  opacity: .62;
}

.auth-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e5ebf4;
  font-size: .84rem;
}

.auth-public-summary {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dce6f5;
  border-radius: 14px;
  background: #f7f9ff;
}

.auth-public-summary h2 {
  margin: 0 0 7px;
  color: #17365f;
  font-size: 1rem;
}

.auth-public-summary p {
  margin: 0;
  color: #60738e;
  font-size: .84rem;
  line-height: 1.55;
}

.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: .82rem;
}

.auth-legal-links a {
  color: #1554d8;
  font-weight: 700;
  text-underline-offset: 3px;
}

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

@media (max-width: 520px) {
  .auth-gate {
    align-items: stretch;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

  .auth-card {
    align-self: center;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation-duration: 1.8s; }
}
