/* =====================================================
   MWA DESIGN SYSTEM — "Mum would always..."
   De vagues et de souvenirs · mwa.ivlabs.io
   ===================================================== */

:root {
  /* ── Neutres ── */
  --bg:       #0E0F14;
  --surface:  #16181F;
  --surface2: #1E2028;
  --border:   #2A2D3A;
  --text:     #E8E9F0;
  --muted:    #7A7D8E;

  /* ── Bleu Vague (primaire) ── */
  --wave:       #4DA6D6;
  --wave-light: #66B5E2;
  --wave-dark:  #2A70A0;

  /* ── Doré Souvenir (secondaire) ── */
  --memory:       #C8994A;
  --memory-light: #D4A955;
  --memory-dark:  #B08940;

  /* ── Rose Cœur (accent/erreur) ── */
  --heart:       #E06070;
  --heart-light: #E87080;
  --heart-dark:  #C43E54;

  /* ── Vert Espoir (positif) ── */
  --nature:       #5AB87A;
  --nature-light: #6BC48A;
  --nature-dark:  #48A065;

  /* ── États ── */
  --success: var(--nature);
  --warning: #F5A623;
  --error:   var(--heart);
  --info:    var(--wave);

  /* ── Typographie ── */
  --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:   Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --font-heading: 'Space Grotesk', var(--font-sans);

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 0.9375rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;

  --leading-tight:   1.2;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.6;
  --leading-loose:   1.7;

  /* ── Espacement (grille 8px) ── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* ── Bordures & ombres ── */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);

  /* ── Transitions ── */
  --ease: 0.2s ease;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }

/* ── Typographie ───────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--text);
}
h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text);
  margin-bottom: var(--sp-4);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--wave-light);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: var(--wave); text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}
@media (min-width: 768px) { .container { padding: 0 var(--sp-6); } }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,15,20,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) 0;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.nav-brand {
  display: flex; flex-direction: column; gap: 1px;
  text-decoration: none;
}
.nav-brand .brand-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--memory);
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.nav-brand .brand-tag {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.nav-links {
  display: flex; align-items: center; gap: var(--sp-5);
  list-style: none;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--muted);
  transition: color var(--ease);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--wave); }
.nav-cta {
  display: flex; align-items: center; gap: var(--sp-2);
}
@media (max-width: 680px) {
  .nav-links { display: none; }
}

/* ── Boutons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--ease);
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary  { background: var(--wave);   color: #fff; }
.btn-primary:hover { background: var(--wave-dark); opacity: 1; }

.btn-secondary { background: transparent; border-color: var(--memory); color: var(--memory); }
.btn-secondary:hover { background: rgba(200,153,74,0.1); opacity: 1; }

.btn-ghost  { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(232,233,240,0.05); opacity: 1; }

.btn-danger { background: var(--heart); color: #fff; }
.btn-danger:hover { background: var(--heart-dark); opacity: 1; }

.btn-ok { background: var(--nature); color: #fff; }
.btn-ok:hover { background: var(--nature-dark); opacity: 1; }

.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: 0.78rem; }
.btn-lg { padding: var(--sp-3) var(--sp-8); font-size: var(--text-base); }

/* ── Cartes ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  transition: border-color var(--ease), background var(--ease);
}
.card-hover:hover {
  background: var(--surface2);
  border-color: var(--wave);
  cursor: pointer;
}

/* ── Vague card (récit public) ──────────────────────── */
.vague-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--ease);
}
.vague-card:hover { border-color: var(--memory); transform: translateY(-2px); }
.vague-card .vague-bar {
  height: 3px;
  width: 100%;
}
.vague-bar.wave    { background: var(--wave); }
.vague-bar.memory  { background: var(--memory); }
.vague-bar.heart   { background: var(--heart); }
.vague-bar.nature  { background: var(--nature); }
.vague-card .vague-body { padding: var(--sp-4) var(--sp-5); }
.vague-theme {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.vague-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
  line-height: 1.35;
}
.vague-excerpt {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: var(--sp-3);
}
.vague-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.73rem; color: var(--muted);
}
.vague-pseudo { color: var(--memory); font-weight: 500; }

/* ── Formulaires ─────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.lbl {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.lbl span { color: var(--muted); font-weight: 400; font-size: 0.75rem; margin-left: 4px; }

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--wave);
  box-shadow: 0 0 0 3px rgba(77,166,214,0.18);
}
input.error, textarea.error { border-color: var(--heart); }
textarea { resize: vertical; min-height: 120px; }

.hint { font-size: 0.73rem; color: var(--muted); margin-top: var(--sp-1); }

/* ── Curseurs émotionnels ──────────────────────────── */
.emotion-sliders { display: flex; flex-direction: column; gap: var(--sp-5); }
.slider-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: var(--sp-3); }
.slider-label { font-size: var(--text-sm); font-weight: 500; }
.slider-label.wave    { color: var(--wave); }
.slider-label.memory  { color: var(--memory); }
.slider-label.heart   { color: var(--heart); }
.slider-label.nature  { color: var(--nature); }
.slider-value { font-size: var(--text-sm); text-align: right; font-family: var(--font-mono); color: var(--muted); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
  box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--wave);
  cursor: pointer;
  transition: background var(--ease);
}
input[type="range"].memory-range::-webkit-slider-thumb { background: var(--memory); }
input[type="range"].heart-range::-webkit-slider-thumb  { background: var(--heart); }
input[type="range"].nature-range::-webkit-slider-thumb { background: var(--nature); }

/* ── Consentement checkboxes ─────────────────────── */
.consent-box {
  background: rgba(90,184,122,0.05);
  border: 1px solid rgba(90,184,122,0.2);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.consent-box.ia-consent {
  background: rgba(77,166,214,0.05);
  border-color: rgba(77,166,214,0.2);
}
.consent-row {
  display: flex; gap: var(--sp-3); align-items: flex-start;
}
.consent-row input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 2px;
  accent-color: var(--nature);
  cursor: pointer;
  border: none; padding: 0; box-shadow: none;
}
.consent-row.ia-check input[type="checkbox"] { accent-color: var(--wave); }
.consent-text { font-size: var(--text-sm); color: var(--text); line-height: 1.6; }
.consent-text strong { color: var(--nature); }
.consent-box.ia-consent .consent-text strong { color: var(--wave); }

/* ── Steps wizard ────────────────────────────────── */
.steps {
  display: flex; gap: 0; margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}
.step {
  flex: 1; text-align: center;
  font-size: 0.72rem; color: var(--muted);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.step.active { color: var(--wave); border-color: var(--wave); font-weight: 600; }
.step.done   { color: var(--nature); border-color: var(--nature); }
.step-num {
  display: inline-flex; width: 22px; height: 22px;
  border-radius: 50%; background: var(--border);
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; margin-bottom: 3px;
}
.step.active .step-num { background: var(--wave); color: #fff; }
.step.done .step-num   { background: var(--nature); color: #fff; }

.page { display: none; }
.page.visible { display: block; }

/* ── Gate admin ──────────────────────────────────── */
.gate {
  position: fixed; inset: 0;
  background: rgba(14,15,20,0.97);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.gate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-8);
  max-width: 400px; width: 100%;
  text-align: center;
}
.gate-box .eyebrow { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: var(--sp-3); }
.gate-box h2 { font-size: 1.2rem; color: var(--text); margin-bottom: var(--sp-2); }
.gate-box p { margin-bottom: var(--sp-5); }
.gate-box input { text-align: center; margin-bottom: var(--sp-3); letter-spacing: 0.05em; }
.gate-error { color: var(--heart); font-size: 0.8rem; margin-top: var(--sp-2); display: none; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-wave    { background: rgba(77,166,214,0.12); border: 1px solid rgba(77,166,214,0.3); color: var(--wave-light); }
.badge-memory  { background: rgba(200,153,74,0.12); border: 1px solid rgba(200,153,74,0.3); color: var(--memory-light); }
.badge-nature  { background: rgba(90,184,122,0.12); border: 1px solid rgba(90,184,122,0.3); color: var(--nature-light); }
.badge-heart   { background: rgba(224,96,112,0.12); border: 1px solid rgba(224,96,112,0.3); color: var(--heart-light); }
.badge-muted   { background: rgba(122,125,142,0.12); border: 1px solid var(--border); color: var(--muted); }

/* ── Toast ───────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--nature); color: #fff;
  border-radius: 100px; padding: 10px 22px;
  font-size: var(--text-sm); font-weight: 600;
  transition: transform 0.3s; pointer-events: none; z-index: 999;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--heart); }

/* ── Stat row (dashboard) ────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
@media (max-width: 600px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}
.stat-label { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: var(--sp-1); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-value.wave   { color: var(--wave); }
.stat-value.memory { color: var(--memory); }
.stat-value.nature { color: var(--nature); }

/* ── Queue modération ────────────────────────────── */
.queue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  transition: border-color var(--ease);
}
.queue-item:hover { border-color: var(--memory); }
.queue-excerpt { font-family: var(--font-serif); font-size: var(--text-sm); color: var(--muted); line-height: 1.6; margin-top: var(--sp-1); }
.queue-meta { font-size: 0.72rem; color: var(--muted); display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.queue-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }

/* ── Section récit complet ───────────────────────── */
.story-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 680px;
}
.story-body p { margin-bottom: var(--sp-5); }
.emotion-bar {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.emotion-chip { font-size: 0.72rem; color: var(--muted); }
.emotion-chip span { font-family: var(--font-mono); color: var(--wave); }

/* ── Hero ────────────────────────────────────────── */
.hero {
  padding: var(--sp-20) 0 var(--sp-16);
  text-align: center;
}
.hero-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--memory);
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-3);
  font-weight: 400;
  line-height: 1.15;
}
.hero-tagline {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: var(--sp-6);
}
.hero-desc {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto var(--sp-8);
  line-height: 1.7;
}
.hero-cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ── Open data banner ────────────────────────────── */
.opendata-banner {
  background: linear-gradient(135deg, rgba(77,166,214,0.06), rgba(200,153,74,0.06));
  border: 1px solid rgba(200,153,74,0.2);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.opendata-banner .ob-icon { font-size: 1.5rem; flex-shrink: 0; }
.opendata-banner .ob-text { flex: 1; font-size: var(--text-sm); color: var(--muted); line-height: 1.6; }
.opendata-banner .ob-text strong { color: var(--memory); }

/* ── Section titre ───────────────────────────────── */
.section-eyebrow {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: var(--sp-2);
}
.section-title { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--sp-4); }

/* ── Grid vagues ─────────────────────────────────── */
.vagues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-5);
}

/* ── Footer ──────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-8) 0;
  margin-top: var(--sp-16);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--sp-4);
  font-size: var(--text-sm); color: var(--muted);
}
.footer-brand { font-family: var(--font-serif); font-style: italic; color: var(--memory); }
.footer-links { display: flex; gap: var(--sp-5); }
.footer-links a { color: var(--muted); font-size: 0.8rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ── Utilitaires ─────────────────────────────────── */
.eyebrow { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: var(--sp-2); }
.text-wave   { color: var(--wave); }
.text-memory { color: var(--memory); }
.text-heart  { color: var(--heart); }
.text-nature { color: var(--nature); }
.text-muted  { color: var(--muted); }
.hidden { display: none !important; }
.mt-4 { margin-top: var(--sp-4); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.gap-3 { gap: var(--sp-3); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Markdown rendu dans les bulles ──────────────── */
.md h1,.md h2,.md h3 { font-size: 1rem; font-weight: 700; margin: var(--sp-3) 0 var(--sp-2); color: var(--wave-light); }
.md h2 { font-size: 0.9rem; }
.md ul,.md ol { padding-left: 1.2rem; margin: var(--sp-2) 0; }
.md li { margin: var(--sp-1) 0; }
.md p { margin: var(--sp-2) 0; font-size: var(--text-sm); }
.md strong { color: var(--memory-light); }
.md code { background: #0d1117; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 0.8rem; font-family: var(--font-mono); }
.md blockquote { border-left: 3px solid var(--wave); padding-left: var(--sp-3); color: var(--muted); margin: var(--sp-2) 0; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  .hero { padding: var(--sp-12) 0 var(--sp-10); }
  .hero-title { font-size: 2rem; }
  .slider-row { grid-template-columns: 100px 1fr 34px; }
  .queue-item { grid-template-columns: 1fr; }
  .queue-actions { flex-wrap: wrap; }
}
