/* =====================================================================
   wavestripe.app — auth (login + signup)
   Mobile-first. Mirrors screens 02 (signup) + 03 (login) of the design
   mockup: back-button → heading → sub → form → primary → [warn] → alt.
   Desktop ≥960px adds a split-pane preview on the right (Fisker photo +
   product-shot + checklist), recreating the mockup's `.dt-preview`
   styling scoped to `.auth-side .preview`.
   Inherits tokens & primitives from /static/tokens.css.
   ===================================================================== */

body {
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* top brand bar (mobile + desktop) */
.auth-topbar {
  /* Brand left, A− / A+ right — the text-size pair is the only other thing
     in this bar, and a reader who needs 130% needs it on the login form
     just as much as inside the app. */
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 13, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.auth-topbar .brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 800; font-size: 1rem; letter-spacing: -0.01em;
}
.auth-topbar .brand:hover { text-decoration: none; }
.auth-topbar .brand .logo { width: 28px; height: 28px; }
.auth-topbar .brand .dot { color: var(--accent); }

/* layout — single column on mobile, split-pane on desktop */
.auth-page {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .auth-page { grid-template-columns: 1fr 1fr; }
}

/* form column */
.auth-col {
  display: flex; align-items: center; justify-content: center;
  padding: 36px 22px;
}
.auth-wrap {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column;
  gap: 14px;
}

/* back-button (mockup .back) */
.auth-wrap .back {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surf-1);
  border: 1px solid var(--border-soft);
  display: grid; place-items: center;
  color: var(--fg);
  margin-bottom: 6px;
  transition: border-color .15s, background .15s;
}
.auth-wrap .back:hover {
  border-color: var(--accent);
  text-decoration: none;
  background: var(--surf-2);
}
.auth-wrap .back svg { width: 18px; height: 18px; }

/* heading + sub — match mockup typography (24/13, weight 700) */
.auth-wrap h1 {
  font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.02em;
  font-weight: 700;
  margin: 6px 0 6px;
  color: var(--fg);
}
@media (min-width: 1024px) {
  .auth-wrap h1 { font-size: 1.75rem; }
}
.auth-wrap .sub {
  color: var(--fg-mute); font-size: 0.8125rem;
  margin: 0 0 8px;
}

/* form */
.auth-wrap form {
  display: flex; flex-direction: column; gap: 14px;
  margin: 0;
}
.auth-wrap form .btn {
  padding: 14px 18px; font-size: 0.9375rem;
  border-radius: var(--r-md);
}
.auth-wrap .hint {
  font-size: 0.75rem; color: var(--fg-mute);
  margin: -8px 0 0;
}

/* error — empty by default, fills out as alert chip */
.auth-wrap .err {
  color: var(--bad); font-size: 0.8125rem;
  min-height: 0;
  display: flex; align-items: center; gap: 8px;
  margin: 0;
}
.auth-wrap .err:empty { display: none; }
.auth-wrap .err:not(:empty) {
  padding: 10px 12px;
  background: var(--bad-soft);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
}
.auth-wrap .err:not(:empty)::before {
  content: "";
  width: 14px; height: 14px; flex-shrink: 0;
  background-color: var(--bad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* alt link below form */
.auth-wrap .alt {
  text-align: center; color: var(--fg-mute);
  font-size: 0.8125rem; margin: 6px 0 0;
}
.auth-wrap .alt a { color: var(--accent); font-weight: 600; }

/* ios warning chip — sits below the primary button on signup */
.auth-wrap .ios-warn {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  background: var(--warn-soft);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  color: #fbcc73; font-size: 0.75rem; line-height: 1.45;
  margin: 0;
}
.auth-wrap .ios-warn svg {
  width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px;
}

/* terms + privacy footer */
.auth-wrap .legal {
  font-size: 0.6875rem; color: var(--fg-dim); text-align: center;
  margin: 8px 0 0;
}
.auth-wrap .legal a { color: var(--fg-mute); }

/* =====================================================================
   side preview pane — desktop only (≥960px)
   Recreates the mockup's .dt-preview product-shot scoped to .auth-side.
   ===================================================================== */
.auth-side {
  display: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-left: 1px solid var(--border-soft);
}
@media (min-width: 1024px) {
  .auth-side { display: block; }
}
.auth-side .photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: contrast(1.05) saturate(1.05);
  z-index: 0;
}
.auth-side .veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(160deg, rgba(6, 8, 13, 0.30) 0%, rgba(6, 8, 13, 0.55) 50%, rgba(6, 8, 13, 0.92) 100%),
    radial-gradient(60% 50% at 15% 20%, rgba(34, 211, 238, 0.18), transparent 70%);
  z-index: 1;
}
.auth-side .wrap {
  position: relative; z-index: 2;
  max-width: 440px; margin: 0 auto;
  padding: 64px 32px;
  display: flex; flex-direction: column; gap: 22px;
  min-height: 100%;
  justify-content: flex-end;
}
.auth-side h2 {
  font-size: clamp(1.625rem, 3vw, 2.125rem);
  letter-spacing: -0.02em; font-weight: 800;
  margin: 0 0 6px; line-height: 1.1;
}
.auth-side h2 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-side > .wrap > p {
  color: var(--fg-soft); font-size: 0.875rem;
  margin: 0; line-height: 1.55;
}

/* product-shot card — mirrors .dt-preview */
.auth-side .preview {
  position: relative;
  border-radius: 16px;
  padding: 16px;
  background: rgba(11, 16, 24, 0.78);
  border: 1px solid rgba(34, 211, 238, 0.22);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow:
    0 30px 80px -20px rgba(34, 211, 238, 0.22),
    0 12px 30px rgba(0, 0, 0, 0.55);
}
.auth-side .preview .h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.auth-side .preview .h b { font-size: 0.8125rem; }
.auth-side .preview .h .vin {
  font-family: var(--ff-mono); font-size: 0.6875rem; color: var(--fg-mute);
  margin-top: 2px;
}
.auth-side .preview .stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.auth-side .preview .s {
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.auth-side .preview .s .v {
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em;
}
.auth-side .preview .s .v .u {
  font-size: 0.625rem; color: var(--fg-mute); font-weight: 500; margin-left: 2px;
}
.auth-side .preview .s .l {
  font-size: 0.625rem; color: var(--fg-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 2px;
}

/* checklist below the product-shot */
.auth-side .checklist {
  display: flex; flex-direction: column; gap: 10px;
  margin: 6px 0 0; padding: 0; list-style: none;
}
.auth-side .checklist li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.8125rem; color: var(--fg-soft);
  line-height: 1.5;
}
.auth-side .checklist svg {
  width: 16px; height: 16px; color: var(--ok);
  flex-shrink: 0; margin-top: 2px;
}

/* email-confirmation (double opt-in) — inbox panel + login resend.
   Buttons live OUTSIDE the <form>, so they don't inherit `.auth-wrap form .btn`;
   restate the box + a primary/ghost fill here so they match the form button. */
.verify-notice { display: flex; flex-direction: column; gap: 14px; }
.verify-inline { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.verify-notice .btn,
.verify-inline .btn {
  padding: 14px 18px; font-size: 0.9375rem; font-weight: 600;
  border-radius: var(--r-md); cursor: pointer;
  border: 1px solid var(--accent);
}
.verify-notice .btn-primary { background: var(--accent); color: #001218; }
.verify-inline .btn-ghost {
  background: transparent; color: var(--accent);
  align-self: flex-start; padding: 10px 14px; font-size: 0.875rem;
}
.verify-notice .btn[disabled],
.verify-inline .btn[disabled] { opacity: 0.55; cursor: default; }
