/* =====================================================================
   FastPark Roissy — feuille commune à tout le logiciel
   Design system « fastpark-civic » (voir design/fastpark-civic.md).
   Chargée en premier par toutes les pages, sans exception. Une couleur,
   une police, un rayon ou un bouton se changent ici et nulle part ailleurs.
   Par-dessus, chaque famille de pages n'ajoute que sa mise en page :
     site.css + reservation.css   site public
     crm.css                      CRM
     app.css                      espace client, suivi, chauffeur, connexion
     screen.css                   écrans muraux
   ===================================================================== */

:root {
  /* Marque — navy */
  --navy-950: #081a30;
  --navy-900: #0c2340;
  --navy-800: #0f2d52;
  --navy-700: #1a4580;
  --navy-300: #9db8e6;
  --navy-100: #e2e8f3;

  /* Accent — ambre */
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-300: #fcd34d;
  --amber-100: #fdecc8;

  /* Papier */
  --creme-50:  #fbf9f5;
  --creme-100: #f6f3ee;
  --creme-200: #ebe6dd;
  --creme-300: #dcd5c8;

  /* Tertiaire — bleu de marque, avec parcimonie */
  --blue-600: #2563eb;
  --blue-50:  #e6eefc;

  /* Rôles */
  --bg: var(--creme-100);
  --bg-alt: var(--creme-200);
  --surface: #fffdf9;
  --surface-2: #f3eee6;
  --row-hover: #faf6ef;
  --ink: #14182a;
  --ink-mut: #4b5163;
  --ink-dim: #5d6272;
  --line: #e2dcd1;
  --line-strong: #cfc7b8;
  --brand: var(--navy-800);
  --brand-fast: var(--navy-800);
  --brand-park: var(--amber-600);
  --accent-text: #9c4508;
  --link: var(--navy-700);
  --focus: var(--blue-600);
  --overlay: rgba(8, 26, 48, .5);
  --header-bg: rgba(246, 243, 238, .86);

  /* États : texte + fond pâle pour les pastilles, « solid » pour les aplats à texte blanc */
  --ok: #166534;   --ok-bg: #e5f3e8;   --ok-solid: #15803d;
  --warn: #9c4508; --warn-bg: #fbebd0;
  --err: #b91c1c;  --err-bg: #f9e5e2;  --err-solid: #b91c1c;
  --info: #1d4ed8; --info-bg: var(--blue-50); --info-solid: #1d4ed8;

  /* Boutons navy */
  --primary-bg: var(--navy-800);
  --primary-bg-hover: var(--navy-700);
  --on-primary: #ffffff;

  /* Bandes sombres */
  --band-dark: var(--navy-950);
  --cta-bg: var(--navy-900);
  --on-dark: #f2f5f9;
  --on-dark-mut: #b6c3d4;
  --on-dark-line: rgba(255, 255, 255, .14);

  /* Une tuile par couleur */
  --tile-navy: var(--navy-100);   --tile-navy-ink: var(--navy-800);
  --tile-amber: var(--amber-100); --tile-amber-ink: #8a3d06;
  --tile-blue: var(--blue-50);    --tile-blue-ink: #1d4ed8;
  --tile-creme: var(--creme-200); --tile-creme-ink: var(--ink-mut);

  /* Trait de marqueur et grain (deux versions, une par thème) */
  --marker-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' preserveAspectRatio='none'%3E%3Cpath d='M4 14 C 46 8, 104 5, 196 9 C 198 13, 197 17, 194 19 C 128 16, 66 18, 6 22 C 2 20, 2 16, 4 14 Z' fill='%23fcd34d'/%3E%3C/svg%3E");
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.6' intercept='.7'/%3E%3CfeFuncG type='linear' slope='.6' intercept='.7'/%3E%3CfeFuncB type='linear' slope='.6' intercept='.7'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --grain-blend: multiply;
  --grain-opacity: .32;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6272' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  /* Polices */
  --display: 'Bricolage Grotesque', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; /* codes, immatriculations, vols */

  /* Échelle fluide */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.20vw, 1.12rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.30rem + 0.75vw, 1.95rem);
  --step-3:  clamp(1.80rem, 1.52rem + 1.40vw, 2.75rem);
  --step-4:  clamp(2.20rem, 1.70rem + 2.50vw, 3.90rem);
  --step-5:  clamp(2.70rem, 1.80rem + 4.50vw, 5.60rem);

  /* Formes */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(8, 26, 48, .05);
  --shadow-md: 0 4px 16px -4px rgba(8, 26, 48, .10), 0 2px 6px -2px rgba(8, 26, 48, .06);
  --shadow-lg: 0 28px 56px -24px rgba(8, 26, 48, .24), 0 4px 12px -4px rgba(8, 26, 48, .08);

  /* Mouvement */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 180ms;

  /* Gabarit */
  --gutter: clamp(16px, 3vw, 32px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a1220;
  --bg-alt: #0e1828;
  --surface: #121d30;
  --surface-2: #18253b;
  --row-hover: rgba(255, 255, 255, .035);
  --ink: #eef1f7;
  --ink-mut: #a7b0c2;
  --ink-dim: #8b95a8;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --brand: var(--navy-300);
  --brand-fast: #ffffff;
  --brand-park: var(--amber-500);
  --accent-text: var(--amber-500);
  --link: var(--navy-300);
  --focus: #7ea8ff;
  --overlay: rgba(0, 0, 0, .6);
  --header-bg: rgba(10, 18, 32, .86);

  --ok: #4ade80;   --ok-bg: rgba(74, 222, 128, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --err: #f87171;  --err-bg: rgba(248, 113, 113, .12);
  --info: #8fb0ff; --info-bg: rgba(126, 168, 255, .12);

  --primary-bg: #2a5298;
  --primary-bg-hover: #3263b5;

  --band-dark: var(--navy-800);
  --cta-bg: var(--navy-800);

  --tile-navy: rgba(157, 184, 230, .14);  --tile-navy-ink: var(--navy-300);
  --tile-amber: rgba(245, 158, 11, .14);  --tile-amber-ink: var(--amber-400);
  --tile-blue: rgba(126, 168, 255, .14);  --tile-blue-ink: #a9c4ff;
  --tile-creme: rgba(255, 255, 255, .06); --tile-creme-ink: var(--ink-mut);

  --marker-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' preserveAspectRatio='none'%3E%3Cpath d='M4 14 C 46 8, 104 5, 196 9 C 198 13, 197 17, 194 19 C 128 16, 66 18, 6 22 C 2 20, 2 16, 4 14 Z' fill='%23f59e0b' fill-opacity='.55'/%3E%3C/svg%3E");
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.6' intercept='-.3'/%3E%3CfeFuncG type='linear' slope='.6' intercept='-.3'/%3E%3CfeFuncB type='linear' slope='.6' intercept='-.3'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --grain-blend: screen;
  --grain-opacity: .16;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7b0c2' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  --shadow-xs: 0 0 0 transparent;
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .45), 0 2px 6px -2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 28px 56px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* Grain : enlève l'aspect plastique des aplats. Coupé dans les outils denses et sur les écrans muraux. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none;
  background-image: var(--grain-img); background-size: 220px 220px;
  mix-blend-mode: var(--grain-blend); opacity: var(--grain-opacity);
}
img, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
}
h3, h4 { font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
strong { font-weight: 600; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- Marque ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand::before {
  content: "P"; flex: none; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy-800); color: var(--amber-500);
  font: 800 1.3rem/1 var(--display);
}
:root[data-theme="dark"] .brand::before { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.brand-word { font-family: var(--display); font-weight: 800; font-size: 1.4rem; letter-spacing: -.03em; line-height: 1; }
.brand-fast { color: var(--brand-fast); }
.brand-park { color: var(--brand-park); }
.brand-sub { font: 600 .66rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
/* Sur une bande navy */
.brand--on-dark::before { background: var(--amber-500); color: var(--navy-900); }
.brand--on-dark .brand-fast { color: #fff; }
.brand--on-dark .brand-park { color: var(--amber-500); }
.brand--on-dark .brand-sub { color: var(--on-dark-mut); }

/* ---------- Intitulés ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font: 600 .78rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow::before { content: ""; width: 24px; height: 1.5px; background: currentColor; flex: none; }
.label {
  font: 600 .74rem/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--tile-navy); color: var(--tile-navy-ink);
  font: 600 .72rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.tag-amber { background: var(--tile-amber); color: var(--tile-amber-ink); }

/* ---------- Pastilles d'état ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 11px;
  border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-mut);
  font: 600 .76rem/1.2 var(--body); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--err { background: var(--err-bg); color: var(--err); }
.pill--info { background: var(--info-bg); color: var(--info); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font: 600 .96rem/1 var(--body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  touch-action: manipulation;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1rem; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-wrap { white-space: normal; line-height: 1.25; text-align: center; padding-block: 10px; }
.btn-sign { background: var(--amber-500); color: var(--navy-900); box-shadow: 0 8px 18px -10px rgba(217, 119, 6, .8); }
.btn-sign:hover { background: var(--amber-400); transform: translateY(-1px); }
.btn-navy { background: var(--primary-bg); color: var(--on-primary); }
.btn-navy:hover { background: var(--primary-bg-hover); }
.btn-ok { background: var(--ok-solid); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--err); border-color: color-mix(in srgb, var(--err) 50%, transparent); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .32); }
.btn-outline-light:hover { border-color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Attente pendant une action */
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading .btn-text { visibility: hidden; }
.btn.loading::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: fp-spin .7s linear infinite;
}
.fp-spinner {
  width: 28px; height: 28px; margin: 20px auto; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: fp-spin .8s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }

/* ---------- Bascule de thème ---------- */
.theme-toggle {
  width: 42px; height: 42px; flex: none; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--ink-mut); cursor: pointer; transition: color .3s var(--ease), border-color .3s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Champs ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-mut); }
.field input, .field select, .input {
  width: 100%; min-height: 50px; padding: 0 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  transition: border-color .3s var(--ease);
}
.field select, select.input {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: var(--select-arrow); background-repeat: no-repeat;
  background-position: right 14px center; background-size: 12px;
}
.field input:hover, .input:hover { border-color: var(--ink-dim); }
.field input:focus, .field select:focus, .input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field input::placeholder, .input::placeholder { color: var(--ink-dim); opacity: .85; }
.field-hint { font-size: var(--step--1); color: var(--ink-dim); line-height: 1.45; }

/* ---------- Message d'erreur ---------- */
.err {
  display: none; align-items: center; gap: 8px; margin-bottom: 16px; padding: 11px 14px;
  background: var(--err-bg); color: var(--err); border-radius: var(--radius);
  font-size: .86rem; font-weight: 600; line-height: 1.4;
}
.err.show { display: flex; }
.err svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 1000;
  width: max-content; max-width: min(92vw, 420px);
  padding: 12px 18px 12px 15px; border-radius: var(--radius);
  background: var(--navy-900); color: #fff;
  font: 500 .9rem/1.35 var(--body);
  box-shadow: var(--shadow-lg);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--amber-500); }
.toast-success::before { background: #4ade80; }
.toast-error { background: #7f1d1d; }
.toast-error::before { background: #fecaca; }
:root[data-theme="dark"] .toast { background: #1b2c45; border: 1px solid var(--line-strong); }
:root[data-theme="dark"] .toast-error { background: #7f1d1d; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
