/* auth.css — split-screen login (+ shared auth surfaces).
 *
 * Theme-aware via tokens.css (`[data-theme]` flips --bg-*, --fg-*, --border-*,
 * accents) — so light/dark "just work". The ONE thing not token-driven is the
 * hero photo, which is swapped per data-theme below. The photos are dropped in
 * as /login-hero-dark.jpg and /login-hero-light.jpg; until they exist a themed
 * gradient + page color shows through (no broken-image state).
 *
 * Prefix: .au-*  (bump _VERSION["auth.css"] in _surface_css.py on every edit).
 */

.au-root {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  color: var(--fg-1);
  /* Three background layers (top -> bottom):
       1. legibility scrim (keeps the left-panel text readable over the photo)
       2. the truck-yard hero photo (clean scene, no UI)
       3. a branded gradient FALLBACK shown only if the photo is ever missing.
     So the page looks intentional with OR without the photo. */
  background-color: var(--bg-page);
  background-image:
    linear-gradient(rgba(10, 15, 28, 0.40), rgba(10, 15, 28, 0.68)),
    url("/login-hero-dark.jpg?v=2"),
    linear-gradient(155deg, #16213c 0%, #0a0f1c 58%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
[data-theme="light"] .au-root {
  background-color: var(--bg-page);
  background-image:
    linear-gradient(rgba(244, 247, 251, 0.50), rgba(244, 247, 251, 0.78)),
    url("/login-hero-light.jpg"),
    linear-gradient(155deg, #ffffff 0%, #dbe4f0 62%);
}

/* ---- Left branding panel ---- */
.au-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 56px clamp(32px, 6vw, 96px);
}
.au-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.au-mark {
  width: 168px;
  max-width: 60%;
  height: auto;
  color: var(--accent-400);
}
.au-wordmark {
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg-1);
}
.au-wordmark .hq {
  color: var(--accent-400);
}
.au-rule {
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent-500);
  margin-top: 4px;
}
.au-tagline {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--fg-1);
  margin: 0;
}

.au-features {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 6px;
}
.au-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  max-width: 460px;
}
.au-feature-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-500);
  border-radius: 12px;
  color: var(--accent-400);
  background: color-mix(in srgb, var(--accent-500) 10%, transparent);
}
.au-feature-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--fg-1);
}
.au-feature-desc {
  font-size: 14px;
  line-height: 1.45;
  /* --fg-2 (body) reads well on the DARK hero. The light hero (bright sky) needs
     more — see the [data-theme="light"] override below. */
  color: var(--fg-2);
  margin-top: 2px;
}
[data-theme="light"] .au-feature-desc {
  /* Near-black + a soft white halo so the small description text stays legible
     over the bright daytime photo (bright sky behind the top rows, trucks
     behind the lower ones). */
  color: var(--fg-1);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* ---- Right card column ---- */
.au-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(24px, 4vw, 64px);
}
.au-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: 18px;
  padding: clamp(28px, 3vw, 44px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .au-card {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}
.au-card-title {
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  color: var(--fg-1);
  margin: 0;
}
.au-card-sub {
  text-align: center;
  color: var(--fg-3);
  font-size: 15px;
  margin: 6px 0 26px;
}

.au-field {
  margin-bottom: 18px;
}
.au-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.au-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.au-input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--accent-400);
  pointer-events: none;
}
.au-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 13px 14px 13px 44px;
  font-size: 15px;
  color: var(--fg-1);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.au-input::placeholder {
  color: var(--fg-4);
}
.au-input:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-400) 22%, transparent);
}
.au-input.has-eye {
  padding-right: 46px;
}
.au-eye {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--fg-3);
  border-radius: 8px;
  cursor: pointer;
}
.au-eye:hover {
  color: var(--accent-400);
  background: var(--bg-hover);
}

.au-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -2px 0 20px;
}
.au-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent-400);
  font-size: 14px;
  font-weight: 600;
}
.au-link:hover {
  color: var(--accent-300);
}

.au-btn {
  width: 100%;
  background: var(--brand-cta);
  color: var(--brand-cta-fg);
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.au-btn:hover {
  background: var(--brand-cta-hover);
}

.au-error {
  background: color-mix(in srgb, #ef4444 16%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 45%, transparent);
  color: #fca5a5;
  font-size: 14px;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
[data-theme="light"] .au-error {
  color: #b91c1c;
}

.au-foot {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--fg-3);
}
.au-foot a {
  color: var(--accent-400);
  font-weight: 600;
  text-decoration: none;
}
.au-foot a:hover {
  color: var(--accent-300);
}

/* Public policy links (Home · Privacy · Terms · SMS Policy) — reviewer-reachable
   from the login screen. Subtler than .au-foot; legible in both themes. */
.au-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
}
.au-legal-link {
  color: var(--fg-3);
  font-size: 12px;
  text-decoration: none;
}
.au-legal-link:hover {
  color: var(--accent-400);
  text-decoration: underline;
}
.au-legal-sep {
  color: var(--fg-4);
  font-size: 11px;
}

/* ---- Theme toggle (fixed, top-right) ---- */
.au-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  color: var(--accent-400);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.au-toggle:hover {
  border-color: var(--accent-400);
}

/* ---- Responsive: collapse to a single centered column on phones ---- */
@media (max-width: 900px) {
  .au-root {
    grid-template-columns: 1fr;
    background-attachment: scroll;
  }
  .au-left {
    padding: 40px 28px 8px;
    gap: 18px;
    text-align: center;
    align-items: center;
  }
  .au-mark {
    width: 120px;
  }
  .au-features {
    display: none; /* keep the phone login focused on the form */
  }
  .au-feature {
    margin: 0 auto;
  }
  .au-right {
    padding: 12px 20px 48px;
  }
}
