/* Clean2You — fond blanc cassé, bleu nuit pour le texte et les boutons, jaune soleil pour les accents. */
:root {
  --bg: #F6F7F3;
  --surface: #FFFFFF;
  --surface-2: #EEF0E9;
  --line: #E1E5DC;
  --line-strong: #C9CFC3;
  --navy: #13294B;
  --navy-soft: #EEF3FA;
  --text: #1D2A3D;
  --muted: #5A6577;
  --sun: #FFC21A;
  --sun-soft: #FFF1C2;
  --ok: #1F7A4D; --ok-bg: #E3F3EA;
  --warn: #7A5000; --warn-bg: #FFF1CC;
  --info: #1E4E8C; --info-bg: #E2ECF8;
  --bad: #A3302A; --bad-bg: #FBE5E3;
  --focus: #2F6FDB;
  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 27px; font-weight: 600; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#view { flex: 1 1 auto; outline: none; }
.page {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 28px max(18px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
.page.wide { max-width: 980px; }
.page.with-tabbar { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.page.with-action { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
.boot { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; }
.logo .wm { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; color: var(--navy); }
.logo .b2 { width: 28px; height: 28px; border-radius: 50%; background: var(--sun); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1; transform: rotate(-10deg); }
.logo-lg .wm { font-size: 34px; }
.logo-lg .b2 { width: 40px; height: 40px; font-size: 29px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--sun); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; text-decoration: none; flex-shrink: 0; }
.chip-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 0; cursor: pointer; font-weight: 700; font-size: 17px; text-decoration: none; text-align: center; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-sun { background: var(--sun); color: var(--navy); }
.btn-ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.btn-outline { background: var(--surface); color: var(--navy); border: 1.5px solid var(--navy); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 15px; border-radius: 12px; }
.linkbtn { background: none; border: 0; padding: 8px 0; color: var(--navy); font-weight: 700; text-decoration: underline; cursor: pointer; }
.iconbtn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--navy); text-decoration: none; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Promo */
.promo { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sun); border-radius: var(--radius); padding: 14px 16px; color: var(--navy); }
.promo b { font-family: var(--display); font-weight: 600; font-size: 18px; display: block; }
.promo span.pill-dark { background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

/* Blocks */
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.block { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 15px; text-decoration: none; color: var(--text); min-height: 128px; transition: border-color .15s, transform .15s; }
.block:hover { border-color: var(--navy); }
.block:active { transform: scale(.98); }
.block .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--navy-soft); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.block .ico svg { width: 30px; height: 30px; stroke-width: 1.9; }
.block strong { font-size: 17px; color: var(--navy); display: block; line-height: 1.25; }
.block small { font-size: 13px; color: var(--muted); }
.block.help { background: var(--navy); border-color: var(--navy); }
.block.help .ico { background: rgba(255,255,255,.12); color: var(--sun); }
.block.help strong { color: #fff; }
.block.help small { color: #C9D5E8; }

/* Flow header */
.flowhead { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.progress span.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.bars { display: grid; gap: 5px; }
.bars i { height: 6px; border-radius: 3px; background: #DCE0D6; }
.bars i.on { background: var(--navy); }
.bars i.cur { background: var(--sun); }
.titleblock { display: flex; flex-direction: column; gap: 4px; }
.titleblock p { color: var(--muted); font-size: 15px; }

/* Options */
.group-title { font-weight: 700; color: var(--navy); font-size: 15px; margin-top: 4px; }
.group-desc { font-size: 13px; color: var(--muted); margin-top: -8px; }
.opt { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.opt.on { background: var(--navy-soft); border: 2px solid var(--navy); padding: 13px; }
.opt .txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.opt .txt strong { color: var(--navy); font-size: 16px; }
.opt .txt small { color: var(--muted); font-size: 13px; }
.opt .txt .price { color: var(--navy); font-weight: 700; font-size: 15px; margin-top: 2px; }
.stepper { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; flex-shrink: 0; }
.opt.on .stepper { background: var(--sun); border-color: var(--sun); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--navy); font-weight: 700; font-size: 22px; cursor: pointer; border-radius: 999px; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 22px; text-align: center; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.m2 { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.m2 input { width: 86px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); }

/* Plan cards */
.plan { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; cursor: pointer; }
.plan[aria-pressed="true"] { background: var(--navy-soft); border: 2px solid var(--navy); padding: 15px; }
.plan .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plan .row1 strong { color: var(--navy); font-size: 17px; }
.plan .amount { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--navy); white-space: nowrap; }
.plan .amount small { font-family: var(--body); font-size: 13px; font-weight: 600; }
.badge { align-self: flex-start; background: var(--sun); color: var(--navy); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.save { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.save s { color: var(--muted); }
.save b { color: var(--ok); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.chips.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 46px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips.grid7 .chip { padding: 8px 0; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: 14px; color: var(--text); }
.field .hint { font-size: 13px; color: var(--muted); }
.input, input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=number], textarea {
  width: 100%; min-height: 50px; border: 1px solid #DCE0D6; border-radius: 14px; background: var(--surface); padding: 11px 14px; font-size: 16px; color: var(--text);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--navy); outline: 2px solid var(--navy); outline-offset: -1px; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--navy-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.note svg { margin-top: 1px; color: var(--navy); }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.success { background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Card + recap */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.line > :first-child { min-width: 0; }
.line > :last-child { text-align: right; }
.line.sub { font-size: 14px; color: var(--muted); }
.line.total { border-top: 2px solid var(--navy); padding-top: 10px; margin-top: 2px; align-items: baseline; }
.line.total b { font-family: var(--display); font-size: 22px; color: var(--navy); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Action bar */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); }
.actionbar .inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px max(18px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
.actionbar .sum { display: flex; flex-direction: column; }
.actionbar .sum span { font-size: 13px; color: var(--muted); }
.actionbar .sum b { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--navy); white-space: nowrap; }
.actionbar .btn { flex: 1 1 auto; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabbar .in { width: 100%; max-width: 560px; display: flex; justify-content: space-around; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 70px; min-height: 52px; padding: 6px 4px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.tabbar a[aria-current="page"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }

/* Map */
.map { height: 260px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #E9EDE2; z-index: 0; }
.map.tall { height: 280px; }
.pin { width: 36px; height: 46px; position: relative; }
.pin::before { content: ""; position: absolute; left: 2px; top: 0; width: 32px; height: 32px; background: var(--navy); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(19,41,75,.35); }
.pin::after { content: ""; position: absolute; left: 11px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--sun); }
.leaflet-container { font-family: var(--body); }
.gpsstate { font-size: 13px; color: var(--muted); }

/* Orders */
.order { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px; text-decoration: none; color: var(--text); }
.order.new { border: 2px solid var(--sun); padding: 13px 14px; }
.order .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order .top strong { color: var(--navy); font-size: 16px; }
.order .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.order .meta b { color: var(--navy); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-nouvelle { background: var(--warn-bg); color: var(--warn); }
.st-confirmee { background: var(--info-bg); color: var(--info); }
.st-terminee { background: var(--ok-bg); color: var(--ok); }
.st-annulee { background: var(--bad-bg); color: var(--bad); }
.zone-head { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--navy); padding-bottom: 4px; }
.zone-head span { font-size: 13px; color: var(--muted); }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--navy); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.toolbar .field { flex: 1 1 160px; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.empty strong { color: var(--text); }
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
td.r, th.r { text-align: right; }
td input[type=number] { min-height: 44px; width: 110px; padding: 8px 10px; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.f { background: var(--sun); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; }
.subtabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.subtabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.done-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 16px 0 4px; }
.done-hero .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--sun); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.done-hero .tick svg { width: 38px; height: 38px; stroke-width: 3; }
.code { font-family: var(--display); font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(19,41,75,.3); }

@media (min-width: 720px) {
  .blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
