/* =========================================================
AUTH STYLES — shared across /auth/*.html
Auth-specific components (hero, form-section, form-head, logo,
card grids). Tokens come from core/ds-tokens.css which is
loaded BEFORE this file in every auth HTML.

Auth surfaces ship in the Mega Ride DS V3 "hero dark" treatment
always — the cinematic Rolex / Aston Martin pattern on login
pages. Each auth HTML declares `<body data-theme="dark">` to
force the dark token set regardless of the app's default theme.

Rebranding for a new company means editing:
  1. core/ds-tokens.css     (whole-brand re-theme)
  2. core/config.js         (company strings via APP_CONFIG)
  3. assets/brand/*         (logo, hero video, favicon)

Page-specific styles stay inline in their respective .html.
========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--surface-page);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Dark mode — Personnalité vertical drama gradient (royal navy → navy-black).
   Mirrors dispatch-styles.css and the public website. The hero stays dark
   regardless (always-dark hero rule), so its background sits on top of this. */
[data-theme="dark"] body,
body.dark,
body.theme-dark {
  background:
    linear-gradient(180deg, var(--surface-page) 0%, var(--surface-gradient-end) 100%)
    var(--surface-gradient-end) fixed;
}

/* ── HERO ──
   Supports either a background image OR a <video class="hero-video"> child.
   If the video fails to load, the background-image (poster) stays visible. */
.hero {
  position: relative;
  height: 62vh;
  min-height: 300px;
  max-height: 620px;
  flex-shrink: 0;
  overflow: hidden;
  background: url('../assets/brand/login-hero-poster.jpg') center top / cover no-repeat;
  background-color: #0A1020;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48%;
  background: linear-gradient(to bottom, transparent, var(--surface-page));
  z-index: 1;
}

/* ── FORM SECTION ── */
.form-section {
  flex: 1;
  background: var(--surface-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 56px;
}
.form-wrap { width: 100%; max-width: 560px; }

/* ── Brand logo above the form title ── */
.form-logo {
  display: block;
  margin: 28px auto 18px;
  max-width: 180px;
  height: auto;
  opacity: 0.95;
}

.form-head { text-align: center; padding: 4px 0 28px; }
.form-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.2vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.form-head .kicker {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 14px;
}
.form-head p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto;
}

/* ── CARD ── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.block {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.block:last-child { border-bottom: none; }

.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.block-icon {
  width: 36px; height: 36px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.block-head-text strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
}
.block-head-text small { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* ── FIELDS ── */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 7px;
}
.field label .req { color: var(--accent-gold); }

.field-wrap { position: relative; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--surface-page);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-fast) var(--ease-std),
              background-color var(--dur-fast) var(--ease-std);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field select option { background: var(--surface-card); color: var(--text-primary); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-focus);
  background: var(--surface-elevated);
}

.sel-arrow {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; color: var(--text-muted); pointer-events: none;
}

.eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-std);
  padding: 4px;
}
.eye:hover { color: var(--text-primary); }

.col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.row-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.remember { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember input { width: 15px; height: 15px; accent-color: var(--accent-gold); }
.remember span { font-size: 13px; color: var(--text-secondary); }
.forgot {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--border-strong);
  font-weight: 400;
  transition: color var(--dur-fast) var(--ease-std),
              text-decoration-color var(--dur-fast) var(--ease-std);
}
.forgot:hover { color: var(--accent-gold); text-decoration-color: var(--accent-gold); }

/* ── MESSAGES ── */
.msg {
  display: none;
  align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid transparent;
  line-height: 1.45;
}
.msg.err  {
  background: rgba(196,107,95,0.10);
  color: var(--status-error);
  border-color: rgba(196,107,95,0.28);
}
.msg.ok   {
  background: rgba(123,174,127,0.10);
  color: var(--status-success);
  border-color: rgba(123,174,127,0.28);
}
.msg.warn {
  background: rgba(212,167,106,0.10);
  color: var(--status-warning);
  border-color: rgba(212,167,106,0.28);
}

/* ── SUBMIT / BUTTONS ── */
.submit-block { padding: 22px 24px; }

/* Primary button (DS V3 dark: ivory solid on navy) */
.btn {
  width: 100%; padding: 13px 22px;
  background: var(--action-primary-bg);
  color: var(--action-primary-text);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}
.btn:hover   { background: var(--action-primary-press); }
.btn:active  { transform: scale(0.98); }
.btn.loading { pointer-events: none; opacity: 0.55; }
.btn.verified {
  background: var(--status-success);
  color: var(--text-primary);
}

/* Secondary (ghost) — for "back", alt actions */
.btn-ghost {
  width: 100%; padding: 13px 22px;
  background: var(--action-secondary-bg);
  color: var(--action-secondary-text);
  border: 1px solid var(--action-secondary-border);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std);
}
.btn-ghost:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.back-link {
  display: block; text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-std);
}
.back-link:hover { color: var(--text-primary); }

.alt-link {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
}
.alt-link a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--border-strong);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-std),
              text-decoration-color var(--dur-fast) var(--ease-std);
}
.alt-link a:hover {
  color: var(--accent-gold);
  text-decoration-color: var(--accent-gold);
}

.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .hero { height: 46vh; min-height: 260px; }
  .col2 { grid-template-columns: 1fr; }
  .block { padding: 18px 18px; }
  .submit-block { padding: 18px; }
  .form-head { padding: 4px 0 22px; }
  .form-logo { max-width: 150px; margin: 22px auto 14px; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .hero { height: 54vh; }
  .form-wrap { max-width: 520px; }
}
@media (min-width: 769px) {
  .hero { height: 62vh; }
  .form-wrap { max-width: 580px; }
  .block { padding: 24px 28px; }
  .submit-block { padding: 24px 28px; }
}
