:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #5d6b67;
  --line: #dfe5e2;
  --accent: #0f766e;
  --accent-soft: #e3f3f0;
  --on-accent: #ffffff;
  --cta: #e2570f;
  --cta-hover: #c2410c;
  --on-cta: #ffffff;
  --success-bg: #ecfdf3;
  --success-line: #86d7a8;
  --danger: #b42318;
  --warn-bg: #fff7e6;
  --warn-line: #f0c36d;
  --done: #8a9692;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111615;
    --surface: #1a2120;
    --text: #e8eeec;
    --muted: #9aa8a4;
    --line: #2c3634;
    --accent: #2dd4bf;
    --accent-soft: #163a36;
    --on-accent: #062b27;
    --cta: #fb8c3c;
    --cta-hover: #fdba74;
    --on-cta: #2a1204;
    --success-bg: #0f2a1c;
    --success-line: #2f7a4f;
    --danger: #f97066;
    --warn-bg: #2d2412;
    --warn-line: #8a6a22;
    --done: #6b7875;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.6rem; margin: 8px 0 4px; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

.hero { padding: 16px 0 20px; }
.hero h1 { font-size: 2rem; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  color: inherit;
  text-decoration: none;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.trip-card { display: grid; gap: 6px; }
.trip-card strong { font-size: 1.1rem; }

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.big { font-size: .9rem; padding: 4px 12px; }

.bar { display: block; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0; }
.bar-fill { display: block; height: 100%; background: var(--accent); transition: width .3s; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--on-cta); box-shadow: 0 2px 8px rgb(226 87 15 / .25); }
.btn.primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn.big { min-height: 56px; font-size: 1.1rem; }
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn.danger { color: var(--danger); }
.btn.link { border: 0; background: none; padding: 4px 0; min-height: 32px; }
.btn.small { font-size: .85rem; }

.back { display: inline-block; padding: 8px 0; text-decoration: none; font-weight: 600; }

.field { display: grid; gap: 4px; margin: 10px 0; }
.field-label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .8rem; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.grid2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check input, .items input, .choice input, .chip input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.choice span { display: grid; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.traveler { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; margin: 0 0 12px; }
.traveler legend { font-weight: 700; padding: 0 6px; }

.error { color: var(--danger); font-weight: 600; }
.alert { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.late { color: var(--danger); font-weight: 600; }

.trip-head { margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 12px 0 4px; }
.tabs a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.toolbar { display: grid; gap: 4px; margin: 12px 0 4px; }

.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.items label { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex: 1; cursor: pointer; }
.items li.done .item-label { color: var(--done); text-decoration: line-through; }
.items li.important .item-label { font-weight: 700; }
.qty { color: var(--muted); font-size: .9rem; margin-left: auto; padding-left: 8px; }

details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }
.add-item { display: grid; grid-template-columns: 1fr 72px; gap: 8px; margin-top: 8px; }
.add-item select, .add-item .btn { grid-column: 1 / -1; }

.plain { padding-left: 18px; }
.recap { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.recap dt { font-weight: 600; color: var(--muted); }
.recap dd { margin: 0; }

.footer-links { display: flex; justify-content: center; gap: 24px; margin-top: 32px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Accueil */
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 6px; }
.hero h1 { font-size: 1.7rem; line-height: 1.25; }
.hero.compact h1 { font-size: 1.5rem; }
.lead { font-size: 1.05rem; color: var(--muted); }
.reassure { text-align: center; font-size: .85rem; color: var(--muted); margin-top: -2px; }
.how { margin-top: 28px; }
.steps-list { padding-left: 22px; display: grid; gap: 10px; }
.featured { border: 2px solid var(--accent); }
.featured h2 { margin: 0; font-size: 1.3rem; }
.countdown { font-size: 1.6rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.big-stat { font-size: 2.2rem; font-weight: 800; margin: 12px 0 0; line-height: 1; }
.big-stat .small { font-size: .9rem; font-weight: 500; }

/* Messages */
.success { background: var(--success-bg); border-color: var(--success-line); }
.inset { background: var(--bg); }

/* Formulaire en étapes */
.stepper { display: grid; gap: 4px; margin: 4px 0 8px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.wizard-nav .btn.primary { flex: 1; }
.act-group { border: 0; padding: 0; margin: 0 0 14px; }
.act-group legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.bags { display: grid; gap: 6px; margin: 8px 0; }
.bag-row { display: flex; gap: 8px; align-items: center; }
.bag-row select { flex: 1; }
.weather-status p { margin: 4px 0; }

/* Météo jour par jour */
.days { list-style: none; padding: 0; margin: 0 0 12px; }
.days li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.days li:last-child { border-bottom: 0; }
.route { font-weight: 600; color: var(--accent); margin: 10px 0 4px; }
optgroup { font-weight: 700; }
.edit-link { font-weight: 600; white-space: nowrap; margin-left: 4px; }
.step-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--line); border-radius: 12px; padding: 4px; margin: 4px 0 12px; }
.step-tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; padding: 8px 2px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.step-tabs button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.create-activity { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 12px 12px; margin-top: 8px; }
.add-item .remember { grid-column: 1 / -1; font-size: .9rem; }
.weather-line { display: block; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem; }
.habit { display: grid; padding: 8px 0; flex: 1; }
.footer-links { flex-wrap: wrap; gap: 12px 24px; }
.check[hidden] { display: none; }
.ext { font-weight: 600; }
.tabs { scrollbar-width: none; }
.plain li { margin-bottom: 6px; }
