/**
 * Login / register (layouts/auth.php). Loads after site.css — uses :root tokens from there.
 */

body.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-layout .auth-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.site-header.site-header--auth {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.auth-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.auth-nav-actions {
  margin-left: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-text-link--ghost {
  font-weight: 650;
  color: var(--muted);
}

.nav-text-link--ghost:hover {
  color: var(--ocean);
}

.btn--auth-secondary {
  padding: 10px 16px;
  font-size: 13px;
}

.site-footer--auth {
  margin-top: auto;
}

.site-footer--auth .footer-bottom.auth-footer-bottom {
  border-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 18px 0 28px;
  max-width: 100%;
}

.auth-footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.auth-footer-links a {
  color: rgba(255, 255, 255, .58);
}

.auth-footer-links a:hover {
  color: #fff;
}

.auth-split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.05fr);
  min-height: min(720px, calc(100dvh - 160px));
}

.auth-aside {
  position: relative;
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 42%, #123a6e 100%);
  color: #fff;
  padding: clamp(32px, 6vw, 72px) clamp(28px, 5vw, 56px);
  overflow: hidden;
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 20% 0%, rgba(66, 180, 255, .22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(30, 107, 255, .35), transparent 50%);
  pointer-events: none;
}

.auth-aside-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.auth-aside-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
}

.auth-aside .auth-aside-title {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -.03em;
  color: #fff;
}

.auth-aside-lead {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .78);
}

.auth-checklist {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.auth-checklist li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .92);
}

.auth-checklist small {
  color: rgba(255, 255, 255, .62);
  font-weight: 500;
}

.auth-check-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--sky);
}

.auth-aside-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.auth-aside-metrics strong {
  display: block;
  font-size: 22px;
  letter-spacing: -.02em;
  color: #fff;
}

.auth-aside-metrics span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(30, 107, 255, 0.06), transparent 55%),
    var(--bg);
}

.auth-card-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  border-radius: 22px;
  border: 1px solid rgba(219, 229, 240, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #fff 40%, #fafcfe 100%);
  padding: clamp(26px, 4vw, 36px);
  box-shadow:
    0 28px 70px rgba(7, 26, 51, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset;
}

.auth-card-brand {
  margin-bottom: 22px;
}

.auth-card-logo {
  max-width: 180px;
  height: auto;
  max-height: 42px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
}

.auth-card .auth-card-title {
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 0;
  letter-spacing: -.03em;
  color: var(--navy);
}

.auth-card-sub {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.auth-form {
  margin-top: 26px;
  display: grid;
  gap: 18px;
}

.auth-form .field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #3d4f66;
}

.auth-form .field input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: var(--navy);
  transition: border-color 0.2s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)), box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form .field input:hover {
  border-color: #c5d4e8;
  background: #fff;
}

.auth-form .field input:focus {
  outline: none;
  border-color: rgba(30, 107, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.14);
}

.auth-form .field input:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 2px;
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -4px;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #4c5d73;
  cursor: pointer;
}

.auth-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--ocean);
}

.auth-link {
  font-size: 13px;
  font-weight: 800;
  color: var(--ocean);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 14px 20px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-pill, 999px);
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(165deg, #3b82ff 0%, var(--ocean) 42%, #155dfc 100%);
  color: #fff;
  box-shadow: 0 14px 32px rgba(30, 107, 255, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.18s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)), box-shadow 0.22s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(30, 107, 255, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-demo-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.auth-switch {
  margin: 22px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-switch a {
  font-weight: 800;
  color: var(--ocean);
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-aside {
    padding: 36px 24px 40px;
  }

  .auth-aside-inner {
    max-width: none;
  }

  .auth-aside-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .auth-panel {
    padding: 28px 20px 40px;
  }
}

@media (max-width: 620px) {
  .auth-top-nav {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .auth-nav-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Dark theme: aside must stay light-on-navy; card matches rest of app */
html.theme-dark .auth-aside .auth-aside-title,
html.theme-dark .auth-aside h1.auth-aside-title {
  color: #fff;
}

html.theme-dark .auth-panel {
  background: var(--bg);
}

html.theme-dark .auth-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55) 0%, #0f172a 45%, #0a0f1a 100%);
  border-color: rgba(51, 65, 85, 0.9);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

html.theme-dark .auth-card .auth-card-title {
  color: var(--heading);
}

html.theme-dark .auth-form .field label {
  color: #cbd5e1;
}

html.theme-dark .auth-form .field input {
  background: #020617;
  border-color: var(--line);
  color: #f1f5f9;
}

html.theme-dark .auth-form .field input:hover {
  border-color: #334155;
}

html.theme-dark .auth-checkbox {
  color: #cbd5e1;
}

html.theme-dark .auth-card-logo {
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
}

html.theme-dark .site-header.site-header--auth {
  background: rgba(2, 6, 23, 0.92);
  border-bottom-color: var(--line);
}

html.theme-dark .auth-switch {
  border-top-color: var(--line);
}
