:root {
  --auth-primary: #0D63D8;
  --auth-navy: #011938;
  --auth-accent: #E2A718;
  --auth-bg: #F5F6F8;
  --auth-surface: #FFFFFF;
  --auth-surface-strong: #FFFFFF;
  --auth-text: #101D33;
  --auth-muted: #667085;
  --auth-border: #E5E8EE;
  --auth-shadow: 0 8px 28px rgba(16, 29, 51, .12);
}

* { box-sizing: border-box; }

body.auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-text);
  background: var(--auth-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.auth-page::after {
  position: fixed;
  content: "✚";
  right: 8vw;
  bottom: 2vh;
  z-index: 0;
  color: rgba(1, 25, 56, .035);
  font-size: 25rem;
  font-weight: 800;
  line-height: .7;
  pointer-events: none;
}

body.auth-page.auth-dark {
  --auth-bg: #011938;
  --auth-surface: #0B2A4D;
  --auth-surface-strong: #0B2A4D;
  --auth-text: #F5F6F8;
  --auth-muted: #B8C3CE;
  --auth-border: rgba(255, 255, 255, .16);
  --auth-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-frame {
  width: min(520px, 100%);
  min-height: 0;
  display: block;
  overflow: hidden;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
}

.auth-visual {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.25rem;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--auth-primary) 94%, #000), var(--auth-primary));
  isolation: isolate;
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  opacity: .18;
  z-index: -1;
}

.auth-visual::before {
  width: 360px;
  height: 360px;
  right: -150px;
  top: -120px;
  background: var(--auth-accent);
}

.auth-visual::after {
  width: 260px;
  height: 260px;
  left: -130px;
  bottom: -90px;
  border: 1px solid #fff;
}

.auth-visual-brand,
.auth-form-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  font-weight: 700;
  letter-spacing: -.02em;
}

.auth-visual-brand img,
.auth-form-brand img {
  width: auto;
  height: 118px;
  max-width: 230px;
  object-fit: contain;
}

.auth-visual-copy {
  max-width: 390px;
  margin: auto 0;
}

.auth-visual-copy .eyebrow {
  color: color-mix(in srgb, var(--auth-accent) 82%, #fff);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-visual-copy h1 {
  margin: .9rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.auth-visual-copy p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 1.02rem;
  line-height: 1.7;
}

.auth-visual-quote {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .75);
  font-size: .9rem;
  line-height: 1.6;
}

.auth-form {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.35rem 2.25rem 1.6rem;
  background: var(--auth-surface-strong);
}

.auth-form-header {
  margin-bottom: 1.65rem;
  text-align: center;
}

.auth-form-brand {
  margin: 0 auto 1.1rem;
  flex-direction: column;
  gap: .35rem;
  color: var(--auth-text);
}

.auth-form-brand strong { font-size: 1rem; }

.auth-kicker {
  display: none;
  margin-bottom: .55rem;
  color: var(--auth-primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-dark .auth-kicker { color: color-mix(in srgb, var(--auth-accent) 82%, #fff); }

.auth-form h2 {
  margin: 0 0 .6rem;
  color: var(--auth-text);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -.04em;
}

.auth-form-header p,
.auth-form-footer,
.auth-help {
  color: var(--auth-muted);
  line-height: 1.65;
}

.auth-form-header p { margin: 0; }

.auth-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .45rem;
  color: var(--auth-text);
  font-size: .88rem;
  font-weight: 650;
}

.auth-field { position: relative; margin-bottom: 1.1rem; }

.auth-control {
  width: 100%;
  min-height: 52px;
  padding: .75rem 3rem .75rem 1rem;
  border: 1px solid var(--auth-border);
  border-radius: 13px;
  outline: none;
  color: var(--auth-text);
  background: color-mix(in srgb, var(--auth-surface-strong) 88%, var(--auth-bg));
  transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-control::placeholder { color: color-mix(in srgb, var(--auth-muted) 75%, transparent); }
.auth-control:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-primary) 16%, transparent); }
.auth-control.is-invalid { border-color: #dc3545; }

.auth-field-icon,
.auth-password-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-muted);
}

.auth-field-icon { left: 1rem; pointer-events: none; }
.auth-control.has-icon { padding-left: 2.8rem; }
.auth-password-toggle { right: .75rem; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.auth-password-toggle:focus { color: var(--auth-primary); outline: 0; }

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: .35rem;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--auth-primary);
  box-shadow: none;
  font-weight: 700;
  letter-spacing: .01em;
}

.auth-submit:hover,
.auth-submit:focus { color: #fff; filter: brightness(1.08); }

.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.auth-link { color: var(--auth-primary); font-size: .9rem; font-weight: 650; text-decoration: none; }
.auth-dark .auth-link { color: color-mix(in srgb, var(--auth-accent) 82%, #fff); }
.auth-link:hover { text-decoration: underline; }

.auth-alert { border: 0; border-radius: 13px; font-size: .9rem; }
.auth-alert.alert-danger { color: #842029; background: #f8d7da; }
.auth-alert.alert-info { color: #055160; background: #cff4fc; }
.auth-alert.alert-success { color: #0f5132; background: #d1e7dd; }

.auth-theme-toggle {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-muted);
  background: transparent;
}

.auth-theme-toggle:hover { color: var(--auth-primary); background: color-mix(in srgb, var(--auth-primary) 8%, transparent); }

.auth-form-footer { margin-top: auto; padding-top: 2rem; font-size: .82rem; }
.auth-form-footer a { color: inherit; }
.auth-required { color: #dc3545; }

@media (max-width: 820px) {
  .auth-shell { width: min(560px, calc(100% - 1rem)); padding: .5rem 0; }
  .auth-frame { min-height: auto; grid-template-columns: 1fr; border-radius: 22px; }
  .auth-visual { display: none; }
  .auth-form { min-height: calc(100vh - 1rem); padding: 2.5rem clamp(1.25rem, 7vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-control { transition: none; }
}
