/* portal/src/portal.css - Customer Portal, styled to portal/DESIGN.md (approved 2026-09-17).
   Website livery: dark ground, one orange, Montserrat + Open Sans (self-hosted, CSP font-src
   'self'). Dark only in v1. Mobile-first; the single breakpoint at 900px switches the sign-in
   to the split layout, the progress to the 5-segment bar and the bottom nav to the top bar.
   No third-party assets (CSP style-src 'self'). No em dashes in UI text. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Montserrat-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/Montserrat-ExtraBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/OpenSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/OpenSans-SemiBold.woff2') format('woff2');
}

:root {
  /* ground and surfaces */
  --bg: #111111;          /* page */
  --surface: #171b21;     /* cards, bars, inputs */
  --surface-2: #1c2128;   /* hover / raised */
  --well: #0d0f12;        /* media wells behind photos and video */
  --line: #262c35;        /* borders, stepper track */

  /* text */
  --ink: #fafafa;
  --ink-2: #a7adb7;       /* secondary */
  --muted: #758696;       /* captions, disabled */

  /* the one accent */
  --orange: #f97a1f;      /* site + brand kit value; NOT #F5820A (quotes) or #E8940A (email) */
  --orange-hover: #ff8a3a;
  --orange-tint: rgba(249, 122, 31, 0.12);
  --orange-line: rgba(249, 122, 31, 0.35);
  --on-orange: #111111;   /* text on orange is always black, never white (contrast) */

  /* state (a portal has states the website does not) */
  --ok: #4ade80;
  --warn: #f59e0b;
  --danger: #e02222;
}

/* Non-colour tokens, derived from DESIGN.md "Components" and "Type". */
:root {
  --head: 'Montserrat', Helvetica, Arial, sans-serif;
  --body: 'Open Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  --r-card: 12px;
  --r-ctl: 8px;
  --r-pill: 999px;
  --ring: 0 0 0 4px rgba(249, 122, 31, 0.28);
  --media-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --ctl-h: 52px;
  --tap: 44px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
[hidden] { display: none !important; }
img, video { max-width: 100%; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 600; }

h1, h2, h3, .h1, .h2 {
  margin: 0;
  font-family: var(--head);
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
}
h1, .h1 { font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 8px; }
h1 .accent, .h1 .accent { color: var(--orange); }
h2, .h2 { font-size: 16px; line-height: 1.25; margin-bottom: 8px; }
h3 { font-family: var(--body); font-weight: 600; font-size: 14px; text-transform: none; color: var(--ink); margin-bottom: 6px; }

.eyebrow {
  display: block;
  font-family: var(--head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.label, label {
  display: block;
  font-family: var(--head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ink { color: var(--ink); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-family: var(--head);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand span { color: var(--orange); }
.topbar .who { display: none; align-items: center; gap: 12px; }
.topbar .who .name {
  font-family: var(--head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 24px; }
main > section { animation: fade 160ms ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
  margin-bottom: 14px;
}
.card > h2:first-child, .card > .card-head:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }

.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- controls ---------- */
button, .btn {
  font-family: var(--head);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0 20px;
  min-height: var(--ctl-h);
  border-radius: var(--r-ctl);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
button:disabled, .btn[aria-disabled="true"] { cursor: default; }
.btn-primary { background: var(--orange); color: var(--on-orange); width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--orange-hover); }
.btn-primary:disabled { background: var(--line); color: var(--muted); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-2); }
.btn-secondary:disabled { color: var(--muted); }
.btn-outline { background: transparent; color: var(--orange); border-color: var(--orange); }
.btn-outline:hover:not(:disabled) { background: var(--orange-tint); color: var(--orange-hover); }
.btn-link {
  background: transparent;
  color: var(--orange);
  padding: 0;
  min-height: var(--tap);
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover:not(:disabled) { color: var(--orange-hover); }
.btn-icon {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-icon:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-2); }
.btn-icon svg { width: 22px; height: 22px; }

.field { margin-bottom: 16px; }
input[type="email"], input[type="text"], input[type="tel"] {
  width: 100%;
  height: var(--ctl-h);
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
  transition: border-color 120ms ease;
}
input::placeholder { color: var(--muted); }
input:hover { border-color: var(--ink-2); }
input:focus, input:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange), var(--ring);
}
input[aria-invalid="true"] { border-color: var(--danger); }
.code-input { font-family: var(--head); font-weight: 700; font-size: 26px; letter-spacing: 0.3em; text-align: center; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-family: var(--body); font-weight: 400; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.consent input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--orange);
  border-radius: 4px;
}
.consent a { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; }

.notice {
  padding: 12px 14px;
  border-radius: var(--r-ctl);
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
}
.notice-error { border-color: rgba(224, 34, 34, 0.45); background: rgba(224, 34, 34, 0.10); color: #ff8a8a; }
.notice-ok { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.10); color: var(--ok); }
.notice-info { border-color: var(--orange-line); background: var(--orange-tint); color: var(--ink); }

.turnstile { margin: 4px 0 16px; min-height: 0; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: var(--r-pill);
  font-family: var(--head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.chip-progress { color: var(--orange); background: var(--orange-tint); border-color: var(--orange-line); }
.chip-ready { color: var(--ok); background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.35); }
.chip-attention { color: var(--warn); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.chip-neutral { color: var(--ink-2); }
.chip-soon { color: var(--muted); height: 22px; font-size: 10px; padding: 0 8px; letter-spacing: 0.04em; }
.chip-soon::before { display: none; }

/* ---------- sign in / welcome: split layout ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 14px; }
.split-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px 20px; }
.split-form h1 { margin-bottom: 6px; }
.split-form .lead { margin-bottom: 20px; }

.gallery {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--well);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  min-height: 220px;
}
.gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms ease;
}
.gallery img.is-on { opacity: 1; }
.gallery .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0) 40%, rgba(17, 17, 17, 0.85) 100%);
  pointer-events: none;
}
.gallery .caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 72px;
  color: var(--ink);
}
.gallery .caption .eyebrow { margin-bottom: 4px; }
.gallery .caption .line { font-family: var(--head); font-weight: 800; font-size: 20px; line-height: 1.15; text-transform: uppercase; }
.gallery .controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gallery .dots { display: flex; gap: 0; }
.gallery .dot {
  width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
}
.gallery .dot::after { content: ''; display: block; width: 8px; height: 8px; margin: 0 auto; border-radius: 50%; background: rgba(250, 250, 250, 0.45); transition: transform 120ms ease, background-color 120ms ease; }
.gallery .dot[aria-current="true"]::after { background: var(--orange); transform: scale(1.35); }
.gallery .arrows { display: flex; gap: 8px; }
.gallery .btn-icon { background: rgba(17, 17, 17, 0.7); border-color: rgba(250, 250, 250, 0.18); }

/* ---------- trailer list ---------- */
.trailer-list { display: grid; gap: 12px; }
.trailer-item {
  display: flex;
  width: 100%;
  min-height: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 20px;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.trailer-item:hover { border-color: var(--orange); background: var(--surface-2); }
.trailer-item .model { font-family: var(--head); font-weight: 800; font-size: 16px; text-transform: uppercase; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.trailer-item .meta { color: var(--muted); font-size: 13px; }

/* ---------- trailer head ---------- */
.trailer-head .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.trailer-head .facts { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.trailer-head .facts b { color: var(--ink-2); font-weight: 600; }

/* ---------- progress ---------- */
/* One list, two renderings: vertical timeline (default) and the 5-segment bar (>= 900px). */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 20px 34px; }
.steps li::before {
  /* connector */
  content: '';
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::before { display: none; }
.steps .dot {
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps .dot svg { width: 12px; height: 12px; display: none; }
.steps .name { font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.steps .when, .steps .detail { font-size: 13px; color: var(--muted); }
.steps .detail { color: var(--ink-2); }
.steps li.done::before { background: var(--orange); }
.steps li.done .dot { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.steps li.done .dot svg { display: block; }
.steps li.done .name { color: var(--ink-2); }
.steps li.current .dot { border-color: var(--orange); background: var(--surface); box-shadow: 0 0 0 4px var(--orange-tint); }
.steps li.current .dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.steps li.current .name { color: var(--orange); }
.steps li.current .detail { color: var(--ink); }
.steps li.pending .name { color: var(--muted); }
.collected-line { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.collected-line svg { width: 18px; height: 18px; color: var(--ok); }

/* ---------- hero / media ---------- */
.card.hero { padding: 0; overflow: hidden; }
.hero .hero-body { padding: 16px 20px 20px; }
.well { background: var(--well); border-radius: var(--r-ctl); overflow: hidden; }
.hero .well { border-radius: 0; }
.hero video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--well); }
.media-empty {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.media-empty svg { width: 32px; height: 32px; color: var(--ink-2); }

.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photos figure { margin: 0; background: var(--well); border-radius: var(--r-ctl); overflow: hidden; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photos figcaption { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.photo-group { margin-top: 14px; }
.photo-group:first-child { margin-top: 0; }
.photo-group h3 { margin-bottom: 8px; }

/* ---------- ack + requests ---------- */
.ack-done { color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ack-done svg { width: 18px; height: 18px; flex: 0 0 auto; }

.requests { display: grid; gap: 10px; }
.request {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  justify-content: flex-start;
}
.request svg { width: 24px; height: 24px; color: var(--orange); flex: 0 0 auto; }
.request .txt { flex: 1 1 auto; }
.request .txt small { display: block; font-weight: 400; font-size: 12px; line-height: 1.35; color: var(--muted); margin-top: 2px; }
.request:disabled { color: var(--muted); }
.request:disabled svg { color: var(--muted); }

/* ---------- account ---------- */
.account dl { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.account dt { color: var(--muted); }
.account dd { margin: 0; color: var(--ink); font-weight: 600; }

/* ---------- bottom nav (phone) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.bottom-nav button {
  min-height: var(--nav-h);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
}
.bottom-nav button svg { width: 24px; height: 24px; }
.bottom-nav button[aria-current="page"] { color: var(--orange); }
.bottom-nav button:disabled { color: var(--muted); opacity: 0.6; }
.bottom-nav button:focus-visible { box-shadow: inset var(--ring); }

/* ---------- footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 16px 24px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--ink-2); }

/* ---------- notice page (static) ---------- */
.notice-page h2 { margin-top: 18px; }
.notice-page ul { padding-left: 20px; }

/* ---------- desktop (>= 900px) ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .topbar { padding: 0 32px; }
  .topbar .who { display: flex; }
  .topbar .who .btn-secondary { min-height: 44px; padding: 0 16px; font-size: 12px; }
  main { max-width: 1120px; padding: 28px 32px 40px; }
  h1, .h1 { font-size: 36px; }
  .card { padding: 24px; }

  .split { grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px); gap: 24px; align-items: stretch; }
  .split-form { padding: 36px 36px 32px; align-self: center; }
  .gallery { aspect-ratio: auto; min-height: 560px; height: 100%; }
  .gallery .caption { left: 28px; right: 28px; bottom: 84px; }
  .gallery .caption .line { font-size: 28px; }
  .gallery .controls { left: 20px; right: 20px; bottom: 20px; }

  .trailer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px 20px; align-items: start; }
  .trailer-grid .col-main, .trailer-grid .col-side { display: grid; gap: 14px; }
  .trailer-grid .card { margin-bottom: 0; }

  /* 5-segment bar */
  .steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .steps li { padding: 0; }
  .steps li::before { display: none; }
  .steps .dot { position: static; width: auto; height: 6px; border-radius: 3px; border: 0; background: var(--line); margin-bottom: 10px; box-shadow: none; display: block; overflow: hidden; }
  .steps .dot svg { display: none !important; }
  .steps li.done .dot { background: var(--orange); }
  .steps li.current .dot { background: linear-gradient(90deg, var(--orange) 0 50%, var(--line) 50% 100%); box-shadow: none; }
  .steps li.current .dot::after { display: none; }
  .steps .name { font-size: 12px; }
  .steps .when, .steps .detail { font-size: 12px; }
  .photos { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
