/* ─────────────────────────────────────────────────────────────────────────
   Auto Pals USA — design tokens

   Single source of truth for color, type, spacing, motion, and elevation.
   Linked from every public page (home/booking/portal/form/404/terms/privacy)
   so the visual language stays in lockstep across the site.

   Each page's own <style> block still works — values declared locally take
   precedence over values here because the inline <style> ships after this
   linked file in the document head. Use that override for page-specific
   tweaks rather than forking tokens.
   ──────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Palette ──────────────────────────────────────────────────────────
     The brand: cream + navy with green as the accent. Numbers map to
     usage intent, not to a Material-style numeric scale. */
  --cream:       #f5f0e8;
  --cream-dark:  #ede5d4;
  --white:       #fffdf7;

  --navy:        #0f2557;
  --navy-mid:    #1a3470;
  --navy-light:  #e8edf8;

  --brg:         #1a5c32;        /* "British racing green" — primary accent */
  --brg-light:   #e8f0e8;

  --green:       #1a5c32;
  --green-light: #e8f0e8;
  --amber:       #92400e;
  --amber-light: #fffbeb;
  --red:         #b91c1c;
  --red-light:   #fef2f2;

  --text:        #1a1a2e;        /* primary ink on light bg */
  --text-muted:  #5a6480;        /* secondary ink */

  /* ── Surfaces (semantic) ───────────────────────────────────────────── */
  --bg:          var(--cream);      /* default page background */
  --bg-sunken:   var(--cream-dark); /* slightly recessed area (inputs, FAQ rows) */
  --bg-elevated: var(--white);      /* cards / sheets sitting above bg */

  /* ── Borders ───────────────────────────────────────────────────────── */
  --border:         #ddd5c0;                /* divider lines, table rows, inputs */
  --border-subtle:  rgba(15,37,87,0.08);    /* card outlines; outline does less work,
                                               --shadow-card does the lifting */

  /* ── Shadows / elevation ───────────────────────────────────────────── */
  --shadow:    0 2px 16px rgba(15,37,87,0.10);
  --shadow-lg: 0 8px 40px rgba(15,37,87,0.14);
  --shadow-card:
    0 1px 1px rgba(15,37,87,0.04),
    0 2px 4px rgba(15,37,87,0.04),
    0 8px 24px rgba(15,37,87,0.06);
  --shadow-card-hover:
    0 1px 1px rgba(15,37,87,0.05),
    0 4px 8px rgba(15,37,87,0.05),
    0 14px 32px rgba(15,37,87,0.10);

  /* ── Radii ─────────────────────────────────────────────────────────── */
  --radius-sm:  6px;
  --radius:     10px;             /* default card / input radius */
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-pill: 99px;

  /* ── Type scale ────────────────────────────────────────────────────── */
  /* Modular (~1.18 ratio), tuned to the existing site, not a fresh palette */
  --text-xs:    11px;
  --text-sm:    12px;
  --text-base:  13px;
  --text-md:    14px;
  --text-lg:    15px;
  --text-xl:    17px;
  --text-2xl:   20px;
  --text-3xl:   24px;
  --text-4xl:   28px;
  --text-5xl:   36px;
  --text-6xl:   48px;

  /* ── Spacing scale (4px base) ──────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ── Motion ────────────────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);    /* strong out, for entries / UI feedback */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);   /* strong in-out, for on-screen movement */

  --dur-fast:   120ms;   /* small UI feedback (button presses, hovers) */
  --dur-base:   200ms;   /* dropdowns, tooltips */
  --dur-slow:   400ms;   /* modals, drawers, reveals */

  /* ── Focus ─────────────────────────────────────────────────────────── */
  --focus-ring: 2px solid var(--navy);
  --focus-offset: 3px;
}

/* ── Reduced-motion (global) ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Selection (global) ──────────────────────────────────────────────── */
::selection { background: var(--navy); color: var(--cream); }

/* ── Focus rings (global) ────────────────────────────────────────────── */
/* Keyboard navigation gets a visible ring; mouse clicks don't — clicking
   already gives interaction feedback, an outline on top of that reads as
   noisy. Individual elements can opt back in with explicit :focus rules. */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

/* ── Body text smoothing (global) ────────────────────────────────────── */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
}

/* ── Reusable component classes ──────────────────────────────────────── */
/* Each class is opt-in; pages still drive their own structure. Reach for
   these instead of re-inlining the same recipe in three different places. */

/* Pill-shaped badge for small status indicators (e.g. "5 of 5", "Deposit
   Confirmed"). Inline-flex so trailing/leading icons line up with the
   baseline of the label text. */
.u-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

/* Framed icon tile — used wherever a small Lucide-style icon needs a
   chip-like container (info detail rows, document type, hero status). */
.u-icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  color: var(--navy);
  flex-shrink: 0;
}
.u-icon-tile--sm { width: 32px; height: 32px; border-radius: var(--radius); }
.u-icon-tile--lg { width: 44px; height: 44px; border-radius: var(--radius-md); }
.u-icon-tile svg { width: 16px; height: 16px; }
.u-icon-tile--lg svg { width: 22px; height: 22px; }

/* Empty-state pattern: framed icon + heading + supporting copy. Use in
   panels/cards that have nothing to show yet. */
.u-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  gap: var(--space-1);
}
.u-empty-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--navy);
  margin-bottom: var(--space-3);
}
.u-empty-title {
  font-size: var(--text-md); font-weight: 700;
  color: var(--text); margin-bottom: var(--space-1);
}
.u-empty-desc {
  font-size: var(--text-base); color: var(--text-muted);
  line-height: 1.6; max-width: 320px;
}

/* Visually-hidden helper for screen-reader-only text. */
.u-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
