:root {
  --cube-white: #ffffff;
  --cube-yellow: #ffd500;
  --cube-red: #c41e3a;
  --cube-orange: #ff5800;
  --cube-blue: #0051ba;
  --cube-green: #009e60;

  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5f6368;
  --border: #e3e3de;
  --accent: var(--cube-blue);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c20;
    --text: #f2f2f2;
    --muted: #a0a0a8;
    --border: #2e2e34;
    --accent: #4d8dff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% -10%, rgb(255 213 0 / 0.18), transparent 40%),
    radial-gradient(circle at 100% 0%, rgb(0 81 186 / 0.14), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

.top, main, .bottom {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.top { padding-top: 20px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo { display: inline-flex; gap: 4px; }
.logo i { width: 14px; height: 14px; border-radius: 4px; }
.logo i:nth-child(1) { background: var(--cube-red); }
.logo i:nth-child(2) { background: var(--cube-yellow); }
.logo i:nth-child(3) { background: var(--cube-green); }

main { flex: 1; }

.hero { padding: clamp(40px, 9vw, 96px) 0 clamp(28px, 6vw, 56px); }

.kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after {
  content: "";
  position: absolute;
  left: -0.08em;
  right: -0.08em;
  bottom: 0.08em;
  height: 0.38em;
  border-radius: 0.2em;
  z-index: -1;
  opacity: 0.85;
}
.hl-yellow::after { background: var(--cube-yellow); }
.hl-blue::after { background: #7fb0ff; }
@media (prefers-color-scheme: dark) {
  .hl-yellow::after { background: #8a7300; }
  .hl-blue::after { background: #1f4f99; }
}

.lead {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
}

.section-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.bottom {
  padding-top: 48px;
  padding-bottom: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}
.bottom p { margin: 0; border-top: 1px solid var(--border); padding-top: 16px; }

/* Carte « Reprendre » (remplie par le mini-script de la bande) */
.reprendre { margin-bottom: 32px; }
.reprendre-lien {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; min-height: 84px;
  border-radius: var(--radius); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface));
  border: 3px solid var(--c, var(--accent)); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.reprendre-lien:hover { transform: translateY(-2px); }
.reprendre-lien:focus-visible { outline: 3px solid var(--c, var(--accent)); outline-offset: 3px; }
.reprendre-icone { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; }
.reprendre-texte { flex: 1; display: grid; }
.reprendre-titre { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.reprendre-quoi { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.reprendre-cta { font-size: 1.8rem; font-weight: 800; color: var(--c, var(--accent)); }

/* Tuiles des ateliers (générées par le Worker à partir de src/ateliers.js) */
.ateliers .tuiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ateliers .tuile {
  position: relative; height: 100%; display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; align-items: center;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--border);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.ateliers a.tuile:hover { border-color: var(--c); transform: translateY(-3px); }
.ateliers a.tuile:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.ateliers .tuile-icone { grid-row: span 2; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.ateliers .tuile-icone svg { width: 34px; height: 34px; }
.ateliers .tuile-nom { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.ateliers .tuile-texte { color: var(--muted); line-height: 1.4; }
.ateliers .tuile-bientot { border-style: dashed; box-shadow: none; }
.ateliers .tuile-bientot .tuile-icone { background: var(--muted); }
.ateliers .tuile-cadenas { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--border); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .reprendre-lien:hover, .ateliers a.tuile:hover { transform: none; }
}

/* Page du compte (/compte/) */
.compte-page { max-width: 600px; padding-top: 32px; padding-bottom: 24px; }
.compte-page h1 { font-size: clamp(2rem, 6vw, 3rem); }
.compte-page h2 { margin: 0; font-size: 1.15rem; }
.compte-page [hidden], .compte-page dialog:not([open]) { display: none !important; }
.compte-page section { display: grid; gap: 16px; margin-top: 16px; }
.compte-message { margin: 16px 0 0; font-weight: 700; }
/* Vides, les zones d'annonce restent dans l'arbre d'accessibilité (sinon les lecteurs d'écran ratent le texte ajouté). */
.compte-message:empty, .erreur:empty { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.etat:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.carte { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.formulaire { display: grid; gap: 12px; }
.champ { display: grid; gap: 4px; }
.champ label { font-weight: 700; }
.champ input, .compte-page dialog input:not([type="checkbox"]) { font: inherit; min-height: 44px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); width: 100%; min-width: 0; }
.champ input:focus-visible, .consentement input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mdp { display: flex; gap: 8px; }
.aide { margin: 0; color: var(--muted); font-size: 0.9rem; }
.avertissement { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cube-yellow) 25%, var(--surface)); }
.consentement { display: flex; gap: 10px; align-items: flex-start; }
.consentement input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.consentement a, .bottom a { color: var(--accent); }
.erreur { margin: 0; color: var(--cube-red); font-weight: 600; }
@media (prefers-color-scheme: dark) { .erreur { color: #ff8a9b; } }
.etat { margin: 0 0 12px; }
.hors-ligne { color: var(--muted); }
.onglets { display: flex; flex-wrap: wrap; gap: 8px; }
.onglets button { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.onglets button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 18px; border-radius: 12px; border: 2px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }
.bouton.secondaire { background: var(--surface); color: var(--text); border-color: var(--border); }
.bouton.danger { color: var(--cube-red); border-color: var(--cube-red); }
@media (prefers-color-scheme: dark) { .bouton.danger { color: #ff8a9b; border-color: #ff8a9b; } }
.bouton.danger-plein { background: var(--cube-red); border-color: var(--cube-red); color: #fff; }
.bouton:focus-visible, .onglets button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.bouton:disabled { opacity: 0.6; cursor: progress; }
.compte-page dialog { width: calc(100% - 32px); max-width: 520px; }
.compte-page dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Page Confidentialité */
.confidentialite { max-width: 65ch; padding-top: 32px; padding-bottom: 24px; }
.confidentialite h1 { font-size: clamp(2rem, 6vw, 3rem); }
.confidentialite h2 { margin: 1.6em 0 0; font-size: 1.15rem; }
.confidentialite code { overflow-wrap: anywhere; }
