/* Charte Oliv-IT : olive (arbre du logo) + bleu (tuile "IT"), fond papier chaud. */
:root {
  --olive: #605818;
  --olive-strong: #4a4312;
  --olive-soft: #f1eedf;
  --blue: #0068b0;
  --blue-strong: #00528c;
  --blue-soft: #e5f0f9;
  --bg: #faf9f4;
  --surface: #ffffff;
  --text: #2a2716;
  --muted: #6b6650;
  --border: #e2ddc8;
  --success: #2f7d32;
  --success-soft: #e8f3e8;
  --danger: #b3261e;
  --danger-soft: #fbeae9;
  --warning-soft: #fdf5dd;
  --shadow: 0 1px 2px rgba(42, 39, 22, 0.06), 0 4px 16px rgba(42, 39, 22, 0.06);
  --radius: 12px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --olive: #c9bd72;
    --olive-strong: #ddd294;
    --olive-soft: #2d2a1a;
    --blue: #4ea3e6;
    --blue-strong: #7dbdf0;
    --blue-soft: #16293a;
    --bg: #191812;
    --surface: #23221a;
    --text: #eeebdc;
    --muted: #aaa58c;
    --border: #3a3727;
    --success: #7cc47f;
    --success-soft: #1f3120;
    --danger: #f08a82;
    --danger-soft: #3a1f1d;
    --warning-soft: #352f17;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--blue); }
a:hover { color: var(--blue-strong); }
h1, h2, h3 { font-family: var(--serif); color: var(--olive-strong); line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

/* ---------- En-tete / pied ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { height: 52px; width: auto; }
@media (prefers-color-scheme: dark) {
  .brand img { background: #faf9f4; border-radius: 8px; padding: 3px 6px; }
}
.brand-name { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--olive-strong); }
.brand-name small { display: block; font-style: normal; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.session-badge { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.session-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
@media (max-width: 480px) {
  .session-badge { display: none; }
  .brand img { height: 44px; }
}

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 32px 0 48px; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; padding: 20px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Composants ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1.2 var(--sans);
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-strong); color: #fff; }
.btn-secondary { background: transparent; color: var(--olive-strong); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--olive-soft); }
.btn-link { background: none; border: none; color: var(--blue); padding: 6px 8px; font-weight: 500; }
.btn-small { padding: 7px 12px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .dropzone:focus-within {
  outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent);
  outline-offset: 2px;
}
@media (prefers-color-scheme: dark) { .btn-primary { color: #0d1b26; } .btn-primary:hover:not(:disabled) { color: #0d1b26; } }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.spacer { flex: 1; }

.notice { border-radius: 10px; padding: 14px 16px; margin: 16px 0; font-size: 0.95rem; }
.notice-info { background: var(--blue-soft); }
.notice-success { background: var(--success-soft); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warning { background: var(--warning-soft); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ---------- Accueil : grille d'outils ---------- */
.tools { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 24px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.tool-card:hover { border-color: var(--blue); transform: translateY(-2px); color: inherit; }
.tool-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.tool-card h2 { margin: 4px 0 0; font-size: 1.2rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tool-card .go { margin-top: auto; padding-top: 8px; color: var(--blue); font-weight: 600; font-size: 0.9rem; }

/* ---------- Etapes ---------- */
.stepper { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: step; }
.stepper li {
  flex: 1; counter-increment: step;
  font-size: 0.8rem; color: var(--muted);
  border-top: 4px solid var(--border); padding-top: 8px;
}
.stepper li::before { content: counter(step) ". "; font-weight: 700; }
.stepper li.is-done { border-color: var(--olive); color: var(--olive-strong); }
.stepper li.is-current { border-color: var(--blue); color: var(--text); font-weight: 600; }
@media (max-width: 560px) {
  .stepper li { font-size: 0; }
  .stepper li::before { font-size: 0.8rem; }
  .stepper li.is-current { font-size: 0.8rem; }
}

.promises { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 20px 0; }
@media (max-width: 640px) { .promises { grid-template-columns: 1fr; } }
.promises > div { border-radius: 10px; padding: 14px 16px; }
.promises .yes { background: var(--olive-soft); }
.promises .no { background: var(--blue-soft); }
.promises h3 { font-family: var(--sans); font-size: 0.95rem; margin-bottom: 6px; color: var(--text); }
.promises ul { margin: 0; padding-left: 20px; font-size: 0.93rem; }
.promises li { margin: 4px 0; }

label.field { display: block; font-weight: 600; margin: 16px 0 6px; }
select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 140px; resize: vertical; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px 16px; cursor: pointer; background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { color: var(--blue); }
.file-chip {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--olive-soft);
}
.file-chip span { flex: 1; overflow-wrap: anywhere; }
.or { text-align: center; color: var(--muted); margin: 16px 0 0; font-size: 0.9rem; }

/* ---------- Liste d'evenements ---------- */
.list-tools { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 8px 0 12px; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.event {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}
.event:hover { border-color: var(--blue); }
.event input[type="checkbox"] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
.event-body { min-width: 0; flex: 1; }
.event-title { font-weight: 600; }
.event-when { color: var(--olive-strong); font-size: 0.93rem; font-weight: 500; }
.event-where, .event-desc { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.event-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.event.is-excluded { opacity: 0.55; }
.event.is-excluded .event-body { text-decoration: line-through; }

.progress { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin: 12px 0 16px; }
.progress > div { height: 100%; width: 0; background: var(--blue); transition: width 0.2s; }
.status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.93rem; }
.status-list li { display: flex; gap: 8px; align-items: baseline; }
.status-list .icon { width: 1.2em; flex-shrink: 0; text-align: center; font-weight: 700; }
.status-list .ok .icon { color: var(--success); }
.status-list .ko .icon { color: var(--danger); }
.status-list .ko .err { color: var(--danger); font-size: 0.85rem; }

.checklist { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; }
.checklist li::before { content: "✓"; color: var(--success); font-weight: 700; }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
