/* =========================================================
   Taxis-Services — style.css
   Feuille de style commune à toutes les pages.
   Direction : Material Design (Google), adaptée à la marque
   Taxis-Services (navy). A inclure dans le <head> :
   <link rel="stylesheet" href="css/style.css">
   ========================================================= */

:root {
  /* Couleur de marque unique (navy du logo), utilisée comme
     "primary" Material : boutons, focus, liens, icônes actives */
  --ink: #055075;
  --navy: #055075;              /* alias de --ink : plusieurs pages utilisent var(--navy) */
  --ink-2: #033a56;             /* survol / variante plus sombre */
  --primary-container: #dbe9f1; /* fond teinté clair dérivé du navy, pour les chips/horaires */

  --paper: #f3f4f7;   /* fond de page gris très clair */
  --surface: #ffffff; /* fond des cartes */
  --line: #dfe3e8;    /* bordures visibles mais discrètes (contours de carte façon Material) */
  --muted: #5f6368;   /* texte secondaire (gris Google) */
  --text: #1f1f1f;    /* texte principal */

  /* Couleurs sémantiques, chacune avec sa variante "container" tonale */
  --accent: #055075;             /* alias du navy : un seul "primary" Material, pas de 2e accent */
  --brand-red: #ff0000;          /* rouge exact du logo, réservé uniquement au logo lui-même */

  --warn: #b3620a;
  --warn-container: #ffe9d1;
  --danger: #b3261e;
  --danger-container: #fdd9d6;
  --success: #146c2e;
  --success-container: #d7f5df;

  /* Rayons et ombres (échelle Material : plus arrondi que Apple sur les grands blocs) */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-modal: 0 8px 28px rgba(0,0,0,0.22);

  /* Typo */
  --font-body: "Google Sans", Roboto, Arial, sans-serif;
  --font-num: "Google Sans", Roboto, Arial, sans-serif; /* tabular-nums appliqué directement sur le chip horaire */
}

* { box-sizing: border-box; }

.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;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  padding-bottom: 84px; /* laisse la place à la bottom-nav mobile */
}

a { color: inherit; }

/* ---------- Structure ---------- */

.header {
  background: #fff;
  color: #0f172a;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e6e9ee;
}
.header h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0; color: #0f172a; }
.header p { margin: 5px 0 0; color: #64748b; font-size: 14px; }
.header { position: relative; }
.mode-switch {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--navy, #055075);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.mode-switch svg { width: 16px; height: 16px; }

/* Logo sur en-tête clair : plus besoin de pastille blanche */
.header-brand {
  display: inline-flex;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 8px;
}
.header-brand img { display: block; height: 28px; width: auto; }
.header-brand.lg { padding: 0; border-radius: 0; }
.header-brand.lg img { height: 28px; }

/* Bandeau logo discret en haut des pages à fond clair (sans bannière navy) */
.brand-strip { max-width: 1050px; margin: 0 auto; padding: 16px 20px 0; }
.brand-strip img { height: 28px; display: block; }

.container {
  max-width: 1050px;
  margin: 24px auto;
  padding: 0 16px 36px;
}

.topbar,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; color: var(--text); font-size: 22px; font-weight: 500; }
.actions-top { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Cartes ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: box-shadow 0.15s ease;
}
.card h2, .card h3 { margin-top: 0; color: var(--text); font-weight: 500; }

.list { display: grid; gap: 10px; }

/* ---------- Élément signature : chip horaire (surface tonale Material) ---------- */

.time-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
  background: var(--primary-container);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 5px 10px;
  border-radius: 8px;
}
.time-chip.is-empty { color: var(--muted); background: transparent; font-weight: 500; }
.time-chip .arrow { opacity: 0.6; font-weight: 400; margin: 0 2px; }
.time-chip.lg { font-size: 24px; padding: 6px 12px; }

/* ---------- Boutons ---------- */

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 20px;
  padding: 11px 20px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}
.button:hover, button:hover { background: var(--ink-2); }
.button:active, button:active { transform: scale(0.97); }
.button.secondary, button.secondary { background: #f1f5f9; color: var(--ink); border: 1px solid var(--line); }
.button.secondary:hover, button.secondary:hover { background: #e7edf3; }
.button.danger, button.danger { background: var(--danger); }
.button.add, button.add { background: var(--success); }
.button:focus-visible, button:focus-visible,
a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Badges & alertes (chips tonaux pleins, façon Material) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-container);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}
.missing {
  color: var(--warn);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--warn-container);
  padding: 2px 8px;
  border-radius: 8px;
}
.meta { color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty { color: #777; font-style: italic; }

/* ---------- Formulaires ---------- */

label {
  display: block;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 13px;
}
input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #79747e;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
textarea { resize: vertical; }
.field { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ---------- Menu contextuel & modale ---------- */

.context-menu {
  position: fixed;
  z-index: 1000;
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  min-width: 220px;
  overflow: hidden;
}
.context-menu button, .context-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  text-decoration: none;
  border-radius: 0;
  font-size: 15px;
}
.context-menu button:hover, .context-menu a:hover { background: #f1f5f9; }
.context-menu .danger { color: var(--danger); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  padding: 18px; z-index: 1100;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-modal);
}
.modal h2 { margin: 0 0 14px; color: var(--text); font-size: 19px; font-weight: 500; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---------- Navigation basse (mobile) ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  z-index: 50;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bottom-nav a.active { color: var(--ink); font-weight: 600; }
.bottom-nav svg { width: 26px; height: 26px; }

/* Variante "flottante" pour les pages chauffeur (mobile) */
.bottom-nav.floating {
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 680px;
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-modal);
  border-top: none;
  padding: 6px;
}
.bottom-nav.floating a { border-radius: 16px; padding: 6px 4px; font-weight: 600; gap: 2px; }
.bottom-nav.floating a.active { background: var(--primary-container); color: var(--ink); }

/* ---------- Bouton d'action flottant (FAB) ---------- */

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.22);
  z-index: 60;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.fab:hover { background: var(--ink-2); }
.fab:active { transform: scale(0.94); }
.fab svg { width: 26px; height: 26px; }
.fab.above-nav { bottom: 92px; }

/* ---------- Utilitaires responsive ---------- */

@media (max-width: 760px) {
  .container { margin: 18px auto; padding: 0 14px 30px; }
  .page-header { display: block; }
  .actions-top { margin-top: 10px; }
  .button, button { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal-actions { display: grid; }
}
