/* V0142: theme tokens, semantic status colors remain unchanged. */
:root {
  /* Palette du fichier : couleurs écrites en dur remplacées par ces variables (mêmes valeurs). */
  --c-white: #fff;
}
:root {
  --theme-bg: #f4f5f7;
  --theme-surface: #fff;
  --theme-text: #192536;
  --theme-muted: #687686;
  --theme-primary: #102b48;
  --theme-accent: #d2a44c;
  --theme-accent-text: #856321;
  --theme-border: #dfe4e9;
  --theme-input: #fff;
  --theme-nav: #fff;
  --theme-focus: #d2a44c;
  --theme-on-accent: #17212b;
  --theme-soft: #f1f3f5;
}
html[data-theme='navy_gold'] {
  --theme-bg: #f2f4f7;
  --theme-surface: #ffffff;
  --theme-text: #192536;
  --theme-muted: #5e6a7a;
  --theme-primary: #102b48;
  --theme-accent: #d2a44c;
  --theme-accent-text: #856321;
  --theme-border: #dce2e8;
  --theme-input: #ffffff;
  --theme-nav: #102b48;
  --theme-focus: #d2a44c;
  --theme-on-accent: #17212b;
  --theme-soft: #f2e8d1;
}
html[data-theme='charcoal_copper'] {
  --theme-bg: #edeef0;
  --theme-surface: #ffffff;
  --theme-text: #24282e;
  --theme-muted: #606772;
  --theme-primary: #292d32;
  --theme-accent: #c1845b;
  --theme-accent-text: #8f5a36;
  --theme-border: #d8dce1;
  --theme-input: #ffffff;
  --theme-nav: #292d32;
  --theme-focus: #c1845b;
  --theme-on-accent: #211d1a;
  --theme-soft: #f1e4db;
}
html[data-theme='graphite_gold'] {
  --theme-bg: #17191d;
  --theme-surface: #292d32;
  --theme-text: #f6f6f6;
  --theme-muted: #bec4cd;
  --theme-primary: #16181c;
  --theme-accent: #d5aa50;
  --theme-accent-text: #d5aa50;
  --theme-border: #464b52;
  --theme-input: #292d32;
  --theme-nav: #16181c;
  --theme-focus: #d5aa50;
  --theme-on-accent: #17191d;
  --theme-soft: #38332a;
}
html[data-theme='white_blue'] {
  --theme-bg: #f0f4f8;
  --theme-surface: #ffffff;
  --theme-text: #1e344b;
  --theme-muted: #5c6e81;
  --theme-primary: #f0f4f8;
  --theme-accent: #2362a0;
  --theme-accent-text: #2362a0;
  --theme-border: #d4dfe9;
  --theme-input: #ffffff;
  --theme-nav: #f0f4f8;
  --theme-focus: #2362a0;
  --theme-on-accent: #ffffff;
  --theme-soft: #e4eff9;
}
html[data-theme='green_gold'] {
  --theme-bg: #eaf0ed;
  --theme-surface: #ffffff;
  --theme-text: #193c36;
  --theme-muted: #5d6c67;
  --theme-primary: #193c36;
  --theme-accent: #c5a15b;
  --theme-accent-text: #80642d;
  --theme-border: #cbd9d2;
  --theme-input: #ffffff;
  --theme-nav: #193c36;
  --theme-focus: #c5a15b;
  --theme-on-accent: #182820;
  --theme-soft: #f0e8d6;
}
html[data-theme='ivory_champagne'] {
  --theme-bg: #f6f1e8;
  --theme-surface: #ffffff;
  --theme-text: #292b30;
  --theme-muted: #6b665e;
  --theme-primary: #f6f1e8;
  --theme-accent: #a8864a;
  --theme-accent-text: #7e6437;
  --theme-border: #e2d9c9;
  --theme-input: #ffffff;
  --theme-nav: #f6f1e8;
  --theme-focus: #a8864a;
  --theme-on-accent: #17212b;
  --theme-soft: #f1e8d7;
}

body,
.app {
  background: var(--theme-bg);
  color: var(--theme-text);
}
header,
nav {
  background: var(--theme-nav);
  border-color: var(--theme-border);
}
header .brand strong,
header .brand span,
header .round,
nav a {
  color: var(--theme-text);
}
html[data-theme='navy_gold'] header,
html[data-theme='navy_gold'] nav,
html[data-theme='charcoal_copper'] header,
html[data-theme='charcoal_copper'] nav,
html[data-theme='graphite_gold'] header,
html[data-theme='graphite_gold'] nav,
html[data-theme='green_gold'] header,
html[data-theme='green_gold'] nav {
  color: var(--c-white);
}
html[data-theme='navy_gold'] header .brand strong,
html[data-theme='navy_gold'] nav a,
html[data-theme='charcoal_copper'] header .brand strong,
html[data-theme='charcoal_copper'] nav a,
html[data-theme='graphite_gold'] header .brand strong,
html[data-theme='graphite_gold'] nav a,
html[data-theme='green_gold'] header .brand strong,
html[data-theme='green_gold'] nav a {
  color: var(--c-white);
}
nav a[aria-current='page'] {
  background: var(--theme-accent);
  color: var(--theme-on-accent) !important;
}
.welcome p,
.muted,
.ride-time,
.ride-route small,
.ride-extra,
.dashboard-links small {
  color: var(--theme-muted);
}
.eyebrow,
.ride-fare {
  color: var(--theme-accent-text);
}
.brand span {
  color: var(--theme-accent);
}
html[data-theme='ivory_champagne'] .brand span {
  color: var(--theme-accent-text);
}
.panel,
.driver-card,
.dashboard-links a,
.ride-card,
.mine-detail,
.mission-panel,
.auth-zone,
#admin-board .admin-panel,
.pricing-card,
.zone-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-text);
}
.driver-card {
  background: var(--theme-surface);
}
.dashboard-links a,
.ride-card strong,
.mine-detail,
.mission-panel {
  color: var(--theme-text);
}
.rides-tabs,
.ride-map-empty {
  background: var(--theme-soft);
}
.rides-tabs button,
.mine-filters button,
.ride-actions button,
.mine-pages button,
#mine-back,
.rides-toolbar button {
  color: var(--theme-text);
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
.rides-tabs button[aria-selected='true'],
.mine-filters button[aria-pressed='true'],
.availability-btn,
.ride-actions button[data-action='accept'],
.mine-open,
.mine-directions {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-on-accent);
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  background: var(--theme-input);
  color: var(--theme-text);
  border-color: var(--theme-border);
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}
#admin-board button {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-on-accent);
}
/* User choice screen */
.theme-settings {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: var(--theme-surface);
  color: var(--theme-text);
}
.theme-settings h3 {
  margin: 0 0 8px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.theme-option {
  border: 2px solid var(--theme-border);
  border-radius: 14px;
  padding: 8px;
  background: var(--theme-surface);
  color: var(--theme-text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.theme-option[aria-pressed='true'] {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px var(--theme-accent);
}
.theme-preview {
  display: block;
  height: 75px;
  border-radius: 8px;
  overflow: hidden;
  padding: 9px;
  background: var(--preview-bg);
  color: var(--preview-fg);
}
.theme-preview-top {
  display: block;
  height: 10px;
  width: 65%;
  background: var(--preview-main);
  border-radius: 3px;
  margin-bottom: 8px;
}
.theme-preview-card {
  display: block;
  background: var(--preview-surface);
  border-radius: 5px;
  height: 33px;
  padding: 7px;
}
.theme-preview-line {
  display: block;
  background: var(--preview-fg);
  opacity: 0.6;
  width: 60%;
  height: 5px;
  border-radius: 3px;
}
.theme-preview-button {
  display: block;
  background: var(--preview-accent);
  height: 9px;
  width: 45%;
  border-radius: 3px;
  margin-top: 5px;
}
.theme-option-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 1px 1px;
}
#theme-reset {
  padding: 11px 13px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  color: var(--theme-text);
}
#theme-status {
  min-height: 20px;
  color: var(--theme-muted);
}
@media (min-width: 650px) {
  .theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* V0142.1 — Harmonisation Gestion, sans changement métier. */
#admin-board,
:is(#admin-board, #services-board) .pricing-page,
:is(#admin-board, #services-board) .pricing-page .zone-screen {
  color: var(--theme-text);
}
:is(#admin-board, #services-board) .pricing-page,
:is(#admin-board, #services-board) .pricing-page .zone-screen,
:is(#admin-board, #services-board) .pricing-page .zone-editor-form,
:is(#admin-board, #services-board) .pricing-page .zone-editor-head {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(
    .zone-card,
    .zone-list-row,
    .zone-search-box,
    .zone-menu-popup,
    .zone-tools,
    .zone-selected,
    .zone-suggestions,
    .tariff-control,
    .tariff-controls,
    .tariff-card,
    .pricing-card
  ),
:is(#admin-board, #services-board) .pricing-page :is(section, article)[class*='card'] {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(
    h1,
    h2,
    h3,
    h4,
    label,
    strong,
    .zone-heading,
    .zone-list-row,
    .zone-name-row,
    .tariff-heading,
    .tariff-section,
    .tariff-label,
    .tariff-identity
  ) {
  color: var(--theme-text) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.zone-subtitle, .zone-note, .tariff-summary, .tariff-explanation, small) {
  color: var(--theme-muted) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(input:not([type='checkbox']):not([type='radio']), textarea, select) {
  background: var(--theme-input) !important;
  color: var(--theme-text) !important;
  -webkit-text-fill-color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  caret-color: var(--theme-accent) !important;
  opacity: 1 !important;
}
:is(#admin-board, #services-board) .pricing-page :is(input, textarea, select):focus {
  outline: 2px solid var(--theme-focus) !important;
  outline-offset: 1px;
}
:is(#admin-board, #services-board) .pricing-page :is(input, textarea, select):disabled {
  opacity: 0.7 !important;
  cursor: not-allowed;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.zone-mode-tabs, .zone-round, .zone-menu, .tariff-btn, .zone-search-box),
:is(#admin-board, #services-board)
  .pricing-page
  button:not([class*='primary']):not([aria-selected='true']):not([aria-pressed='true']) {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(button[aria-selected='true'], button[aria-pressed='true'], .tariff-btn-primary, .zone-mode-tabs .active) {
  background: var(--theme-accent) !important;
  color: var(--theme-on-accent) !important;
  border-color: var(--theme-accent) !important;
}
:is(#admin-board, #services-board) .pricing-page :is(.zone-brand, .tariff-brand) {
  color: var(--theme-accent) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.zone-map, .zone-map-shell, .leaflet-container, .leaflet-control-container) {
  color: initial;
}
/* Messages et cartes inactives : préserver un contraste lisible */
:is(#admin-board, #services-board) .pricing-page :is(.zone-list-row, .zone-card) * {
  opacity: 1;
}
:is(#admin-board, #services-board) .pricing-page :is(.zone-list-row, .zone-card) :is(span, p, small) {
  color: var(--theme-muted);
}
:is(#admin-board, #services-board) .pricing-page :is(.zone-list-row, .zone-card) :is(strong, h3, h4, input) {
  color: var(--theme-text) !important;
}

/* V0142.1: isolate the six real theme swatches from shared button styles */
.theme-settings .theme-grid .theme-option {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  padding: 8px !important;
  min-height: 0 !important;
  text-align: left !important;
}
.theme-settings .theme-grid .theme-option[aria-pressed='true'] {
  border-color: var(--theme-accent) !important;
}
.theme-settings .theme-grid .theme-preview {
  display: block !important;
  background: var(--preview-bg) !important;
  color: var(--preview-fg) !important;
  height: 75px !important;
  padding: 9px !important;
}
.theme-settings .theme-grid .theme-preview-top {
  display: block !important;
  background: var(--preview-main) !important;
}
.theme-settings .theme-grid .theme-preview-card {
  display: block !important;
  background: var(--preview-surface) !important;
}
.theme-settings .theme-grid .theme-preview-line {
  display: block !important;
  background: var(--preview-fg) !important;
}
.theme-settings .theme-grid .theme-preview-button {
  display: block !important;
  background: var(--preview-accent) !important;
}
.theme-settings .theme-grid .theme-option-name {
  background: transparent !important;
  color: var(--theme-text) !important;
}
/* Admin pages: fix contrast for headings, labels, disabled fields and help text */
:is(#admin-board, #services-board) .pricing-page :is(h1, h2, h3, h4, h5, label, legend, summary, strong) {
  color: var(--theme-text) !important;
  opacity: 1 !important;
}
:is(#admin-board, #services-board) .pricing-page :is(p, small, .muted, .tariff-summary, .tariff-explanation) {
  color: var(--theme-muted) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(input:not([type='checkbox']):not([type='radio']), textarea, select) {
  background: var(--theme-input) !important;
  color: var(--theme-text) !important;
  -webkit-text-fill-color: var(--theme-text) !important;
  caret-color: var(--theme-accent) !important;
  opacity: 1 !important;
}
:is(#admin-board, #services-board) .pricing-page :is(input, textarea)::placeholder {
  color: var(--theme-muted) !important;
  opacity: 1 !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.notice, .zone-notice, .zone-message, #vtc-options-empty, .menu-popup) {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.notice, .zone-notice, .zone-message, #vtc-options-empty, .menu-popup)
  * {
  color: inherit;
}
:is(#admin-board, #services-board) .pricing-page :is(.zone-list-row, .zone-card, .offer, .price-row, .option-row) {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
}
:is(#admin-board, #services-board) .pricing-page :is(button, .tariff-btn, .opt-btn):focus-visible {
  outline: 3px solid var(--theme-focus) !important;
  outline-offset: 2px;
}
/* Leaflet tiles and controls must not inherit application text colors */
:is(#admin-board, #services-board) .pricing-page .leaflet-container {
  color: #222;
}

/* V0155 — preserve palettes and restore readable ancillary panels. */
:is(#admin-board, #services-board) .pricing-page :is(.geo-auto-status, .zone-advanced, .zone-save-footer) {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
:is(#admin-board, #services-board)
  .pricing-page
  :is(.geo-auto-status, .zone-advanced)
  :is(p, summary, label, small, strong) {
  color: inherit !important;
}

/* A2 : aperçu des photos réelles du véhicule (remplace un style en ligne bloqué par la CSP) */
.vehicle-preview {
  display: block;
  max-width: 180px;
  max-height: 130px;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 8px;
}
.theme-option.is-locked {
  opacity: 0.7;
}
.theme-option.is-locked .theme-option-name {
  font-weight: 700;
}
