/* =====================================================================
   DriveLess — tunnel de réservation et espace client
   ===================================================================== */
.page-hero-sm { padding-bottom: 34px; }
.page-hero-sm h1 { font-size: clamp(34px, 4vw, 50px); }

.stepper { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: s; }
.stepper li {
    display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13px; color: var(--muted); cursor: pointer; transition: all .3s var(--ease);
}
html[dir="rtl"] .stepper li { padding: 7px 7px 7px 14px; }
.stepper li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .06); font-weight: 700; font-size: 12px; transition: all .3s; }
.stepper li.is-done { color: var(--text-2); }
.stepper li.is-done span { background: var(--accent-soft); color: var(--accent); }
.stepper li.is-active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.stepper li.is-active span { background: var(--accent); color: var(--on-accent); }

.booking-layout { display: grid; grid-template-columns: 1fr 370px; gap: 26px; align-items: start; }
.booking-steps { display: grid; gap: 18px; min-width: 0; }
.step-card { margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); min-width: 0; scroll-margin-top: 100px; }
.step-card legend { float: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 18px; font-size: 18px; font-weight: 700; }
html[dir="rtl"] .step-card legend { float: right; }
.step-card legend + * { clear: both; }
.step-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 15px; }
.step-hint { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 16px; }
.step-hint .ico { color: var(--accent); }
.sub-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 4px 0 14px; color: var(--text-2); }
.sub-title .ico { color: var(--accent); }

.step-vehicle { display: flex; align-items: center; gap: 16px; padding: 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.step-vehicle img { width: 120px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.step-vehicle img.is-placeholder { object-fit: contain; padding: 8px; }
.step-vehicle div { display: grid; gap: 2px; }
.step-vehicle .link { font-size: 13px; }
.search-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search-steps > .field, .search-steps > [data-retour-agence] { grid-column: span 1; }
.search-steps .field-row { grid-column: 1 / -1; margin-top: 0 !important; }
.search-steps .one-way { grid-column: 1 / -1; margin-top: 0; }
.search-steps [data-retour-agence], .search-steps [data-retour-agence].is-open { margin-top: 0 !important; }

.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.option-card {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; user-select: none;
    transition: border-color .25s, background .25s, transform .3s var(--ease);
}
.option-card:hover { border-color: rgba(var(--accent-rgb), .5); transform: translateY(-2px); }
.option-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.option-icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--accent); transition: background .25s, color .25s; }
.option-card.is-selected .option-icon { background: var(--accent); color: var(--on-accent); }
.option-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.option-body strong { font-size: 14px; }
.option-body small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.option-body em { font-style: normal; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.option-check { position: absolute; opacity: 0; pointer-events: none; }
.option-tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-2); color: transparent; transition: all .25s var(--ease); flex-shrink: 0; }
.option-tick .ico { width: 15px; height: 15px; }
.option-card.is-selected .option-tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.08); }
.qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty button { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 8px; background: none; color: var(--text); }
.qty button:hover { border-color: var(--accent); color: var(--accent); }
.qty button .ico { width: 14px; height: 14px; }
.qty input { width: 30px; border: 0; background: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.toggle-card { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px; border: 1px dashed var(--line-2); border-radius: 14px; cursor: pointer; transition: border-color .25s, background .25s; }
.toggle-card:hover, .toggle-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.toggle-card input { width: 18px; height: 18px; accent-color: var(--accent); }
.toggle-card span { display: grid; gap: 2px; }
.toggle-card strong { display: inline-flex; align-items: center; gap: 8px; }
.toggle-card .ico { color: var(--accent); }
.toggle-card small { color: var(--muted); font-size: 12.5px; }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease), opacity .3s; opacity: 0; }
.collapse > * { overflow: hidden; min-height: 0; }
.collapse.is-open { grid-template-rows: 1fr; opacity: 1; }
.collapse.is-open > div > .sub-title { margin-top: 22px; }

.docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dropzone {
    position: relative; display: grid; justify-items: center; gap: 6px; padding: 22px 16px; text-align: center;
    border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; overflow: hidden; isolation: isolate;
    transition: border-color .25s, background .25s;
}
.dropzone::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--preview, none) center / cover; opacity: .18; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dropzone.has-error { border-color: var(--danger); }
.dropzone > .ico { width: 26px; height: 26px; color: var(--accent); transition: transform .3s var(--ease); }
.dropzone:hover > .ico { transform: translateY(-3px); }
.dz-label { font-size: 14px; font-weight: 600; }
.dz-file { font-size: 12px; color: var(--muted); word-break: break-all; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-option { position: relative; cursor: pointer; }
.pay-option input { position: absolute; opacity: 0; }
.pay-option > span { display: grid; gap: 4px; height: 100%; padding: 16px; border: 1px solid var(--line-2); border-radius: 14px; transition: all .25s var(--ease); }
.pay-option .ico { width: 24px; height: 24px; color: var(--accent); margin-bottom: 6px; }
.pay-option small { font-size: 12.5px; color: var(--muted); }
.pay-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pay-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-option.is-disabled { cursor: not-allowed; opacity: .5; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }

.booking-recap { padding: 18px; }
.recap-media { margin: -18px -18px 14px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: radial-gradient(ellipse at 50% 100%, #24313a, var(--bg-2) 70%); }
.recap-media img { width: 100%; height: 100%; object-fit: cover; }
.recap-media img.is-placeholder { object-fit: contain; padding: 20px; }
.booking-recap h2 { font-size: 18px; margin-bottom: 12px; }
.recap-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.recap-dates small { display: block; font-size: 11.5px; color: var(--muted); }
.recap-dates strong { font-size: 13px; }
.recap-dates .ico { color: var(--accent); }
.recap-dates div:last-child { text-align: end; }

/* Confirmation */
.confirm-hero { text-align: center; }
.confirm-check {
    display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 22px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 12px var(--accent-soft), var(--shadow-accent);
    animation: pop .7s var(--ease) both;
}
.confirm-check .ico { width: 44px; height: 44px; stroke-width: 2.6; }
.confirm-check .ico path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ref-badge { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); font-weight: 700; letter-spacing: .04em; margin-top: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-item small { display: block; font-size: 12px; color: var(--muted); }
.detail-item strong { font-size: 14.5px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { position: relative; display: flex; gap: 14px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 15px; top: 34px; bottom: -14px; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .dot { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.timeline .dot .ico { width: 16px; height: 16px; }
.timeline strong { display: block; font-size: 14px; }
.timeline span { font-size: 13px; color: var(--muted); }

/* ---------------- Espace client ---------------- */
.account { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; }
.account-nav { position: sticky; top: calc(var(--header-h) + 16px); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.account-user { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.account-user .avatar { width: 44px; height: 44px; font-size: 15px; }
.account-user strong { display: block; font-size: 14.5px; }
.account-user small { color: var(--muted); font-size: 12px; }
.account-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--text-2); transition: background .2s, color .2s; }
.account-nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.account-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.account-nav a .ico { width: 18px; height: 18px; }
.account-nav .badge { margin-inline-start: auto; }
.account-main { display: grid; gap: 18px; min-width: 0; }
.account-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.account-head h1 { font-size: 28px; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: transform .3s var(--ease), border-color .3s; }
.kpi:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .4); }
.kpi .ico { width: 22px; height: 22px; color: var(--accent); margin-bottom: 10px; }
.kpi strong { display: block; font-size: 24px; line-height: 1.1; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: rgba(255, 255, 255, .07); color: var(--text-2); }
.badge-en_attente { background: rgba(242, 184, 75, .14); color: var(--warning); }
.badge-confirmee { background: var(--accent-soft); color: var(--accent); }
.badge-en_cours { background: rgba(80, 160, 255, .14); color: #6fb2ff; }
.badge-terminee { background: rgba(60, 207, 142, .12); color: var(--success); }
.badge-annulee, .badge-no_show, .badge-impayee { background: rgba(240, 97, 109, .12); color: var(--danger); }
.badge-payee { background: rgba(60, 207, 142, .12); color: var(--success); }
.badge-partielle { background: rgba(242, 184, 75, .14); color: var(--warning); }
.resa-list { display: grid; gap: 12px; }
.resa-item {
    display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; padding: 14px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color .25s, transform .3s var(--ease);
}
.resa-item:hover { border-color: rgba(var(--accent-rgb), .45); transform: translateX(3px); }
html[dir="rtl"] .resa-item:hover { transform: translateX(-3px); }
.resa-item img { width: 110px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.resa-item img.is-placeholder { object-fit: contain; padding: 6px; }
.resa-item h3 { font-size: 15px; margin: 0 0 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.resa-item p { margin: 0; font-size: 13px; color: var(--muted); }
.resa-item .amount { text-align: end; }
.resa-item .amount strong { display: block; font-size: 16px; color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars input { display: none; }
.stars label { cursor: pointer; color: var(--line-2); transition: color .15s, transform .2s var(--ease); }
.stars label .ico { width: 28px; height: 28px; fill: currentColor; }
.stars label:hover { transform: scale(1.15); }
.stars:hover label { color: var(--warning); }
.stars label:hover ~ label { color: var(--line-2); }
.stars input:checked ~ label { color: var(--line-2); }
.stars:not(:hover) label.is-on { color: var(--warning); }

@media (max-width: 1100px) {
    .booking-layout { grid-template-columns: 1fr; }
    .booking-recap { position: static; order: 2; }
    .account { grid-template-columns: 1fr; }
    .account-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .account-user { width: 100%; }
    .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .options-grid, .docs-grid, .pay-options, .search-steps, .detail-grid { grid-template-columns: 1fr; }
    .resa-item { grid-template-columns: 80px 1fr; }
    .resa-item img { width: 80px; height: 56px; }
    .resa-item .amount { grid-column: 1 / -1; text-align: start; display: flex; justify-content: space-between; align-items: center; }
}

/* ---------------- Espace entreprise (flotte LLD) ---------------- */
.meter { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 8px; max-width: 320px; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width 1.2s var(--ease); }
.meter.warn > i { background: linear-gradient(90deg, #c98a1d, var(--warning)); }
.meter.danger > i { background: linear-gradient(90deg, #b8424d, var(--danger)); }
.list-plain { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; padding-bottom: 0; }
.small { font-size: 12.5px; }
.badge-declaree, .badge-demandee, .badge-attention { background: rgba(242, 184, 75, .14); color: var(--warning); }
.badge-prise_en_charge, .badge-en_route, .badge-sur_place, .badge-remorquage { background: rgba(80, 160, 255, .14); color: #6fb2ff; }
.badge-resolue, .badge-cloturee, .badge-actif, .badge-valide { background: rgba(60, 207, 142, .12); color: var(--success); }
.badge-urgent, .badge-refuse { background: rgba(240, 97, 109, .14); color: var(--danger); }
.steps-h { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 6px; }
.steps-h span { position: relative; padding-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.steps-h span::before { content: ""; position: absolute; top: 6px; inset-inline: 0; height: 3px; border-radius: 2px; background: var(--line-2); }
.steps-h span.done { color: var(--text); }
.steps-h span.done::before { background: var(--accent); }
.steps-h span.current { color: var(--accent); font-weight: 600; }
.sla { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .3); }
.sla.late { background: rgba(240, 97, 109, .1); border-color: rgba(240, 97, 109, .35); }
.sla strong { font-size: 18px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
@media (max-width: 760px) { .steps-h { grid-template-columns: repeat(3, 1fr); } }
.steps-h span.current::before { background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), .35)); }

/* ---------- Espace client : assistance, prolongation, livraison ---------- */
.alert-warning { border-color: rgba(242, 184, 75, .45); background: rgba(242, 184, 75, .08); }
.assist-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.assist-carte { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); transition: border-color .2s, transform .2s; }
.assist-carte:hover { border-color: var(--accent); transform: translateY(-2px); }
.assist-carte svg { width: 26px; height: 26px; color: var(--accent); }
.assist-carte small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.assist-carte.is-urgent { border-color: rgba(var(--coral-rgb), .5); }
.assist-carte.is-urgent svg { color: var(--coral); }
.suivi-etapes { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.suivi-etapes li { position: relative; flex: 1; display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.suivi-etapes li span { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--panel); }
.suivi-etapes li::before { content: ""; position: absolute; top: 8px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line-2); }
.suivi-etapes li:first-child::before { display: none; }
.suivi-etapes li.is-done, .suivi-etapes li.is-current { color: var(--text); }
.suivi-etapes li.is-done span { background: var(--accent); border-color: var(--accent); }
.suivi-etapes li.is-done::before, .suivi-etapes li.is-current::before { background: var(--accent); }
.suivi-etapes li.is-current span { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fil { display: grid; gap: 12px; }
.fil-msg { max-width: 86%; padding: 12px 16px; border-radius: 16px; background: var(--panel-2); line-height: 1.55; }
.fil-msg.fil-client { justify-self: end; background: var(--accent-soft); }
.fil-msg.fil-systeme { justify-self: center; max-width: 100%; padding: 4px 12px; background: none; color: var(--muted); font-size: 13px; }
.fil-meta { margin-bottom: 4px; font-size: 13px; }
@media (max-width: 760px) { .assist-actions { grid-template-columns: 1fr; } .fil-msg { max-width: 100%; } }
