:root {
  --auth-brand: #2563eb;
  --auth-brand-hover: #1e40af;
  --auth-brand-contrast: #fff;
  --auth-link: #1d4ed8;
}

* { box-sizing: border-box; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: #f3f4f6;
  color: #111827;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-wrap { width: 100%; max-width: 32.5rem; }
.auth-wrap--wide { max-width: 58rem; }

.auth-card {
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 1.125rem;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

.auth-accent {
  height: .4375rem;
  background: var(--auth-brand);
}

.auth-card-inner { padding: 1.75rem 2rem 2rem; }
.auth-header { margin-bottom: 1.5rem; text-align: center; }
.auth-logo-link { display: inline-flex; justify-content: center; max-width: 100%; }
.auth-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 7.5rem;
  max-height: 4.5rem;
  margin: 0 auto 1rem;
  object-fit: contain;
}
.auth-logo--platform {
  width: 4.5rem;
  height: 4.5rem;
  color: var(--auth-brand);
}
.auth-logo--fallback {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  letter-spacing: -.03em;
}
.auth-title { margin: 0; color: #111827; font-size: 1.5rem; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.auth-description { margin-top: .65rem; color: #4b5563; font-size: .925rem; line-height: 1.55; }
.auth-description a, .auth-secondary a, .auth-content a { color: var(--auth-link); font-weight: 600; }
.auth-content { color: #374151; font-size: .925rem; line-height: 1.55; }
.auth-content > * + * { margin-top: 1.25rem; }
.auth-content form > * + * { margin-top: 1.1rem; }

.auth-field label, .auth-content label {
  display: block;
  margin: 0 0 .4rem;
  color: #111827;
  font-size: .875rem;
  font-weight: 600;
}
.auth-content input:not([type="checkbox"]):not([type="radio"]),
.auth-content select,
.auth-content textarea {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: .7rem .8rem;
  border: 1px solid #d1d5db;
  border-radius: .5625rem;
  background: #fff;
  color: #111827;
  font: inherit;
}
.auth-content textarea { min-height: 7rem; }
.auth-content input::placeholder, .auth-content textarea::placeholder { color: #6b7280; opacity: 1; }
.auth-content input:focus, .auth-content select:focus, .auth-content textarea:focus {
  border-color: var(--auth-brand);
  outline: 3px solid color-mix(in srgb, var(--auth-brand) 24%, transparent);
  outline-offset: 1px;
}
.auth-content input[aria-invalid="true"], .auth-content .auth-input-error {
  border-color: #dc2626;
  background: #fff;
}
.auth-error, .auth-content .errorlist { color: #b91c1c; font-size: .875rem; }
.auth-content .errorlist { margin: .4rem 0 0; padding-left: 1.2rem; }

.auth-alert {
  padding: .8rem .9rem;
  border: 1px solid #fecaca;
  border-radius: .6rem;
  background: #fef2f2;
  color: #991b1b;
  font-size: .875rem;
}
.auth-alert--success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.auth-alert--warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }

.auth-primary, .auth-content button[type="submit"], .auth-content a.auth-primary {
  display: inline-flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border: 0;
  border-radius: .5625rem;
  background: var(--auth-brand);
  color: var(--auth-brand-contrast);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.auth-primary:hover, .auth-content button[type="submit"]:hover { background: var(--auth-brand-hover); }
.auth-primary:focus-visible, .auth-content button:focus-visible, .auth-content a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--auth-brand) 30%, transparent);
  outline-offset: 3px;
}
.auth-primary:disabled, .auth-content button:disabled { cursor: not-allowed; opacity: .6; }
.auth-secondary { margin-top: 1.25rem; color: #4b5563; text-align: center; font-size: .875rem; }
.auth-footer { margin-top: 1.25rem; color: #6b7280; text-align: center; font-size: .75rem; }
.auth-footer a { color: inherit; }
.auth-readonly { padding: .75rem .9rem; border-radius: .5625rem; background: #f3f4f6; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 36rem) {
  .auth-page { align-items: start; padding: 1rem .75rem; }
  .auth-card-inner { padding: 1.4rem 1.15rem 1.5rem; }
  .auth-title { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
