/* ==========================================================================
   OCD Live — components on top of Bootstrap 5, fed only by ocd-tokens.css.
   Principles (charte §1): one accent (orange) per screen, black main action,
   colour never carries information alone, light/dark parity, motion explains.
   ========================================================================== */

html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  --bs-body-bg: var(--background);
  --bs-body-color: var(--foreground);
  --bs-border-color: var(--border);
  --bs-link-color-rgb: 184, 68, 0;
  --bs-link-hover-color-rgb: 143, 53, 0;
  --bs-border-radius: var(--radius);
}
:root[data-theme="dark"] body { --bs-link-color-rgb: 255, 122, 46; --bs-link-hover-color-rgb: 255, 165, 107; }

h1, .h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
h2, .h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
h3, .h3 { font-size: 1.0625rem; font-weight: 600; }
.display-ocd { font-size: clamp(2.25rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.display-ocd .light { font-weight: 300; }
.text-muted, .text-secondary-ocd { color: var(--muted-foreground) !important; }
.text-primary-ocd { color: var(--primary-text) !important; }
.tabular-nums, .table td.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }

/* Signature : le trait orange du slogan (logo) — une fois par écran */
.ocd-rule { display: inline-block; width: 3rem; height: 4px; border-radius: 4px; background: var(--primary); }
.slogan { font-style: italic; font-weight: 500; color: var(--foreground); display: inline-flex; align-items: center; gap: 0.75rem; }
.slogan::before, .slogan::after { content: ""; width: 2.25rem; height: 3px; border-radius: 3px; background: var(--primary); }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- Header ---------- */
.ocd-header {
  position: sticky; top: 0; z-index: 20; height: var(--header-height);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ocd-header .brand img { height: 1.75rem; width: auto; }
html, body { overflow-x: clip; }
.ocd-header .nav-link { color: var(--foreground); font-weight: 500; font-size: 0.875rem; }
.ocd-header .nav-link:hover { color: var(--primary-text); }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

/* ---------- Buttons (charte §6.3) ---------- */
.btn { font-weight: 600; border-radius: calc(var(--radius) - 2px); min-height: 2.5rem; padding: 0.5rem 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: background-color var(--duration-micro), color var(--duration-micro), border-color var(--duration-micro); }
.btn-lg { min-height: var(--control-height); padding: 0.625rem 1.5rem; font-size: 1rem; }
.btn-sm { min-height: 2.25rem; padding: 0.25rem 0.75rem; font-size: 0.8125rem; }
.btn-action { background: var(--action); color: var(--action-foreground); border: 1px solid var(--action); }
.btn-action:hover, .btn-action:focus { background: var(--ardoise-800); color: var(--action-foreground); border-color: var(--ardoise-800); }
:root[data-theme="dark"] .btn-action:hover { background: var(--ardoise-100); border-color: var(--ardoise-100); }
/* Marketing exception (site public uniquement) : orange, texte encre */
.btn-brand { background: var(--primary); color: var(--primary-foreground); border: 1px solid var(--primary); }
.btn-brand:hover, .btn-brand:focus { background: var(--orange-600); border-color: var(--orange-600); color: var(--primary-foreground); }
.btn-outline { background: var(--card); color: var(--foreground); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); color: var(--foreground); }
.btn-ghost { background: transparent; color: var(--foreground); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--muted); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); border: 1px solid var(--destructive); }
.btn-destructive:hover { filter: brightness(0.95); color: var(--destructive-foreground); }
.btn:disabled, .btn.disabled { background: var(--disabled); color: var(--disabled-foreground); border-color: var(--disabled); opacity: 1; }

/* ---------- Badges (rounded-full) ---------- */
.badge-ocd { display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 999px; padding: 0.15rem 0.6rem;
  font-size: 0.75rem; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--foreground); white-space: nowrap; }
.badge-ocd.calm { background: var(--secondary); border-color: var(--secondary); }
.badge-ocd.live { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.badge-ocd.success { background: var(--success-soft); border-color: var(--success-soft); color: var(--success-text); }
.badge-ocd.danger { background: var(--destructive-soft); border-color: var(--destructive-soft); color: var(--destructive-text); }
.badge-ocd.warning { background: var(--warning-soft); border-color: var(--warning-soft); color: var(--warning-text); }
/* Marqueur live : le triangle « play » du i de Live */
.live-dot::before { content: ""; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }

/* ---------- Cards, tables ---------- */
.card-ocd { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--card-shadow); }
.card-ocd .card-body { padding: 1.5rem; }
.kpi .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .label { font-size: 0.75rem; color: var(--muted-foreground); font-weight: 500; }
.table-ocd { width: 100%; margin: 0; color: var(--foreground); --bs-table-bg: transparent; }
.table-ocd thead th { background: color-mix(in srgb, var(--muted) 50%, transparent); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; }
.table-ocd td { padding: 0.75rem 1rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: middle; }
.table-ocd tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.row-actions { opacity: 0; transition: opacity var(--duration-micro); }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; background: transparent;
  color: var(--icon); border-radius: calc(var(--radius) - 2px); }
.icon-btn:hover { color: var(--icon-hover); }
.icon-btn.danger:hover { color: var(--destructive-text); }

/* ---------- Forms ---------- */
.form-label { font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); margin-bottom: 0.35rem; }
.form-control, .form-select { min-height: var(--control-height); border-radius: var(--radius); border-color: var(--input);
  background-color: var(--card); color: var(--foreground); }
.form-control:focus, .form-select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); background-color: var(--card); color: var(--foreground); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.field-validation-error, .text-danger { color: var(--destructive-text) !important; font-size: 0.8125rem; }
.input-validation-error { border-color: var(--destructive) !important; }

/* ---------- Booking wizard ---------- */
.wizard-steps { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; overflow-x: auto; }
.wizard-steps li { flex: 1; min-width: 0; font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .wizard-steps li:not(.active) { font-size: 0; } }
.wizard-steps li::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--border); margin-bottom: 0.4rem; }
.wizard-steps li.done::before, .wizard-steps li.active::before { background: var(--primary); }
.wizard-steps li.active { color: var(--foreground); }
.choice-card { display: block; height: 100%; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem; box-shadow: var(--card-shadow); transition: border-color var(--duration-micro), transform var(--duration-fast) var(--ease-smooth-out); }
.choice-card:hover, .choice-card:focus-visible { border-color: var(--primary); color: inherit; transform: translateY(-2px); }
.choice-card .icon { font-size: 2rem; color: var(--primary-text); }
.price { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.price small { font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); }
.compare-price { text-decoration: line-through; color: var(--muted-foreground); font-size: 0.875rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.5rem; }
.slot-grid .btn { width: 100%; font-variant-numeric: tabular-nums; }
.day-tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.day-tabs a { flex: 0 0 auto; text-align: center; min-width: 4.25rem; padding: 0.5rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); color: var(--foreground); text-decoration: none; font-size: 0.8125rem; }
.day-tabs a strong { display: block; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.day-tabs a.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day-tabs a.closed { color: var(--disabled-foreground); background: var(--disabled); pointer-events: none; }

/* ---------- Hero (site public) ---------- */
.hero { padding: 3.5rem 0 3rem; }
.hero .logo { width: min(420px, 80%); height: auto; }
.format-card .icon { width: 3rem; height: 3rem; border-radius: 0.75rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-text); font-size: 1.5rem; }
/* Format choice inside the hero: compact cards, icon beside the title. */
.format-card.compact { padding: 1rem 1.125rem; }
.format-card.compact .icon { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; font-size: 1.15rem; flex-shrink: 0; }
.format-card.compact p { line-height: 1.45; }
.section { padding-top: 3rem; padding-bottom: 3rem; }
.container { --bs-gutter-x: 2rem; } /* 16 px side gutter on phones */
.section-dark { background: var(--encre); color: #FFFFFF; }
.section-dark .text-muted { color: var(--ardoise-400) !important; }

/* ---------- Back-office shell ---------- */
.bo-shell { display: flex; min-height: calc(100vh - var(--header-height)); }
.bo-sidebar { width: 15rem; flex: 0 0 15rem; background: var(--sidebar); border-right: 1px solid var(--border); padding: 1rem 0.75rem; }
.bo-sidebar .group { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); margin: 1rem 0.5rem 0.4rem; }
.bo-sidebar a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); color: var(--foreground);
  text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.bo-sidebar a i { color: var(--icon); font-size: 1.25rem; }
.bo-sidebar a:hover { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.bo-sidebar a.active { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.bo-sidebar a.active i { color: var(--primary-text); }
.bo-main { flex: 1; min-width: 0; padding: 1.5rem; }
@media (min-width: 1280px) { .bo-main { padding: 2rem 3.5rem; } }
/* Below 992 px the sidebar becomes an off-canvas menu (see end of file). */
@media (min-width: 992px) { .bo-sidebar.offcanvas-lg { background-color: var(--sidebar) !important; } }

/* ---------- Toasts (bas à droite, 24 px) ---------- */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; max-width: 22rem; }
.toast-ocd { display: flex; gap: 0.75rem; align-items: flex-start; background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--card-shadow); padding: 0.875rem 1rem;
  animation: toast-in var(--duration-fast) var(--ease-smooth-out); }
.toast-ocd .ph-fill { font-size: 1.25rem; }
.toast-ocd.success .ph-fill { color: var(--success); }
.toast-ocd.error .ph-fill { color: var(--destructive-text); }
.toast-ocd .title { font-size: 0.875rem; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.footer-ocd { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted-foreground); font-size: 0.8125rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted-foreground); }
.empty-state i { font-size: 2.5rem; color: var(--icon); }

/* ---------- Identity UI (staff login) mapped onto the charte ---------- */
.btn-primary { background: var(--action); color: var(--action-foreground); border-color: var(--action); }
.btn-primary:hover, .btn-primary:focus { background: var(--ardoise-800); border-color: var(--ardoise-800); color: var(--action-foreground); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--ardoise-100); border-color: var(--ardoise-100); }
main > .row, main > h1 { max-width: 1140px; margin-left: auto; margin-right: auto; padding: 0 1rem; }
main > h1 { margin-top: 2.5rem; }
.form-floating > .form-control { min-height: 3.5rem; }

/* ---------- Payment choices & waiting state ---------- */
.bg-muted-ocd { background: var(--muted); }
.pay-option { display: flex; gap: 0.875rem; align-items: flex-start; border: 1px solid var(--border); border-radius: 1rem; padding: 1rem 1.125rem;
  background: var(--card); cursor: pointer; transition: border-color var(--duration-micro); }
.pay-option:hover { border-color: var(--ardoise-300); }
.pay-option input[type=radio] { margin-top: 0.3rem; accent-color: var(--primary); }
.pay-option:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pay-option .ph { font-size: 1.5rem; color: var(--primary-text); }
.pay-option .title { font-weight: 600; }
.pay-detail { display: none; margin-top: 0.75rem; }
.pay-option:has(input:checked) .pay-detail { display: block; }
.network-pick { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.network-pick label { border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; background: var(--card); }
.network-pick input { position: absolute; opacity: 0; pointer-events: none; }
.network-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.pay-pulse { width: 4.5rem; height: 4.5rem; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-text); font-size: 2.25rem; animation: pay-pulse 1.8s var(--ease-smooth-out) infinite; }
@keyframes pay-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 35%, transparent); } 100% { box-shadow: 0 0 0 1.25rem transparent; } }
.method-card { border: 1px solid var(--border); border-radius: 1rem; padding: 1rem 1.125rem; background: var(--card); }
.method-card .account { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; word-break: break-word; }
.method-card pre { white-space: pre-wrap; font-family: inherit; font-size: 0.875rem; margin: 0; color: var(--foreground); }
.timeline-proof { border-left: 3px solid var(--border); padding-left: 0.875rem; }

/* ---------- Back-office on phones: off-canvas menu, scrollable tables ---------- */
@media (max-width: 991.98px) {
  .bo-sidebar { display: block; }
  .bo-sidebar.offcanvas-lg { --bs-offcanvas-width: 17.5rem; --bs-offcanvas-bg: var(--sidebar); padding: 1rem 0.75rem; overflow-y: auto; }
  .bo-main { padding: 1rem; }
}
/* Wide tables scroll sideways inside their card instead of breaking the page */
.card-ocd.overflow-hidden { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; }
.card-ocd.overflow-hidden > .table-ocd { min-width: 38rem; }
.card-ocd.overflow-hidden > .table-ocd td, .card-ocd.overflow-hidden > .table-ocd th { white-space: normal; }
@media (max-width: 575.98px) {
  h1, .h1 { font-size: 1.5rem; }
  .card-ocd .card-body { padding: 1.125rem; }
  .table-ocd td, .table-ocd thead th { padding: 0.625rem 0.75rem; }
  .row-actions { opacity: 1; }
}
/* Installed app (PWA): respect the phone notch */
@supports (padding: max(0px)) {
  .ocd-header { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .toast-stack { right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* Home FAQ (native details/summary: works without JS, indexable). */
.faq { display: grid; gap: 0.75rem; }
.faq details { padding: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; min-height: var(--control-height); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-weight: 600; line-height: 1.4; }
.faq summary .ph { flex-shrink: 0; color: var(--primary-text); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.faq details[open] summary .ph { transform: rotate(180deg); }
.faq details > p { padding: 0 1.25rem 1.25rem; }
.faq summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 1rem; }

/* PWA install hint */
.install-hint { font-size: 0.8125rem; }

/* Round icon badge on single-message pages (lockout, confirmations). */
.icon-tile { display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem;
  background: var(--primary-soft); color: var(--primary-text); font-size: 1.6rem; }
