/* ==========================================================================
   COMPONENTS — base CSS classes
   These are the literal classes meant to drop straight into .blade.php
   templates. React components in components/ only apply these classNames —
   the styling lives here, not in JS.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  color: var(--text-on-light-primary);
  background: var(--surface-light-1);
  margin: 0;
  line-height: var(--leading-normal);
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent-gold-press); text-decoration: none; }
a:hover { color: var(--accent-gold); }

/* ---------------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-md);
  line-height: 1;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.btn:active:not(:disabled) { transform: scale(0.97) translateY(0); box-shadow: none; }
.btn:disabled, .btn-disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.pagination-nav { margin-top: var(--space-5); }

.btn-sm { padding: 9px 16px; font-size: var(--text-body-sm); }
.btn-lg { padding: 16px 28px; font-size: var(--text-body-lg); }

.btn-icon { padding: 0; width: 38px; height: 38px; flex-shrink: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: var(--accent-gold);
  color: var(--cz-black-100);
  box-shadow: var(--shadow-gold-lift);
}
/* Le survol reprécise systématiquement `color` sur chaque variante : sinon la
   règle générale `a:hover { color: var(--accent-gold) }` (liens du site,
   base.css:18) gagne sur un <a class="btn"> et fait virer le texte au doré/
   brun sur n'importe quel fond — repéré sur WhatsApp (texte brun sur vert,
   Hubert 05/08/2026) mais touchait tous les boutons-liens. */
.btn-primary:hover:not(:disabled) { background: var(--accent-gold-hover); color: var(--cz-black-100); box-shadow: var(--shadow-gold-lift-hover); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { background: var(--accent-gold-press); }

.btn-secondary {
  background: transparent;
  color: var(--text-on-light-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-gold); color: var(--accent-gold-press); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-on-dark.btn-secondary { color: var(--text-on-dark-primary); border-color: var(--border-dark); }
.btn-on-dark.btn-secondary:hover:not(:disabled) { border-color: var(--accent-gold); color: var(--cz-cream-100); box-shadow: 0 4px 16px -4px rgba(201, 162, 74, 0.3); }

.btn-danger { background: var(--cz-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--cz-danger-dark); color: #fff; }

/* .btn-ok (vert) et .btn-warning (orange) sont des variantes "fantôme" (fond
   transparent, bordure colorée) réservées au scope admin, même famille que
   .btn-danger — voir tokens/admin-scope.css. Ici, valeurs par défaut au cas
   où ces classes seraient utilisées hors du scope admin. */
.btn-success { background: var(--cz-success); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--cz-success-dark); color: #fff; }

.btn-warning { background: var(--cz-warning); color: var(--cz-black-100); }
.btn-warning:hover:not(:disabled) { background: var(--cz-warning-dark); color: var(--cz-black-100); }

.btn-whatsapp { background: var(--whatsapp-bg); color: var(--whatsapp-fg); box-shadow: 0 4px 18px -4px rgba(37, 211, 102, 0.4); }
.btn-whatsapp:hover:not(:disabled) { background: var(--whatsapp-bg-hover); color: var(--whatsapp-fg); box-shadow: 0 6px 22px -4px rgba(37, 211, 102, 0.55); transform: translateY(-1px); }

/* ---------------------------------- Icône WhatsApp (bandeau du haut, à côté du téléphone) ---------------------------------- */
.wa-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  color: var(--cz-whatsapp, #25D366);
  text-decoration: none;
  transition: transform .2s ease;
}
.wa-icon svg { width: 100%; height: 100%; display: block; }
.wa-icon:hover { transform: scale(1.18); }

.btn-ghost { background: transparent; color: var(--text-on-light-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--cz-cream-90); color: var(--text-on-light-primary); }

/* ---------------------------------- Badges ---------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.badge-neutral  { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.badge-success  { background: var(--status-success-bg); color: var(--status-success-fg); }
.badge-warning  { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.badge-danger   { background: var(--status-danger-bg);  color: var(--status-danger-fg); }
.badge-info     { background: var(--status-info-bg);    color: var(--status-info-fg); }
/* --text-accent-gold : meme raison que .invoice-count-badge — sur le voile
   dore du theme clair admin, --accent-gold-press tombait a 4,05 de
   contraste (audit du 29/08/2026). Sur le site public le token vaut
   l'accent normal, rien ne change. */
.badge-gold     { background: var(--accent-gold-tint);  color: var(--text-accent-gold, var(--accent-gold-press)); }
.badge-or       { background: var(--accent-gold-tint);  color: var(--accent-gold-press); }
.badge-argent   { background: var(--status-neutral-bg);  color: var(--status-neutral-fg); }
.badge-bronze   { background: color-mix(in srgb, var(--cz-copper-100) 18%, white); color: var(--cz-copper-100); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Badge accole a un titre de carte : le titre n'est pas un conteneur flex,
   c'est donc au badge de se decoller du texte qui le precede. */
.badge-suite { margin-left: 4px; }
/* Icône SVG dans un badge (ex. flèche entrante du badge "apporté par") :
   suit la taille du texte, jamais une taille fixe qui se décalerait si le
   corps du badge change. Le `gap` du .badge gère déjà l'espacement. */
.badge-icone { width: 13px; height: 13px; flex: none; }

/* ---------------------------------- Cards ---------------------------------- */
.card {
  background: var(--surface-light-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}
.card-hover { transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* Une carte posée sur un <a> (plutôt qu'un <div>) redevient un vrai lien : pas
   besoin de répéter un style inline à chaque fois qu'une carte doit être cliquable. */
a.card, button.card { display: block; text-decoration: none; color: inherit; cursor: pointer; width: 100%; text-align: left; border: 1px solid var(--border-light); font: inherit; }
.card-dark {
  background: var(--surface-dark-3);
  border-color: var(--border-dark);
  color: var(--text-on-dark-primary);
}
.card-title { font-size: var(--text-title-md); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
.card-subtitle { font-size: var(--text-body-sm); color: var(--text-on-light-secondary); }

/* ---------------------------------- Alerts / banners ---------------------------------- */
.alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-body-sm);
  line-height: var(--leading-normal);
  border: 1px solid transparent;
}
.alert-title { font-weight: var(--weight-semibold); margin-bottom: 2px; display: block; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-info    { background: var(--status-info-bg);    color: var(--status-info-fg); }
.alert-success { background: var(--status-success-bg); color: var(--status-success-fg); }
.alert-warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.alert-danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }

/* ---------------------------------- Modal (générique, réutilisable) ---------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(11, 10, 8, .6);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
}
.modal-overlay[hidden] { display: none; }

/* Un élément portant l'attribut `hidden` est masqué, point — y compris quand
   une règle d'auteur lui donne un display (flex, grid...). Sans ce !important,
   la feuille de style du navigateur perd contre n'importe quelle classe de
   mise en page : le bloc "rémunération" d'une course confiée restait
   entièrement visible alors que le JS l'avait bien masqué (trouvé par Hubert
   le 06/09/2026, sur deux appareils). C'est un piège général, pas propre à
   cet écran — d'où la règle globale plutôt qu'un correctif local. */
[hidden] { display: none !important; }
.modal-box {
  background: var(--surface-light-1, #fff); color: var(--text-on-light-primary);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 480px; width: 100%; padding: var(--space-6);
}
.modal-actions { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-5); }
/* Contenu courant d'une modale : un titre, une ligne d'explication, une liste
   d'options empilees. Ecrit ici le 13/09/2026 en remplacement des style="..."
   qui etaient recopies a l'identique dans les deux widgets d'estimation
   (trajet et mise a disposition) — memes valeurs, une seule definition. */
.modal-titre { font-weight: 700; font-size: var(--text-body-lg, 1.1rem); margin: 0 0 4px; }
.modal-sous-titre { color: var(--text-on-light-secondary); font-size: var(--text-body-sm); margin: 0 0 18px; }
.modal-liste { display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------- Forms ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--text-on-light-secondary);
}
.field-hint { font-size: var(--text-caption); color: var(--text-on-light-muted); overflow-wrap: anywhere; }
.field-static { font-size: var(--text-body-md); color: var(--text-on-light-primary); margin: 0; }
.field-error { font-size: var(--text-caption); color: var(--status-danger-fg); }
.text-success { color: var(--status-success-fg); }
.text-danger { color: var(--status-danger-fg); }

.input, .select, .textarea {
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  color: var(--text-on-light-primary);
  background: var(--surface-light-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-tint);
}
.input:disabled, .select:disabled, .textarea:disabled,
.input:read-only, .textarea:read-only { background: var(--surface-light-3); color: var(--text-on-light-muted); }
.textarea { resize: vertical; min-height: 96px; }

.checkbox, .radio { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-body-sm); cursor: pointer; }
.checkbox input, .radio input { accent-color: var(--accent-gold-press); width: 18px; height: 18px; }

/* ---------------------------------- Tables ---------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
.table th {
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--text-on-light-secondary);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-light); }
.table tr:last-child td { border-bottom: none; }
/* Tableau à libellés en colonne (<th> en tête de LIGNE, ex. page de suivi
   d'une réservation) : la dernière ligne perdait son trait côté valeur mais
   le gardait sous le libellé — un bout de trait isolé sous « PRIX » (capture
   d'Hubert, 23/09/2026). `tbody` seulement : le trait sous l'en-tête d'un
   tableau classique (<thead>) reste. */
.table tbody tr:last-child th { border-bottom: none; }
.table tr:hover td { background: var(--surface-light-3); }
/* Réservation en ligne pas encore confirmée par Hubert — teinte pour qu'elle
   saute aux yeux dans la liste au lieu de se fondre parmi les autres lignes
   (demande du 10/08 : une réservation site était passée inaperçue). */
.table tr.tr-en-attente td { background: var(--status-warning-bg); }
.table tr.tr-en-attente:hover td { background: var(--status-warning-bg); }
.table-row-link { cursor: pointer; }

.th-tri { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.th-tri:hover, .th-tri:hover:hover { color: var(--text-on-light-primary); text-decoration: none; }
.th-tri.is-active { color: var(--accent-gold-press); }
.th-tri-icon { width: 12px; height: 12px; flex: none; }

/* ---------------------------------- Accessibilité ---------------------------------- */
/* Texte lu par les lecteurs d'écran, invisible à l'écran — pour les labels de
   formulaire qui n'ont pas besoin d'être affichés (le placeholder suffit
   visuellement, mais un placeholder seul n'est pas fiable pour un lecteur
   d'écran, ni une fois le champ rempli). */
.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;
}

/* ---------------------------------- Print (bon de commande) ---------------------------------- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .no-print { display: none !important; }
  .card-dark, .card { background: #fff !important; color: #000 !important; border-color: #999 !important; box-shadow: none !important; }
}
