/* =====================================================================
   LeivCo — appli mobile
   4 couleurs du logo : violet #53057F · vert #055229 · jaune #D3D510 · blanc
   Le profil choisit la couleur dominante : livré = violet, livreur = vert.
   Le jaune est réservé à l'action (boutons principaux, trajet, prix).
   ===================================================================== */
:root {
  --violet: #53057F; --violet-d: #33024F; --violet-50: #F3EDF7; --violet-100: #E6D8EE;
  --green: #055229;  --green-d: #033A1D;  --green-50: #E7F1EA;  --green-100: #CBE2D3;
  --yellow: #D3D510; --yellow-d: #A9AB0A; --yellow-50: #F9FAD9;
  --white: #FFFFFF;
  --ink: #26033A; --muted: #6D5C78; --line: #E9E1EE; --danger: #B3261E;

  --primary: var(--violet); --primary-d: var(--violet-d); --primary-50: var(--violet-50); --primary-100: var(--violet-100);
  --on-primary: var(--white);

  --font: 'Bricolage Grotesque', system-ui, sans-serif;
  --display: 'Bagel Fat One', 'Bricolage Grotesque', sans-serif;
  --r-sheet: 28px; --r-card: 20px; --r-field: 14px;
  --shadow: 0 10px 30px rgba(51, 2, 79, .14);
  --shadow-sm: 0 3px 10px rgba(51, 2, 79, .10);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 68px;
}
body.role-livreur {
  --primary: var(--green); --primary-d: var(--green-d); --primary-50: var(--green-50); --primary-100: var(--green-100);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--primary-d);
  font-size: 15.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
.lv-illus { width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------- Cadre */
.app {
  position: relative; height: 100%; max-width: 480px; margin: 0 auto;
  background: var(--white); overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 30px 80px rgba(0,0,0,.35);
}
.view { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.has-tabs .view { bottom: calc(var(--tab-h) + var(--safe-b)); }
.screen { min-height: 100%; animation: screenIn .28s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- Splash */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 28px;
  background: var(--violet); transition: opacity .35s ease, visibility .35s;
}
.splash.out { opacity: 0; visibility: hidden; }
.splash-mark { width: 210px; }
.splash-bar { width: 120px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; border-radius: 6px; background: var(--yellow); animation: bar 1s ease-in-out infinite alternate; }
@keyframes bar { from { transform: translateX(-30%); } to { transform: translateX(180%); } }

/* ------------------------------------------------------------- Typo */
.display { font-family: var(--display); font-weight: 400; letter-spacing: .2px; line-height: 1.02; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.h1 { font-family: var(--display); font-size: 34px; font-weight: 400; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: -.2px; }
.h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.money { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 16px; cursor: pointer;
  font-weight: 700; font-size: 16px; transition: transform .12s ease, background .2s, box-shadow .2s; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.btn-action { background: var(--yellow); color: var(--violet-d); box-shadow: 0 4px 0 var(--yellow-d); }
.btn-action:active { box-shadow: 0 1px 0 var(--yellow-d); transform: translateY(3px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 0 var(--primary-d); }
.btn-primary:active { box-shadow: 0 1px 0 var(--primary-d); transform: translateY(3px); }
.btn-soft { background: var(--primary-50); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: #FBE9E8; color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-icon { width: 46px; min-height: 46px; padding: 0; border-radius: 14px; }
.btn .spin { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- Champs */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: 16px; color: var(--primary); font-size: 16px; pointer-events: none; }
.input {
  width: 100%; height: 54px; padding: 0 16px; border: 2px solid var(--line); border-radius: var(--r-field);
  background: var(--white); outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.input-wrap > i + .input { padding-left: 46px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.input::placeholder { color: #A898B2; }
textarea.input { height: auto; min-height: 84px; padding-top: 14px; resize: none; }
.input-suffix { position: absolute; right: 8px; }
.prefix-221 { position: absolute; left: 46px; font-weight: 700; color: var(--muted); pointer-events: none; }
.prefix-221 + .input { padding-left: 96px !important; }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1 1 0; min-width: 82px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--white);
  cursor: pointer; font-size: 13px; font-weight: 600; text-align: center; transition: border-color .15s, background .15s;
}
.choice i { font-size: 20px; color: var(--primary); }
.choice.on { border-color: var(--primary); background: var(--primary-50); }

.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 32px; background: var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(22px); }

.otp { display: flex; gap: 10px; justify-content: center; }
.otp input { width: 58px; height: 66px; text-align: center; font-size: 28px; font-weight: 800; border: 2px solid var(--line); border-radius: 16px; outline: none; }
.otp input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }

/* ------------------------------------------------------------- Cartes / listes */
.pad { padding: 20px; }
.stack > * + * { margin-top: 12px; }
.card { background: var(--white); border-radius: var(--r-card); border: 1.5px solid var(--line); padding: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 28px; font-size: 12.5px; font-weight: 700; background: var(--primary-50); color: var(--primary); }
.chip-yellow { background: var(--yellow); color: var(--violet-d); }
.chip-green { background: var(--green-50); color: var(--green); }
.chip-violet { background: var(--violet-50); color: var(--violet); }
.chip-grey { background: #F1EEF3; color: var(--muted); }
.icon-bubble { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); font-size: 19px; }
.icon-bubble.yellow { background: var(--yellow); color: var(--violet-d); }
.icon-bubble.green { background: var(--green); color: var(--yellow); }
.icon-bubble.violet { background: var(--violet); color: var(--yellow); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--yellow); font-weight: 800; font-size: 18px; }
.divider { height: 1.5px; background: var(--line); margin: 14px 0; border: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1.5px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }

.empty { text-align: center; padding: 30px 24px; }
.empty .lv-illus { width: 170px; margin: 0 auto 14px; }

.skeleton { background: linear-gradient(90deg, #F1ECF4 25%, #F8F5FA 50%, #F1ECF4 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------- En-tête de page */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--white); }
.topbar .h2 { flex: 1; }
.back { width: 42px; height: 42px; border-radius: 13px; border: 0; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; cursor: pointer; font-size: 17px; }

.hero-band { background: var(--primary); color: var(--white); padding: calc(22px + env(safe-area-inset-top, 0px)) 20px 70px; position: relative; }
.hero-band + .pull-up { margin-top: -50px; position: relative; }

/* ------------------------------------------------------------- Barre d'onglets */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--white); border-top: 1.5px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #9C8CA6; }
.tabbar a i { font-size: 20px; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on i { transform: translateY(-1px); }
.tab-sam-face { width: 46px; height: 46px; margin-top: -24px; border-radius: 50%; border: 4px solid var(--white); box-shadow: var(--shadow-sm); overflow: hidden; }
.tabbar a.tab-sam.on .tab-sam-face { border-color: var(--yellow); }

/* ------------------------------------------------------------- Onboarding */
.onb { min-height: 100%; display: flex; flex-direction: column; background: var(--violet); color: var(--white); }
.onb-top { padding: calc(28px + env(safe-area-inset-top, 0px)) 24px 0; }
.onb-word { width: 150px; }
.onb-title { font-family: var(--display); font-size: 40px; line-height: 1; margin: 22px 0 10px; color: var(--white); }
.onb-sub { color: #E3D3EC; max-width: 32ch; }
.onb-roles { margin-top: auto; padding: 24px 18px calc(22px + var(--safe-b)); display: grid; gap: 14px; }
.role-card {
  display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 14px; padding: 14px 16px 14px 10px; text-align: left;
  border-radius: 24px; border: 0; cursor: pointer; transition: transform .15s;
}
.role-card:active { transform: scale(.98); }
.role-card .lv-illus { width: 112px; }
.role-card b { display: block; font-family: var(--display); font-size: 26px; font-weight: 400; line-height: 1; margin-bottom: 4px; }
.role-card span { font-size: 14px; }
.role-card.livre { background: var(--white); color: var(--violet); }
.role-card.livreur { background: var(--green); color: var(--white); }
.role-card.livreur b { color: var(--yellow); }
.onb-login { text-align: center; color: #E3D3EC; font-size: 14.5px; }
.onb-login a { color: var(--yellow); font-weight: 700; }

/* ------------------------------------------------------------- Auth */
.auth-head { background: var(--primary); color: var(--white); padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 34px; border-radius: 0 0 32px 32px; }
.auth-head .back { background: rgba(255,255,255,.14); color: var(--white); }
.auth-head .h1 { margin-top: 18px; padding-right: 120px; }
.auth-head p { margin: 8px 0 0; color: rgba(255,255,255,.8); padding-right: 120px; }
.auth-illus { width: 120px; position: absolute; right: 16px; top: calc(60px + env(safe-area-inset-top, 0px)); }
.auth-form { padding: 24px 20px calc(30px + var(--safe-b)); }
.demo-box { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--yellow-50); border: 1.5px dashed var(--yellow-d); font-size: 13.5px; }
.demo-box button { margin-top: 8px; }

/* ------------------------------------------------------------- Carte (écran d'accueil) */
.map-screen { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; background: #EEE8F2; }
.map-top { position: absolute; left: 0; right: 0; top: 0; z-index: 500; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 0; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.hello { flex: 1; background: var(--white); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; }
.hello .avatar { width: 38px; height: 38px; font-size: 15px; }
.hello b { display: block; font-size: 15px; }
.hello small { color: var(--muted); font-size: 12.5px; }
.map-fab { width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--white); box-shadow: var(--shadow); color: var(--primary); font-size: 18px; display: grid; place-items: center; cursor: pointer; }
.map-tools { position: absolute; right: 14px; z-index: 500; display: grid; gap: 10px; transition: bottom .3s ease; }
.layer-pill { position: absolute; left: 14px; z-index: 500; display: flex; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 4px; gap: 2px; transition: bottom .3s ease; }
.layer-pill button { border: 0; background: transparent; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.layer-pill button.on { background: var(--primary); color: var(--white); }

/* Feuille fixe en bas de la carte */
.dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 600; background: var(--white);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -10px 40px rgba(51, 2, 79, .18);
  max-height: 78%; display: flex; flex-direction: column; transition: max-height .3s ease;
}
.dock-grip { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 10px auto 2px; flex: none; }
.dock-body { padding: 8px 18px 18px; overflow-y: auto; }

.where { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; align-items: stretch; }
.where-rail { display: flex; flex-direction: column; align-items: center; padding: 18px 0; }
.where-rail .dot-a { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); border: 4px solid var(--violet); }
.where-rail .line { flex: 1; width: 3px; margin: 4px 0; background: repeating-linear-gradient(var(--primary) 0 5px, transparent 5px 10px); }
.where-rail .dot-b { width: 18px; height: 18px; border-radius: 5px; background: var(--green); border: 4px solid var(--green-100); }
.where-fields { display: grid; gap: 8px; }
.where-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 14px; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: var(--white); cursor: pointer;
}
.where-btn.set { border-color: var(--primary-100); background: var(--primary-50); }
.where-btn small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.where-btn b { display: block; font-weight: 700; font-size: 15px; }
.where-btn .grow { overflow: hidden; }

.quote-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--violet); color: var(--white); }
.quote-bar .money { font-size: 26px; color: var(--yellow); }
.quote-lines { font-size: 13px; color: rgba(255,255,255,.78); }

.courier-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.courier-strip::-webkit-scrollbar { display: none; }
.courier-pick { flex: none; width: 132px; padding: 12px; border-radius: 18px; border: 2px solid var(--line); background: var(--white); cursor: pointer; text-align: left; }
.courier-pick.on { border-color: var(--green); background: var(--green-50); }
.courier-pick .avatar { width: 38px; height: 38px; font-size: 14px; margin-bottom: 8px; }
.courier-pick b { display: block; font-size: 14px; }
.courier-pick small { color: var(--muted); font-size: 12px; display: block; }

/* Pointeur central (choisir sur la carte) */
.center-pin { position: absolute; left: 50%; top: 42%; z-index: 550; transform: translate(-50%, -100%); pointer-events: none; text-align: center; }
.center-pin .pin-head { width: 54px; height: 54px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--yellow); border: 5px solid var(--violet); display: grid; place-items: center; margin: 0 auto; box-shadow: var(--shadow); }
.center-pin .pin-head span { transform: rotate(45deg); font-weight: 800; color: var(--violet); font-size: 20px; }
.center-pin.b .pin-head { background: var(--green); border-color: var(--green-100); }
.center-pin.b .pin-head span { color: var(--yellow); }
.center-pin .pin-shadow { width: 16px; height: 6px; border-radius: 50%; background: rgba(51,2,79,.3); margin: 8px auto 0; }
.center-pin.lift .pin-head { transform: rotate(-45deg) translate(6px, -6px); }

/* ------------------------------------------------------------- Marqueurs Leaflet (2D) */
.lv-marker { background: none; border: 0; }
.mk-a, .mk-b { position: relative; width: 44px; height: 54px; }
.mk-a .head, .mk-b .head { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 4px 10px rgba(51,2,79,.3); }
.mk-a .head { background: var(--yellow); border: 4px solid var(--violet); }
.mk-b .head { background: var(--green); border: 4px solid var(--white); }
.mk-a .head b, .mk-b .head b { transform: rotate(45deg); font-weight: 800; font-size: 17px; }
.mk-a .head b { color: var(--violet); }
.mk-b .head b { color: var(--yellow); }
.mk-courier { width: 46px; height: 46px; position: relative; }
.mk-courier .ring { position: absolute; inset: -8px; border-radius: 50%; background: rgba(5, 82, 41, .22); animation: ring 1.8s ease-out infinite; }
.mk-courier .body { position: absolute; inset: 0; border-radius: 50%; background: var(--green); border: 4px solid var(--white); display: grid; place-items: center; color: var(--yellow); font-size: 17px; box-shadow: 0 4px 10px rgba(5, 82, 41, .4); }
.mk-courier .arrow { position: absolute; left: 50%; top: -9px; margin-left: -7px; width: 0; height: 0; border: 7px solid transparent; border-bottom: 9px solid var(--green); border-top: 0; transform-origin: 7px 32px; }
.mk-courier.pro .body { border-color: var(--yellow); }
.mk-courier.small { width: 34px; height: 34px; }
.mk-courier.small .body { font-size: 13px; border-width: 3px; }
.mk-courier.small .ring { display: none; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.mk-me { width: 22px; height: 22px; border-radius: 50%; background: var(--violet); border: 4px solid var(--white); box-shadow: 0 0 0 6px rgba(83, 5, 127, .2); }
.mk-job { width: 42px; height: 42px; border-radius: 14px; background: var(--yellow); border: 3px solid var(--violet); display: grid; place-items: center; color: var(--violet); font-size: 17px; box-shadow: 0 4px 10px rgba(51,2,79,.3); }
.mk-job.mine { background: var(--violet); color: var(--yellow); border-color: var(--yellow); }
.route-label { background: var(--violet); color: var(--white); border: 0; border-radius: 12px; padding: 5px 10px; font-family: var(--font); font-weight: 700; font-size: 12.5px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.route-label::before { display: none; }
.ring-label { background: var(--white); color: var(--primary); border: 2px solid var(--primary); border-radius: 10px; padding: 2px 8px; font-family: var(--font); font-weight: 700; font-size: 11.5px; box-shadow: none; }
.ring-label::before { display: none; }
.route-dash { animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -26; } }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75) !important; border-radius: 8px 0 0 0; }
.leaflet-control-zoom { display: none; }
/* Calque LeivCo : tuiles adoucies + voile de la couleur du profil */
.lv-style .lv-base { filter: saturate(.35) contrast(.95) brightness(1.04); }
.lv-tint { position: absolute; inset: 0; z-index: 250; pointer-events: none; background: var(--primary); opacity: .055; mix-blend-mode: multiply; }

/* ------------------------------------------------------------- Suivi */
.track-progress { position: absolute; left: 14px; right: 14px; z-index: 500; top: calc(72px + env(safe-area-inset-top, 0px)); background: var(--white); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.track-road { position: relative; height: 10px; border-radius: 10px; background: var(--primary-50); margin: 10px 4px 4px; }
.track-road .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; background: var(--yellow); transition: width .8s ease; }
.track-road .bike { position: absolute; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: var(--green); border: 3px solid var(--white); color: var(--yellow); display: grid; place-items: center; font-size: 13px; transition: left .8s ease; box-shadow: var(--shadow-sm); }
.track-road .end { position: absolute; right: -6px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 6px; background: var(--green); border: 3px solid var(--white); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 14px; }
.step { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.step i { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 6px; border-radius: 13px; background: #F1EEF3; color: #B3A5BC; font-size: 15px; }
.step.done i { background: var(--primary); color: var(--yellow); }
.step.now i { background: var(--yellow); color: var(--violet-d); box-shadow: 0 0 0 5px var(--yellow-50); }
.step.now, .step.done { color: var(--ink); }
.code-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--yellow-50); border: 1.5px dashed var(--yellow-d); }
.code-box .code { font-size: 26px; font-weight: 800; letter-spacing: 6px; color: var(--violet); }

/* ------------------------------------------------------------- Livreur */
.online-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--green); color: var(--white); }
.online-card.off { background: #F1EEF3; color: var(--ink); }
.online-card b { display: block; font-size: 16px; }
.online-card small { opacity: .8; }
.online-card .switch span { background: rgba(255,255,255,.25); }
.online-card.off .switch span { background: #D9D0DF; }
.online-card .switch input:checked + span { background: var(--yellow); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: 16px; background: var(--primary-50); }
.stat b { display: block; font-size: 18px; font-weight: 800; color: var(--primary); }
.stat small { font-size: 12px; color: var(--muted); }
.job-card { border: 2px solid var(--line); border-radius: 20px; padding: 14px; }
.job-card.for-me { border-color: var(--yellow); background: var(--yellow-50); }
.job-route { display: grid; grid-template-columns: 14px 1fr; gap: 4px 10px; font-size: 14px; margin: 10px 0 12px; }
.job-route .a { width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--violet); margin-top: 4px; }
.job-route .b { width: 12px; height: 12px; border-radius: 3px; background: var(--green); margin-top: 4px; }

/* ------------------------------------------------------------- Courses (liste) */
.seg { display: flex; padding: 4px; border-radius: 14px; background: var(--primary-50); gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
.run { display: flex; gap: 12px; padding: 14px; border-radius: 18px; border: 1.5px solid var(--line); cursor: pointer; }
.run + .run { margin-top: 10px; }
.status-pending { background: var(--yellow-50); color: #6E6F00; }
.status-accepted, .status-picked_up { background: var(--green-50); color: var(--green); }
.status-delivered { background: var(--violet-50); color: var(--violet); }
.status-cancelled { background: #F1EEF3; color: var(--muted); }

/* ------------------------------------------------------------- Formules */
.plan { position: relative; border-radius: 22px; border: 2px solid var(--line); padding: 18px; background: var(--white); }
.plan.hl { border-color: var(--primary); }
.plan.hl::before { content: 'Le plus choisi'; position: absolute; top: -12px; right: 16px; background: var(--yellow); color: var(--violet-d); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 10px; }
.plan .price { font-family: var(--display); font-size: 34px; color: var(--primary); line-height: 1; }
.plan .price small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; gap: 8px; font-size: 14.5px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li i { color: var(--green); margin-top: 3px; }
.sub-now { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: var(--primary); color: var(--white); }
.sub-now .lv-illus { width: 86px; flex: none; }

.pay-provider { margin-bottom: 16px; }
.pay-provider h4 { margin: 0 0 8px 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pay-tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.pay-tile.on { border-color: var(--primary); background: var(--primary-50); }
.pay-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.pay-check { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); color: var(--primary); font-size: 24px; display: none; }
.pay-tile.on .pay-check { display: block; }
/* Cadre standard des logos : ratio 2:1, l'image est centrée et entièrement visible quelle que soit sa taille */
.pay-logo { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2 / 1; border-radius: 12px; background: var(--white); border: 1px solid rgba(38, 3, 58, .08); overflow: hidden; color: var(--primary); font-size: 22px; }
.pay-logo img { position: absolute; top: 10%; left: 8%; width: 84%; height: 80%; object-fit: contain; object-position: center; background: var(--white); }
.pay-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.pay-wait { text-align: center; padding: 10px 6px 4px; }
.pay-wait .lv-illus { width: 150px; margin: 0 auto 10px; }

/* ------------------------------------------------------------- Sam */
.sam-screen { display: flex; flex-direction: column; height: 100%; background: var(--violet-50); }
.sam-head { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px; background: var(--violet); color: var(--white); }
.sam-head .face { width: 52px; height: 52px; flex: none; }
.sam-head b { font-family: var(--display); font-size: 24px; font-weight: 400; display: block; line-height: 1; }
.sam-head small { color: #E3D3EC; }
.sam-head .back { background: rgba(255,255,255,.14); color: var(--white); }
.sam-feed { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 84%; padding: 11px 14px; border-radius: 20px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--violet); color: var(--white); border-bottom-right-radius: 6px; }
.bubble.sam { align-self: flex-start; background: var(--white); border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm); }
.bubble.sam .speak { border: 0; background: none; color: var(--violet); cursor: pointer; padding: 4px 0 0; font-size: 13px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.typing span { display: inline-block; width: 8px; height: 8px; margin: 0 2px; border-radius: 50%; background: var(--violet); animation: typing 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.sam-sugg { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.sam-sugg::-webkit-scrollbar { display: none; }
.sam-sugg button { flex: none; border: 1.5px solid var(--violet-100); background: var(--white); color: var(--violet); border-radius: 14px; padding: 8px 12px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.sam-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); background: var(--white); border-top: 1.5px solid var(--line); }
.sam-input .input { height: 50px; border-radius: 25px; }
.sam-input .btn-icon { border-radius: 50%; width: 50px; min-height: 50px; }
.mic.rec { background: var(--danger); color: var(--white); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(179,38,30,.18); } }
.sam-intro { text-align: center; padding: 18px 20px 6px; }
.sam-intro .lv-illus { width: 110px; margin: 0 auto 10px; }

/* ------------------------------------------------------------- Profil */
.profile-head { text-align: center; padding: calc(26px + env(safe-area-inset-top, 0px)) 20px 66px; background: var(--primary); color: var(--white); }
.profile-head .avatar { width: 78px; height: 78px; font-size: 28px; margin: 0 auto 10px; background: var(--yellow) !important; color: var(--primary); }
.profile-head .h2 { color: var(--white); }
.menu { border-radius: 22px; background: var(--white); box-shadow: var(--shadow); padding: 4px 16px; }
.menu .list-item i.lead { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.menu .list-item .fa-chevron-right { color: #C2B5CB; font-size: 13px; }

/* ------------------------------------------------------------- Feuilles & modales */
.sheet-layer { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(38, 3, 58, .45); animation: fade .2s ease; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 90vh; background: var(--white); border-radius: var(--r-sheet) var(--r-sheet) 0 0; display: flex; flex-direction: column; animation: sheetUp .28s cubic-bezier(.2,.9,.3,1.1); }
.sheet-grip { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet-body { padding: 10px 20px calc(22px + var(--safe-b)); overflow-y: auto; }
.sheet-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

.modal-layer { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 24px; background: rgba(38, 3, 58, .5); animation: fade .2s; }
.modal-card { width: 100%; max-width: 360px; background: var(--white); border-radius: 26px; padding: 24px 20px 18px; text-align: center; animation: pop .25s cubic-bezier(.2,.9,.3,1.3); }
.modal-card .icon-bubble { width: 60px; height: 60px; border-radius: 20px; font-size: 24px; margin: 0 auto 14px; }
.modal-card h3 { font-size: 19px; margin-bottom: 6px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: grid; gap: 8px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

.search-results { margin-top: 6px; }
.search-results .list-item { padding: 12px 4px; }
.search-results .list-item i { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }

.toasts { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 1000; width: calc(100% - 28px); max-width: 440px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: var(--white); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); pointer-events: auto; }
.toast i { font-size: 18px; }
.toast.ok i { color: var(--yellow); }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } }

/* Grand écran : l'appli reste un téléphone centré */
@media (min-width: 520px) {
  body { background: var(--primary-d) radial-gradient(circle at 20% 20%, rgba(211,213,16,.08), transparent 40%); }
  .app { height: calc(100% - 40px); margin-top: 20px; border-radius: 34px; }
}
