/* =====================================================================
   Life Intelligente — Project Planner Pro
   Direction : « Premium Dark Glass », thème géotechnique.
   Élément signature : la progression affichée comme un carottage de sol
   (log de sondage), chaque étape étant une couche géologique.
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0B1220;
  --navy-2: #0F192C;
  --blue: #1479D4;
  --blue-soft: #4C9EEA;
  --orange: #ED6E1D;
  --orange-hover: #F3843A;
  --cyan: #22B8CF;
  --mist: #E8EDF4;
  --white: #FFFFFF;

  --bg: var(--navy);
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(20, 121, 212, .18), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(34, 184, 207, .10), transparent 60%);
  --surface: rgba(21, 33, 56, .62);
  --surface-solid: #131E33;
  --surface-2: rgba(255, 255, 255, .045);
  --border: rgba(232, 237, 244, .10);
  --border-strong: rgba(232, 237, 244, .2);
  --text: #E8EDF4;
  --text-2: #A9B4C6;
  --text-3: #7C889C;
  --input-bg: rgba(8, 14, 26, .55);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -24px rgba(0, 0, 0, .7);
  --ok: #3BC48A;
  --warn: #F2B541;
  --danger: #EF5B5B;
  --focus: 0 0 0 3px rgba(34, 184, 207, .45);

  /* Strates du carottage (de la surface vers le substratum) */
  --s1: #8C6A4A; --s2: #A07F55; --s3: #7B7F86; --s4: #5E6D7E; --s5: #6E5A49;
  --s6: #8A8270; --s7: #56606E; --s8: #707C8A; --s9: #3E4A5A; --s10: #2C3646;

  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 7px;
  --font: "Inter", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #EEF2F7;
  --bg-grad: radial-gradient(1100px 520px at 90% -10%, rgba(20, 121, 212, .10), transparent 60%);
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #FFFFFF;
  --surface-2: rgba(11, 18, 32, .035);
  --border: rgba(11, 18, 32, .10);
  --border-strong: rgba(11, 18, 32, .2);
  --text: #0B1220;
  --text-2: #3D4A5F;
  --text-3: #6A7588;
  --input-bg: #FFFFFF;
  --shadow: 0 14px 34px -22px rgba(11, 18, 32, .35);
  --blue-soft: #1468B8;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { vertical-align: middle; }
a { color: var(--blue-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -0.018em; font-weight: 650; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); letter-spacing: -0.028em; }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.06rem; }
p { margin: 0 0 1em; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: .86rem; }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--orange); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* --------------------------------------------------------------- Marque */
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand small { display: block; font-weight: 450; color: var(--text-3); font-size: .78rem; letter-spacing: 0; }

/* --------------------------------------------------------------- Boutons */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--b); color: var(--text); font: inherit; font-weight: 560; font-size: .94rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .08s; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 10px 24px -14px rgba(237, 110, 29, .9); }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: #1a86e8; border-color: #1a86e8; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: rgba(239, 91, 91, .45); background: transparent; }
.btn-danger:hover { background: rgba(239, 91, 91, .1); border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------------- Formulaires */
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 560; margin-bottom: 7px; font-size: .93rem; }
.req { color: var(--orange); margin-left: 2px; }
.help { color: var(--text-3); font-size: .84rem; margin-top: 6px; }
.err-msg { color: var(--danger); font-size: .84rem; margin-top: 6px; display: none; }
.field.has-error .err-msg { display: block; }
.field.has-error .input { border-color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--input-bg); color: var(--text); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--focus); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: var(--surface-solid); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--orange); flex: none; }

/* Pastilles (radio / checkbox) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; font-size: .9rem; transition: all .15s; user-select: none;
}
.pill span:hover { color: var(--text); border-color: var(--text-3); }
.pill input:checked + span { background: rgba(20, 121, 212, .2); border-color: var(--blue); color: var(--text); }
.pill input:focus-visible + span { box-shadow: var(--focus); }
.pill input:checked + span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }

/* Cartes de style (aperçus visuels) */
.style-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.style-card { position: relative; cursor: pointer; }
.style-card input { position: absolute; opacity: 0; }
.style-card .sc-body { display: block; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); transition: border-color .15s, transform .15s; }
.style-card:hover .sc-body { border-color: var(--text-3); }
.style-card input:checked + .sc-body { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(237, 110, 29, .35); }
.style-card input:focus-visible + .sc-body { box-shadow: var(--focus); }
.sc-preview { height: 104px; display: block; padding: 12px; }
.sc-name { display: block; padding: 10px 12px; font-weight: 560; font-size: .9rem; border-top: 1px solid var(--border); }
.sc-preview i { display: block; border-radius: 3px; margin-bottom: 6px; }
.sc-corporate { background: #F4F6FA; }
.sc-corporate i:nth-child(1) { height: 10px; width: 100%; background: #1F3A66; }
.sc-corporate i:nth-child(2) { height: 28px; width: 100%; background: #D8DFEA; }
.sc-corporate i:nth-child(3) { height: 6px; width: 60%; background: #9AA8BF; }
.sc-corporate i:nth-child(4) { height: 6px; width: 40%; background: #9AA8BF; }
.sc-premium { background: linear-gradient(140deg, #0E1A30, #1C2C4C); }
.sc-premium i:nth-child(1) { height: 34px; width: 100%; background: linear-gradient(90deg, rgba(34,184,207,.5), rgba(20,121,212,.25)); border-radius: 6px; }
.sc-premium i:nth-child(2) { height: 8px; width: 70%; background: rgba(255,255,255,.7); }
.sc-premium i:nth-child(3) { height: 14px; width: 34%; background: #ED6E1D; border-radius: 10px; }
.sc-industrial { background: #2B2F35; background-image: repeating-linear-gradient(-45deg, rgba(242,181,65,.0) 0 10px, rgba(242,181,65,.08) 10px 20px); }
.sc-industrial i:nth-child(1) { height: 30px; width: 100%; background: #F2B541; border-radius: 0; }
.sc-industrial i:nth-child(2) { height: 8px; width: 80%; background: #D9DDE2; border-radius: 0; }
.sc-industrial i:nth-child(3) { height: 8px; width: 50%; background: #8C939C; border-radius: 0; }
.sc-minimal { background: #FFFFFF; padding: 18px 14px; }
.sc-minimal i:nth-child(1) { height: 7px; width: 44%; background: #111827; }
.sc-minimal i:nth-child(2) { height: 4px; width: 70%; background: #C9CED6; margin-top: 16px; }
.sc-minimal i:nth-child(3) { height: 4px; width: 56%; background: #C9CED6; }

/* --------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 560; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-draft { color: #A9B4C6; background: rgba(169, 180, 198, .12); }
.b-sent { color: #4C9EEA; background: rgba(20, 121, 212, .16); }
.b-in_progress { color: #22B8CF; background: rgba(34, 184, 207, .14); }
.b-submitted { color: #F3843A; background: rgba(237, 110, 29, .16); }
.b-in_review { color: #F2B541; background: rgba(242, 181, 65, .15); }
.b-validated { color: #3BC48A; background: rgba(59, 196, 138, .15); }
.b-archived { color: #7C889C; background: rgba(124, 136, 156, .14); }
:root[data-theme="light"] .b-sent { color: #1468B8; }
:root[data-theme="light"] .b-in_progress { color: #0E8397; }
:root[data-theme="light"] .b-submitted { color: #C2550F; }
:root[data-theme="light"] .b-in_review { color: #A3700A; }
:root[data-theme="light"] .b-validated { color: #1E8A5C; }

.state { font-size: .78rem; font-weight: 560; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.st-unanswered { color: var(--text-3); background: var(--surface-2); }
.st-draft { color: var(--warn); background: rgba(242, 181, 65, .13); }
.st-discuss { color: var(--cyan); background: rgba(34, 184, 207, .13); }
.st-accepted { color: var(--ok); background: rgba(59, 196, 138, .14); }
.st-refused { color: var(--danger); background: rgba(239, 91, 91, .12); }
:root[data-theme="light"] .st-draft { color: #9A6A06; }
:root[data-theme="light"] .st-discuss { color: #0E7C8E; }
:root[data-theme="light"] .st-accepted { color: #1E8A5C; }

/* --------------------------------------------------------------- Messages */
.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-solid); font-size: .92rem; }
.flash-success { border-color: rgba(59, 196, 138, .45); }
.flash-success .icon { color: var(--ok); }
.flash-error { border-color: rgba(239, 91, 91, .5); }
.flash-error .icon { color: var(--danger); }
.flash-info .icon { color: var(--cyan); }
.notice { padding: 14px 16px; border-radius: var(--r-md); border-left: 3px solid var(--cyan); background: var(--surface-2); font-size: .92rem; }
.notice-warn { border-left-color: var(--warn); }
.notice-danger { border-left-color: var(--danger); }
.notice-orange { border-left-color: var(--orange); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* --------------------------------------------------------------- Barre de progression */
.bar { height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .4s ease; }

/* =====================================================================
   ESPACE CLIENT
   ===================================================================== */
.client-shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: 100vh; }
.client-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 18px 18px;
  border-right: 1px solid var(--border); background: rgba(8, 13, 24, .55);
  backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 20px;
}
:root[data-theme="light"] .client-side { background: rgba(255, 255, 255, .6); }
.client-main { padding: 26px clamp(18px, 4vw, 56px) 80px; min-width: 0; }
.client-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.client-top .who { color: var(--text-2); font-size: .9rem; }
.client-top .who strong { color: var(--text); font-weight: 600; }
.content { max-width: 860px; }

/* ---- Carottage : la progression comme un log de sondage */
.core-log { position: relative; }
.core-log h2 { font-size: .86rem; color: var(--text-3); font-weight: 560; letter-spacing: 0; margin: 0 0 10px 2px; }
.core { display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; }
.core ol { list-style: none; margin: 0; padding: 0; display: contents; }
.layer { display: contents; }
.layer .depth { font-size: .68rem; color: var(--text-3); text-align: right; padding-top: 11px; font-variant-numeric: tabular-nums; }
.layer a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 18px;
  margin-bottom: 3px; border-radius: 4px 9px 9px 4px; color: var(--text-2); font-size: .89rem; line-height: 1.25;
  background: var(--surface-2); text-decoration: none; overflow: hidden; transition: background .15s, color .15s;
}
.layer a::before { /* la couche de sol : bande colorée remplie selon l'avancement */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--layer); opacity: .5;
}
.layer a::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(6px + var(--fill, 0) * 0.94 * (100% - 6px));
  background: linear-gradient(90deg, color-mix(in srgb, var(--layer) 38%, transparent), transparent);
  pointer-events: none; transition: width .5s ease;
}
.layer a:hover { color: var(--text); background: rgba(255, 255, 255, .07); text-decoration: none; }
.layer a.is-current { color: var(--text); background: rgba(20, 121, 212, .16); box-shadow: inset 0 0 0 1px rgba(20, 121, 212, .45); }
.layer a.is-current::before { opacity: 1; width: 6px; }
.layer .ln { position: relative; z-index: 1; font-variant-numeric: tabular-nums; color: var(--text-3); font-size: .78rem; width: 17px; }
.layer .lt { position: relative; z-index: 1; flex: 1; }
.layer .lc { position: relative; z-index: 1; color: var(--ok); display: none; }
.layer a.is-done .lc { display: inline-flex; }
.layer:nth-child(1) a { --layer: var(--s1); } .layer:nth-child(2) a { --layer: var(--s2); }
.layer:nth-child(3) a { --layer: var(--s3); } .layer:nth-child(4) a { --layer: var(--s4); }
.layer:nth-child(5) a { --layer: var(--s5); } .layer:nth-child(6) a { --layer: var(--s6); }
.layer:nth-child(7) a { --layer: var(--s7); } .layer:nth-child(8) a { --layer: var(--s8); }
.layer:nth-child(9) a { --layer: var(--s9); } .layer:nth-child(10) a { --layer: var(--s10); }
.core-total { margin-top: 14px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.core-total .big { font-size: 1.7rem; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; font-size: .8rem; color: var(--text-3); }

/* Indicateur de sauvegarde */
.save-ind { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--text-3); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.save-ind .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.save-ind[data-state="saving"] .dot { background: var(--warn); animation: pulse 1s infinite; }
.save-ind[data-state="saved"] .dot { background: var(--ok); }
.save-ind[data-state="error"] { color: var(--danger); border-color: rgba(239, 91, 91, .5); }
.save-ind[data-state="error"] .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }

.step-head { margin-bottom: 22px; }
.step-head .step-no { color: var(--cyan); font-weight: 600; font-size: .9rem; margin-bottom: 6px; display: block; }
.step-head p { color: var(--text-2); max-width: 64ch; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---- Accueil questionnaire */
.welcome { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: stretch; }
.welcome-intro p { color: var(--text-2); font-size: 1.02rem; max-width: 60ch; }
.welcome-intro .lead { color: var(--text); font-size: 1.12rem; }
.site-visual { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); min-height: 320px; background: #0A1424; }
.site-visual svg { width: 100%; height: 100%; display: block; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 26px; }
.fact { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.fact strong { display: block; font-size: 1.5rem; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fact span { color: var(--text-2); font-size: .86rem; }
.module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.module-list li { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: .92rem; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.module-list li .icon { color: var(--cyan); }
.module-list li em { margin-left: auto; font-style: normal; color: var(--text-3); font-size: .8rem; }

/* ---- Modules (étape 3) */
.mod-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.mod-row:last-child { border-bottom: 0; }
.mod-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(20, 121, 212, .14); color: var(--blue-soft); }
.mod-row h3 { margin: 0 0 3px; }
.mod-row p { margin: 0; color: var(--text-2); font-size: .89rem; }
.mod-row .mod-meta { font-size: .8rem; color: var(--text-3); margin-top: 4px; }
.mod-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* Choix segmenté Oui / Non / À discuter */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; background: var(--input-bg); gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 7px; cursor: pointer; font-size: .88rem; font-weight: 540; color: var(--text-2); transition: background .12s, color .12s; white-space: nowrap; }
.seg span:hover { color: var(--text); }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg input[value="yes"]:checked + span { background: rgba(59, 196, 138, .2); color: var(--ok); }
.seg input[value="no"]:checked + span { background: rgba(239, 91, 91, .16); color: var(--danger); }
.seg input[value="discuss"]:checked + span { background: rgba(34, 184, 207, .18); color: var(--cyan); }
:root[data-theme="light"] .seg input[value="yes"]:checked + span { color: #1E8A5C; }
:root[data-theme="light"] .seg input[value="discuss"]:checked + span { color: #0E7C8E; }

/* ---- Fonctionnalités (étape 4) */
.mod-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: thin; }
.mod-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: .86rem; cursor: pointer; font: inherit; font-size: .86rem; }
.mod-tab:hover { color: var(--text); }
.mod-tab[aria-selected="true"] { background: rgba(20, 121, 212, .2); border-color: var(--blue); color: var(--text); }
.mod-tab .cnt { font-variant-numeric: tabular-nums; font-size: .76rem; color: var(--text-3); }
.mod-tab.is-complete .cnt { color: var(--ok); }
.mod-panel[hidden] { display: none; }
.mod-panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.mod-panel-head p { color: var(--text-2); margin: 4px 0 0; max-width: 62ch; font-size: .93rem; }

.feature { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 12px; transition: border-color .15s; backdrop-filter: blur(10px); }
.feature[data-state="accepted"] { border-left: 3px solid var(--ok); }
.feature[data-state="refused"] { border-left: 3px solid var(--danger); }
.feature[data-state="discuss"] { border-left: 3px solid var(--cyan); }
.feature[data-state="draft"] { border-left: 3px solid var(--warn); }
.feature-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; align-items: start; }
.feature-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.feature-title h3 { margin: 0; font-size: 1rem; }
.code { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--cyan); font-weight: 600; }
.feature-desc { color: var(--text-2); font-size: .91rem; margin: 6px 0 0; max-width: 70ch; }
.feature-example { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); font-size: .87rem; color: var(--text-2); display: flex; gap: 9px; max-width: 70ch; }
.feature-example .icon { color: var(--orange); margin-top: 2px; }
.feature-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.feature-more { padding: 0 18px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.feature-more .full { grid-column: 1 / -1; }
.feature-more .label { font-size: .84rem; color: var(--text-2); margin-bottom: 5px; }
.feature-more textarea.input { min-height: 64px; font-size: .9rem; }
.feature .hide-when-no[hidden] { display: none; }
.followup { color: var(--text); font-size: .87rem; }
.followup .icon { color: var(--cyan); }

/* ---- Checklist et fichiers (étape 5) */
.checklist { width: 100%; border-collapse: collapse; }
.checklist td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.checklist td:first-child { font-weight: 540; width: 32%; }
.checklist select.input, .checklist input.input { padding: 8px 10px; font-size: .88rem; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px; border-radius: var(--r-md); border: 1.5px dashed var(--border-strong); background: var(--surface-2); text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--cyan); background: rgba(34, 184, 207, .06); }
.dropzone .icon { color: var(--cyan); }
.file-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: .9rem; }
.file-list li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Propositions (étape 8) */
.custom-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; background: var(--surface-2); }

/* ---- Récapitulatif */
.recap-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.recap-stats div { padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.recap-stats strong { display: block; font-size: 1.4rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.recap-stats span { font-size: .8rem; color: var(--text-2); }
.dl { display: grid; grid-template-columns: minmax(160px, 34%) 1fr; gap: 8px 18px; margin: 0; font-size: .92rem; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; white-space: pre-line; }
details.recap { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 10px; }
details.recap summary { cursor: pointer; padding: 13px 16px; display: flex; justify-content: space-between; gap: 12px; font-weight: 560; list-style: none; }
details.recap summary::-webkit-details-marker { display: none; }
details.recap[open] summary { border-bottom: 1px solid var(--border); }
details.recap .inner { padding: 6px 16px 14px; }

/* =====================================================================
   TABLEAUX (communs)
   ===================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 560; color: var(--text-3); font-size: .8rem; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--text); font-weight: 560; }

/* =====================================================================
   ADMINISTRATION
   ===================================================================== */
.admin-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.admin-side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); background: rgba(8, 13, 24, .6); display: flex; flex-direction: column; gap: 22px; }
:root[data-theme="light"] .admin-side { background: rgba(255, 255, 255, .7); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--text-2); font-size: .92rem; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: rgba(20, 121, 212, .18); color: var(--text); }
.admin-nav a.active .icon { color: var(--blue-soft); }
.admin-nav .sep { height: 1px; background: var(--border); margin: 10px 4px; }
.admin-me { margin-top: auto; font-size: .84rem; color: var(--text-3); padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border); }
.admin-me strong { color: var(--text); display: block; font-weight: 560; }
.admin-main { padding: 24px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.65rem; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: .85rem; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.kpi .k-label { color: var(--text-2); font-size: .86rem; display: flex; align-items: center; gap: 8px; }
.kpi .k-label .icon { color: var(--cyan); }
.kpi .k-value { font-size: 2rem; font-weight: 680; letter-spacing: -0.035em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .82rem; color: var(--text-3); }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: .87rem; }
.hbar .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--orange); }
.tabs a .cnt { color: var(--text-3); font-size: .8rem; margin-left: 4px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 180px; padding: 8px 12px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); font-size: .84rem; color: var(--text-2); }
.filter-chips a.active { border-color: var(--blue); color: var(--text); background: rgba(20, 121, 212, .16); }
.filter-chips a:hover { text-decoration: none; color: var(--text); }

.link-box { display: flex; gap: 8px; align-items: stretch; }
.link-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--border); position: relative; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.timeline time { color: var(--text-3); font-size: .8rem; display: block; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: rgba(242, 181, 65, .07); border: 1px solid rgba(242, 181, 65, .25); margin-bottom: 10px; white-space: pre-line; font-size: .92rem; }
.note .meta { font-size: .8rem; color: var(--text-3); margin-top: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .icon { color: var(--text-3); margin-bottom: 10px; }
.pager { display: flex; gap: 6px; margin-top: 16px; }

/* Pages d'authentification */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { margin-bottom: 26px; }
.otp-input { font-size: 1.7rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding: 14px; }

.theme-toggle { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

.mobile-bar { display: none; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
  .welcome { grid-template-columns: 1fr; }
  .site-visual { min-height: 240px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .style-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recap-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .client-shell, .admin-shell { grid-template-columns: 1fr; }
  .client-side, .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; }
  .client-side .brand, .client-side .side-foot, .client-side .core-total { display: none; }
  /* Le carottage devient une carotte horizontale */
  .core-log h2 { display: none; }
  .core { display: flex; gap: 3px; }
  .layer .depth { display: none; }
  .layer a { flex-direction: column; gap: 2px; padding: 8px 2px 6px; justify-content: center; border-radius: 6px; min-width: 0; flex: 1; text-align: center; }
  .layer { display: flex; flex: 1; min-width: 0; }
  .layer a::before { width: 100%; height: 4px; top: auto; bottom: 0; }
  .layer a.is-current::before { width: 100%; }
  .layer a::after { width: calc(var(--fill, 0) * 100%); height: 4px; top: auto; bottom: 0; background: var(--layer); opacity: 1; }
  .layer .lt { display: none; }
  .layer .ln { width: auto; }
  .layer a.is-done .lc { display: none; }
  .mobile-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
  .admin-side { gap: 10px; }
  .admin-nav { display: flex; overflow-x: auto; gap: 4px; }
  .admin-nav a { flex: none; padding: 8px 10px; }
  .admin-nav .sep, .admin-me, .admin-side > .brand { display: none; }
  .client-main, .admin-main { padding-top: 18px; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .card { padding: 18px; border-radius: 14px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .feature-more, .module-list { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .fact { padding: 10px; }
  .fact strong { font-size: 1.2rem; }
  .feature-top { grid-template-columns: 1fr; }
  .feature-side { align-items: stretch; }
  .seg { display: flex; }
  .seg label { flex: 1; }
  .seg span { width: 100%; justify-content: center; padding: 9px 6px; }
  .mod-row { grid-template-columns: 34px minmax(0, 1fr); }
  .mod-actions { grid-column: 1 / -1; align-items: stretch; }
  .recap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .checklist, .checklist tbody, .checklist tr, .checklist td { display: block; width: 100% !important; }
  .checklist tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .checklist td { border: 0; padding: 4px 0; }
  .step-nav .btn { flex: 1; }
  .hbar { grid-template-columns: 90px 1fr 36px; }
  .link-box { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
