@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap');

:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #14140f;
  --color-accent: #ff6a13;
  --color-divider: color-mix(in srgb, #14140f 12%, transparent);

  --color-neutral-100: #f6f6f4;
  --color-neutral-200: #ececea;
  --color-neutral-300: #d9d9d5;
  --color-neutral-400: #b6b6b0;
  --color-neutral-500: #93938c;
  --color-neutral-600: #73736b;
  --color-neutral-700: #57574f;
  --color-neutral-800: #38382f;
  --color-neutral-900: #201f18;

  --color-accent-100: #fff1e6;
  --color-accent-200: #ffdcbd;
  --color-accent-300: #ffbe85;
  --color-accent-400: #ff9950;
  --color-accent-500: #ff6a13;
  --color-accent-600: #d9550a;
  --color-accent-700: #ab4308;
  --color-accent-800: #7a3006;
  --color-accent-900: #4d1e04;

  --color-green: #1f8a5a;
  --color-red: #8c2f1f;

  --font-heading: "Manrope", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Manrope", system-ui, sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 22px; --space-6: 28px; --space-8: 36px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #14140f 12%, transparent);
  --shadow-md: 0 4px 14px color-mix(in srgb, #14140f 16%, transparent);
  --shadow-lg: 0 14px 34px color-mix(in srgb, #14140f 22%, transparent);

  --tabbar-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 400; background: var(--color-neutral-100); color: var(--color-text); font-family: var(--font-body); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 var(--space-2); }
h1 { font-size: 30px; } h2 { font-size: 23px; } h3 { font-size: 18px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-700); text-underline-offset: 3px; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 2px; }
img { max-width: 100%; display: block; }

/* ---------- Boutons (deux niveaux, forme pilule) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 16px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1.5px solid transparent; min-height: 48px; padding: var(--space-2) var(--space-5); border-radius: 999px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent-500); color: #fff; }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-neutral-400); background: #fff; }
.btn-secondary:hover { background: var(--color-neutral-100); }
.btn-dark { background: var(--color-neutral-900); color: #fff; }
.btn-ghost { color: var(--color-accent-700); min-height: auto; padding: var(--space-1) var(--space-2); }
.btn-icon { width: 48px; height: 48px; padding: 0; min-height: 48px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: var(--space-1) var(--space-4); font-size: 14px; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--color-neutral-700); }
.input, textarea.input, select.input { width: 100%; min-height: 48px; padding: 8px 16px; font: inherit; font-size: 16px; color: var(--color-text);
  background: #fff; border: 1.5px solid var(--color-divider); border-radius: var(--radius-md); }
.input.pill { border-radius: 999px; }
textarea.input { min-height: 90px; resize: vertical; border-radius: var(--radius-md); }
.input:focus-visible { border-color: var(--color-accent-500); }

/* ---------- Barre d'action unique (recherche + action) ---------- */
.action-bar { display: flex; align-items: center; gap: var(--space-2); background: #fff; border: 1.5px solid var(--color-divider);
  border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow-sm); }
.action-bar input { flex: 1; border: none; background: none; font: inherit; font-size: 16px; min-height: 40px; }
.action-bar input:focus { outline: none; }

/* ---------- Cartes ---------- */
.card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-divider); }
.card-row { display: flex; gap: var(--space-3); align-items: center; }
.card-img { width: 64px; height: 64px; border-radius: var(--radius-md); background: var(--color-accent-100); color: var(--color-accent-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-selected { border-color: var(--color-accent-500); background: var(--color-accent-100); }

/* ---------- Pastilles de catégories ---------- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: 2px; -ms-overflow-style: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; cursor: pointer; }
.chip-icon { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--color-neutral-100); border: 1.5px solid var(--color-divider);
  display: flex; align-items: center; justify-content: center; color: var(--color-neutral-800); }
.chip.active .chip-icon { background: var(--color-accent-500); border-color: var(--color-accent-500); color: #fff; }
.chip-label { font-size: 12px; font-weight: 700; text-align: center; }

/* ---------- Badges / statuts ---------- */
.badge { border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.badge-attente { background: var(--color-accent-100); color: var(--color-accent-800); }
.badge-ouvert, .badge-validee, .badge-active, .badge-disponible { background: #e6f4ec; color: var(--color-green); }
.badge-ferme, .badge-rejetee, .badge-indisponible { background: #fbe2de; color: var(--color-red); }
.badge-neutre { background: var(--color-neutral-200); color: var(--color-neutral-800); }

/* ---------- Bannière illustrée ---------- */
.banner { border-radius: var(--radius-lg); padding: var(--space-4); background: linear-gradient(135deg, var(--color-accent-500), var(--color-accent-700)); color: #fff; }
.banner h3 { color: #fff; margin-bottom: 4px; }
.banner p { color: #fff; opacity: 0.92; margin-bottom: var(--space-2); }
.banner a, .banner .banner-link { color: #fff; font-weight: 800; text-decoration: underline; }

/* ---------- Suivi de course en étapes ---------- */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: var(--space-3); }
.step-marker { display: flex; flex-direction: column; align-items: center; }
.step-dot { width: 28px; height: 28px; border-radius: 999px; background: var(--color-neutral-200); color: var(--color-neutral-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step.done .step-dot { background: var(--color-accent-500); color: #fff; }
.step-line { width: 2px; flex: 1; background: var(--color-neutral-200); min-height: 20px; }
.step.done .step-line { background: var(--color-accent-500); }
.step-body { padding-bottom: var(--space-4); }
.step-body strong { display: block; font-size: 15px; }
.step-body span { font-size: 13px; color: var(--color-neutral-600); }

/* ---------- Panier flottant ---------- */
.cart-fab { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--tabbar-height) + var(--space-3));
  max-width: 448px; margin: 0 auto; background: var(--color-neutral-900); color: #fff; border-radius: 999px; padding: 10px 10px 10px 20px;
  display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); z-index: 15; cursor: pointer; }
.cart-fab .btn-primary { min-height: 40px; }

/* ---------- Aide flottante ---------- */
.support-fab { position: fixed; right: var(--space-3); bottom: calc(var(--tabbar-height) + var(--space-3)); display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.support-fab a { width: 46px; height: 46px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--color-neutral-900); color: #fff; box-shadow: var(--shadow-md); }

/* ---------- Structure générale ---------- */
.app-shell { min-height: 100vh; background: var(--color-neutral-100); display: flex; justify-content: center; }
.app-frame { width: 100%; max-width: 480px; min-height: 100vh; background: var(--color-bg); position: relative; }
.screen { padding: var(--space-5) var(--space-4) var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }
.screen-with-tabbar { padding-bottom: calc(var(--tabbar-height) + var(--space-6)); }
.top-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); position: sticky; top: 0; z-index: 10;
  background: var(--color-bg); border-bottom: 1px solid var(--color-neutral-200); }
.top-bar button { border: none; background: none; cursor: pointer; display: flex; padding: 4px; color: var(--color-text); }
.top-bar h2 { margin: 0; }

/* ---------- Barre d'onglets fixe (client) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-height); background: #fff; border-top: 1px solid var(--color-neutral-200);
  display: flex; justify-content: center; z-index: 10; }
.tabbar-inner { width: 100%; max-width: 480px; display: flex; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: none; background: none;
  cursor: pointer; color: var(--color-neutral-500); font-family: var(--font-body); font-size: 11px; font-weight: 700; }
.tab-item.active { color: var(--color-accent-600); }

/* ---------- États vides ---------- */
.empty-state { text-align: center; padding: var(--space-8) var(--space-4); color: var(--color-neutral-600); }
.empty-state .empty-icon { width: 64px; height: 64px; border-radius: 999px; background: var(--color-neutral-100); color: var(--color-neutral-500);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-3); }

.center-text { text-align: center; }
.muted { color: var(--color-neutral-600); }
.small { font-size: 13px; }
.err { color: var(--color-red); font-size: 14px; }
.divider { height: 1px; background: var(--color-neutral-200); border: none; margin: var(--space-2) 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.spin { animation: ke-spin 1s linear infinite; }
@keyframes ke-spin { to { transform: rotate(360deg); } }

/* ---------- Liste de réglages (compte) ---------- */
.settings-list { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-divider); background: #fff; }
.settings-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); cursor: pointer; border: none; background: none; width: 100%; text-align: left; font: inherit; color: var(--color-text); }
.settings-row + .settings-row { border-top: 1px solid var(--color-neutral-200); }
.settings-row .icon-box { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--color-neutral-100); display: flex; align-items: center; justify-content: center; color: var(--color-neutral-700); }
.settings-row .settings-label { flex: 1; font-weight: 700; }

/* ---------- Sélecteurs / segments ---------- */
.seg { display: flex; overflow: hidden; border: 1.5px solid var(--color-divider); border-radius: 999px; }
.seg-opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; font-size: 14px; font-weight: 700; cursor: pointer; border: none; background: none; font-family: var(--font-body); }
.seg-opt + .seg-opt { border-left: 1.5px solid var(--color-divider); }
.seg-opt.active { background: var(--color-neutral-900); color: #fff; }

/* ---------- Choix de formule ---------- */
.formule-card { display: flex; flex-direction: column; gap: 4px; padding: var(--space-4); border-radius: var(--radius-lg); border: 1.5px solid var(--color-divider); cursor: pointer; }
.formule-card.selected { border-color: var(--color-accent-500); background: var(--color-accent-100); }
.formule-price { font-family: var(--font-heading); font-weight: 800; font-size: 22px; }