:root {
  color-scheme: light dark;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #55625a;
  --border: #d9d4c5;
  --accent: #2f5d4a;
  --on-accent: #ffffff;
  --accent-soft: #e5efe9;
  --danger: #8a2b2b;
  --danger-soft: #f8e6e4;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a17;
    --surface: #1c2420;
    --text: #e8ece8;
    --muted: #a7b3ab;
    --border: #34423a;
    --accent: #8fc2a8;
    --on-accent: #0f1512;
    --accent-soft: #22302a;
    --danger: #f0a9a0;
    --danger-soft: #3a2220;
  }
}
:root[data-theme="dark"] {
  --bg: #141a17; --surface: #1c2420; --text: #e8ece8; --muted: #a7b3ab; --border: #34423a;
  --accent: #8fc2a8; --on-accent: #0f1512; --accent-soft: #22302a; --danger: #f0a9a0; --danger-soft: #3a2220;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1.0625rem/1.6 var(--font);
}
.wrap { width: 100%; max-width: 42rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); text-underline-offset: 0.15em; }
h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 0.5em; }
h1 { font-size: 1.9rem; margin-top: 0.4em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; margin-top: 0.2em; }
p, ul, ol { margin: 0.7em 0; }
.muted { color: var(--muted); font-size: 0.95rem; }
.offscreen { position: absolute; left: -9999px; top: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }

/* En-tête et pied */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 0.25rem; }
.site-header nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.6rem; text-decoration: none; color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--accent); font-weight: 700; text-decoration: underline; }
main { padding-bottom: 3rem; }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.95rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }

/* Accueil */
.hero { padding: 1.5rem 0 0.5rem; }
.hero .lead { font-size: 1.2rem; }
.guarantees { list-style: none; padding: 0; display: grid; gap: 0.75rem; margin: 1.5rem 0; }
.guarantees li { background: var(--accent-soft); border-radius: var(--radius); padding: 0.9rem 1rem; }
.guarantees strong { display: block; }
.steps { padding-left: 1.2rem; }
.steps li { margin: 0.6rem 0; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 0.55rem 1.1rem; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); text-decoration: underline; }
.btn.small { min-height: 44px; padding: 0.3rem 0.9rem; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.actions.global { margin-top: 1.5rem; }

/* Formulaires */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0.9rem 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; background: var(--surface); }
/* Titre de l'encart à l'intérieur de la carte (et non à cheval sur la bordure). */
legend { float: left; width: 100%; padding: 0; margin: 0 0 0.5rem; font-weight: 700; font-size: 1.1rem; }
legend + * { clear: both; }
.field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.7rem 0; min-width: 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
input[type="text"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.5rem 0.7rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
textarea { resize: vertical; line-height: 1.5; }
.row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.row .field.narrow { flex: 0 0 11rem; }
.row .field.grow { flex: 1 1 12rem; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 400; }
.check input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--accent); }
.inline-options { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.reminder-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.help { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0.4rem; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 0.4rem 1rem; margin: 1rem 0; }
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 1rem 0; }

/* Résultats */
.result .when { margin: 0; color: var(--muted); }
.result .when::first-letter { text-transform: uppercase; }
.result h3 { margin: 0.2rem 0 0.4rem; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0.4rem 0; }

/* Page de rappel */
.reminder-text { min-height: 9rem; font-size: 1.1rem; }
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 1rem 0; }
.send-grid .btn { min-height: 52px; }
@media (max-width: 26rem) { .send-grid { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); padding: 0.5rem 0.4rem; }

.final { border-left: 3px solid var(--accent); padding-left: 0.8rem; margin-top: 0.8rem; }
.final .help { margin-bottom: 0; }
.template-name { margin: 0 0 0.2rem; font-weight: 700; }
#modeles h3 { margin-top: 1.2em; }
.tap { display: inline-flex; align-items: center; min-height: 44px; }
