/* Vision Parking Systems — shared design tokens and primitives.
 *
 * One source of truth for the Platelock brand across all three surfaces:
 * the driver flow (pay.), the admin console and enforcement app (app.).
 * Palette: Night / Asphalt / Scanline / Steel / Paper.
 *
 * Contrast notes (WCAG AA against --bg):
 *   --text        ~17:1   body copy
 *   --text-muted   ~7:1   secondary copy — Steel #5A6771 is too dark for
 *                         text on Night, so it's reserved for borders/icons
 *   --accent       ~8:1   as text/border; buttons use DARK ink on accent,
 *                         because white on #00B2E3 is only ~2.4:1
 */

:root {
  /* Brand */
  --night: #0A1118;
  --asphalt: #0E161E;
  --scanline: #00B2E3;
  --steel: #5A6771;
  --paper: #F6F8F9;

  /* Semantic surfaces */
  --bg: var(--night);
  --surface: var(--asphalt);
  --surface-raised: #16212b;
  --surface-hover: #1c2a36;
  --border: #1c2833;
  --border-strong: #26343f;

  /* Text */
  --text: var(--paper);
  --text-muted: #93a1ad;
  --text-faint: var(--steel);

  /* Accent + status */
  --accent: var(--scanline);
  --accent-hover: #33c4ea;
  --accent-press: #0090b8;
  --on-accent: #04222c;        /* dark ink on cyan — readable, on-brand */
  --good: #2ecc8f;
  --warn: #f5b445;
  --danger: #ff5d5d;

  /* Geometry */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Type */
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- light theme ----------
 * Same brand, different surface. The Scanline cyan is only 2.5:1 on white,
 * so light mode uses a darker step of the SAME hue (5.0:1) — recognisably
 * the brand, but readable as link text and as a button background.
 * Steel, which was too dark for body text on Night, becomes the correct
 * muted tone here at 5.8:1.
 */
:root[data-theme="light"] {
  --bg: #F6F8F9;               /* Paper — page */
  --surface: #FFFFFF;          /* cards */
  --surface-raised: #EEF2F5;   /* inputs, chips */
  --surface-hover: #E4EAEE;
  --border: #DDE4E9;
  --border-strong: #C6D1D8;

  --text: #0E161E;             /* Asphalt — 18.2:1 */
  --text-muted: #5A6771;       /* Steel — 5.8:1 */
  --text-faint: #6E7C88;       /* 4.3:1 */

  --accent: #0077A3;           /* darker Scanline — 5.0:1 */
  --accent-hover: #00648A;
  --accent-press: #005472;
  --on-accent: #FFFFFF;        /* 5.0:1 on the accent */
  --good: #0A7D4E;             /* 5.2:1 */
  --warn: #8A5200;             /* 6.4:1 */
  --danger: #C62828;           /* 5.6:1 */
}

/* Logo lockups ship in two inks; show the one the theme needs. */
.brand-light { display: none; }
:root[data-theme="light"] .brand-dark { display: none; }
:root[data-theme="light"] .brand-light { display: block; }

/* ---------- primitives ---------- */

.vps-plate {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}

.vps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.vps-btn:hover { background: var(--accent-hover); }
.vps-btn:active { background: var(--accent-press); }
.vps-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.vps-btn--quiet {
  background: var(--surface-raised);
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.vps-btn--quiet:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.vps-btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 93, 93, 0.45);
}
.vps-btn--danger:hover { background: rgba(255, 93, 93, 0.1); }

.vps-input,
.vps-select {
  width: 100%;
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}
.vps-input:focus,
.vps-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 178, 227, 0.12);
}
.vps-input::placeholder { color: var(--text-faint); }

.vps-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.vps-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.vps-pill--good { background: rgba(46, 204, 143, 0.14); color: var(--good); }
.vps-pill--warn { background: rgba(245, 180, 69, 0.14); color: var(--warn); }
.vps-pill--bad { background: rgba(255, 93, 93, 0.13); color: var(--danger); }
.vps-pill--muted { background: var(--surface-raised); color: var(--text-muted); }
