:root {
  --ink: #1A1A1A;
  --muted: #5F5F5F;
  --faint: #8C857D;
  --bg: #FAF7F3;
  --card: #FFFFFF;
  --line: #DDD6CE;
  --soft: #F4EFE8;
  --red: #E50000;
  --red-dark: #B00000;
  --orange: #F58220;
  --warn-bg: #FDEBD9;
  --warn-ink: #5C2700;
  --warn: #8A3B00;
  --ok-bg: #E4F2E7;
  --ok-ink: #144A24;
  --ok: #1E6B34;
  --grey-bg: #ECE7E0;
  --slab: 'Roboto Slab', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.4; }
a { color: var(--red-dark); }
a:hover { color: #800000; }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--slab); font-size: 21px; }
h2 { font-size: 15px; font-weight: 700; }
h2.slab { font-family: var(--slab); font-size: 17px; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.content { flex: 1; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.plate { font-family: var(--slab); font-weight: 700; letter-spacing: .5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 5; padding: 12px 14px 10px 16px; padding-top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border-bottom: 4px solid var(--orange); }
.top .logo { height: 34px; width: auto; display: block; }
.top-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-title { font-family: var(--slab); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.langs { display: flex; gap: 2px; }
.langs a { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.langs a.on { background: var(--ink); color: #fff; font-weight: 700; }

/* Cartes, boutons */
.card { background: var(--card); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card.warnline { box-shadow: inset 0 0 0 1.5px var(--orange); }
.card.selected { box-shadow: inset 0 0 0 2px var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 600 14px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { color: var(--ink); border-color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.outline-dark { border-color: var(--ink); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.warn-outline { border-color: var(--warn); color: var(--warn-ink); background: transparent; }
.btn.big { min-height: 52px; border-radius: 14px; font-size: 16px; font-weight: 700; width: 100%; }
.btn.link { border: 0; background: transparent; color: var(--red-dark); padding: 0 4px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
form.inline { display: contents; }

/* Pastilles et messages */
.pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.pill.en_attente { color: var(--warn); background: var(--warn-bg); }
.pill.confirme, .pill.effectue { color: var(--ok); background: var(--ok-bg); }
.pill.propose, .pill.refuse, .pill.annule { color: var(--ink); background: var(--grey-bg); }
.pill.unknown { color: var(--warn); background: var(--warn-bg); }
.alert { border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.err { background: #FDE0E0; color: #6B0000; }
.alert svg { flex-shrink: 0; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: 16px Inter, system-ui, sans-serif; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
textarea { resize: vertical; }
input.plate-input { font-family: var(--slab); font-weight: 700; font-size: 17px; letter-spacing: 1px; text-transform: uppercase; }
input.plate-input::placeholder { text-transform: none; font-family: Inter, system-ui, sans-serif; font-weight: 400; letter-spacing: 0; color: var(--faint); }
.check { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 12px; padding: 12px; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--red); flex-shrink: 0; }

/* Choix (motifs, créneaux, véhicules) en boutons radio */
.choices { display: grid; gap: 6px; }
.choices.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choice span, a.choice-link { min-height: 44px; padding: 4px 6px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; cursor: pointer; }
a.choice-link { min-height: 52px; font-size: 12px; }
a.choice-link.on, .choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.choice span small { font-size: 9px; font-weight: 600; color: var(--warn); }
.choice.booked span { border-color: var(--orange); background: #FFF6EE; }
.choice.booked input:checked + span small { color: #FFD2A8; }
.choice.off span { border-style: dashed; background: transparent; color: var(--faint); text-decoration: line-through; font-weight: 500; cursor: not-allowed; }
.veh { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; background: #fff; border-radius: 12px; border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; }
.veh input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
.veh:has(input:checked) { border-color: var(--ink); }

/* Calendrier mensuel client */
.cal { background: #fff; border-radius: 16px; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head strong { font-family: var(--slab); font-size: 16px; }
.cal-head .icon-btn.disabled { opacity: .25; pointer-events: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cal-grid .day { height: 44px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--soft); }
.cal-grid .day.closed { background: transparent; color: var(--faint); font-weight: 500; }
.cal-grid .day.sel { background: var(--ink); color: #fff; font-weight: 700; }
.dot { width: 5px; height: 5px; border-radius: 99px; background: var(--orange); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 4px 0; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

/* Calendrier concierge (semaine) */
.week-day { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.week-day.today { box-shadow: inset 0 0 0 2px var(--red); }
.week-day.closed { background: var(--grey-bg); }
.slot-line { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid #EFEAE3; font-size: 14px; }
.slot-line:first-of-type { border-top: 0; }
.slot-line .time { font-weight: 700; width: 46px; flex-shrink: 0; }

/* Accueil */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; }
.hero img { width: min(260px, 70%); height: auto; }
.hero .slogan { font-family: var(--slab); font-size: 20px; font-weight: 700; color: var(--red-dark); }
ul.features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ul.features li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
ul.features svg { flex-shrink: 0; margin-top: 1px; }
.contact a { font-weight: 600; text-decoration: none; display: flex; gap: 10px; align-items: center; min-height: 40px; color: var(--ink); }

/* Navigation basse concierge */
.bottom-nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-top: 1px solid #E8E2DA; padding: 6px 4px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; font-size: 11px; color: var(--muted); text-decoration: none; }
.bottom-nav a.on { color: var(--red-dark); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--slab); font-size: 28px; }
.result { text-decoration: none; color: var(--ink); }
.result:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Ordinateur et tablette : même app, plus large et plus lisible à la souris */
@media (min-width: 760px) {
  html, body { background: #EFEAE3; font-size: 16px; }
  .app { max-width: 860px; background: var(--bg); box-shadow: 0 0 0 1px #E3DCD3; }
  .top { padding: 14px 32px; }
  .top .logo { height: 40px; }
  .content { padding: 28px 40px 40px; gap: 18px; }
  h1 { font-size: 26px; }
  .choices.c4 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .choice span { min-height: 48px; font-size: 15px; }
  a.choice-link { min-height: 56px; font-size: 14px; }
  .cal { padding: 18px 22px 22px; }
  .cal-grid { gap: 8px; }
  .cal-grid .day { height: 58px; font-size: 17px; }
  .cal-grid .wd { font-size: 13px; }
  .btn.big { width: auto; min-width: 340px; align-self: center; padding: 0 32px; }
  .stack > .btn.big { align-self: center; }
  .hero img { width: 300px; }
  .bottom-nav { grid-template-columns: repeat(4, 140px); justify-content: center; gap: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 260px)); }
}
@media (min-width: 760px) and (hover: hover) {
  .cal-grid a.day:hover { background: #E6DED3; }
  .choice:not(.off) span:hover { border-color: var(--ink); }
}
