/* Vitrine Ceinture Verte — feuille commune à l'accueil et aux CGU.
 *
 * Les couleurs, rayons et ombres sont ceux de l'application exploitant :
 * valeurs relevées dans apps/web/src/tokens.css (lui-même engendré depuis
 * design/penpot-catalog.tsv). Recopiées plutôt qu'importées — la vitrine
 * est un site statique autonome, sans étape de construction. Si la palette
 * bouge dans Penpot, reporter ici.
 *
 * Rubik est servie depuis ce dossier, pas depuis Google Fonts : même raison
 * que l'app (ADR 0023, souveraineté — aucune requête vers un tiers).
 */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/rubik-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* primitives de l'app */
  --green-900: #1E4433;
  --green-700: #2B5F45;
  --green-600: #336A4E;
  --green-300: #8FBBA3;
  --green-100: #D9EADF;
  --green-50: #F2F8EC;
  --yellow-800: #8A5A00;
  --yellow-600: #FAB728;
  --yellow-500: #E9A81C;
  --yellow-100: #FFF0CC;
  --cream-50: #FFF5E0;
  --neutral-0: #FFFFFF;
  --neutral-50: #F7F8F5;
  --neutral-300: #D7DBD4;
  --neutral-500: #82897F;
  --neutral-600: #61685F;
  --neutral-700: #40453F;
  --neutral-900: #1A1C18;

  /* sémantiques — mêmes noms que dans l'app */
  --background-default: var(--neutral-0);
  --background-subtle: var(--green-50);
  --background-editorial: var(--cream-50);
  --surface-inverse: var(--green-900);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-700);
  --text-muted: var(--neutral-600);
  --text-brand: var(--green-700);
  --text-accent: var(--yellow-800);
  --border-subtle: var(--neutral-300);
  --action-primary-bg: var(--green-600);
  --action-primary-bg-hover: var(--green-700);
  --action-accent-bg: var(--yellow-600);
  --focus-ring: var(--green-900);

  --radius-card: 14px;
  --radius-action: 10px;
  --radius-pill: 9999px;
  --shadow-1: 0px 2px 10px 0px rgba(26, 28, 24, 0.06);
  --shadow-2: 0px 4px 12px 0px rgba(26, 28, 24, 0.14);

  --sans: "Rubik", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --container: 1120px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background-default);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-brand); text-underline-offset: 3px; }
a:hover { color: var(--green-900); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
@media (max-width: 600px) { :root { --gutter: 16px; } }

/* ---------- en-tête ---------- */

.site-header { border-bottom: 1px solid var(--border-subtle); background: var(--background-default); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }

.brands { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brands-sep { width: 1px; height: 32px; background: var(--border-subtle); flex: none; }
.brands-partner { height: 34px; width: auto; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { display: block; height: 54px; width: auto; }

.header-link { white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.header-link:hover { color: var(--text-brand); text-decoration: underline; }

/* ---------- boutons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius-action);
  font: 500 16px/1.5 var(--sans);
  text-decoration: none;
  background: var(--action-primary-bg); color: var(--neutral-0);
  transition: background-color .15s;
}
.btn:hover { background: var(--action-primary-bg-hover); color: var(--neutral-0); }
.btn-secondary { background: var(--neutral-0); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.btn-secondary:hover { background: var(--neutral-50); color: var(--green-900); }
.btn-meta { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* ---------- ouverture (accueil) et titre (CGU) ---------- */

.intro-block, .doc-head { border-bottom: 1px solid var(--border-subtle); }
.kicker { margin: 0; font-size: 14px; font-weight: 500; color: var(--text-brand); }

.intro-block .container { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 56px; }
.intro-block h1 { margin: 12px 0 0; font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: var(--green-900); text-wrap: balance; }
.intro-block .lead { margin: 16px 0 0; font-size: 18px; line-height: 1.6; color: var(--text-secondary); max-width: 34em; }
.intro-block .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.intro-photo { margin: 0; }
.intro-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-card); background: var(--neutral-50); }

/* ---------- corps de l'accueil ---------- */

.page { max-width: 44em; padding-block: 16px 72px; }
.page section { padding-top: 40px; }
.page section + section { margin-top: 40px; border-top: 1px solid var(--border-subtle); }
.page h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
.page p, .page li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.page p { margin: 0 0 14px; }
.page ul { margin: 0 0 14px; padding-left: 1.2em; }
.page ul li { margin-bottom: 6px; }
.page ul li::marker { color: var(--text-brand); }
.page .cta { margin-top: 24px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; border-top: 1px solid var(--border-subtle); color: var(--text-secondary); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { font-weight: 500; color: var(--text-primary); }

.shot { margin: 28px 0 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-action); }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--text-muted); }

/* ---------- soutiens ---------- */

.support { border-top: 1px solid var(--border-subtle); padding-block: 32px; }
.support img { display: block; width: 100%; max-width: 360px; height: auto; }

/* ---------- pied ---------- */

.site-footer { background: var(--surface-inverse); color: #E9F1EC; padding-block: 24px; font-size: 14px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--neutral-0); }
.site-footer a:hover { color: var(--yellow-600); }
.site-footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; align-items: center; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- page de CGU ---------- */

.doc-head { padding-block: 48px 40px; }
.doc-head h1 { margin: 10px 0 0; font-size: 36px; font-weight: 700; line-height: 1.15; color: var(--green-900); letter-spacing: -.01em; }
.doc-head .meta { margin: 16px 0 0; font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 24px; }

.doc-single { padding-block: 48px 80px; }
.doc { max-width: 44em; }
.doc .doc-intro { font-size: 17px; color: var(--text-primary); margin-bottom: 40px; }
.doc h3 { margin: 24px 0 8px; font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--text-primary); }
.doc article { scroll-margin-top: 24px; }
.doc article + article { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border-subtle); }
.doc h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; line-height: 1.35; }
.doc h2 .num { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--text-brand); margin-bottom: 4px; }
.doc p, .doc li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.doc p { margin: 0 0 14px; }
.doc strong { color: var(--text-primary); font-weight: 500; }

/* ---------- popup « Transmettre mes données » ---------- */

button.btn { border: 0; cursor: pointer; }
button.btn:disabled { opacity: .6; cursor: progress; }

.depot {
  width: min(640px, calc(100% - 2 * var(--gutter)));
  max-height: min(860px, calc(100dvh - 2 * var(--gutter)));
  padding: 0; border: 0; overflow: hidden;
  border-radius: 18px;
  background: var(--background-default); color: var(--text-primary);
  box-shadow: 0 24px 64px rgba(26, 28, 24, 0.28);
}
.depot[open] { display: flex; flex-direction: column; animation: depot-entree .22s ease-out; }
.depot::backdrop { background: rgba(30, 68, 51, 0.42); backdrop-filter: blur(3px); }
@keyframes depot-entree { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .depot[open] { animation: none; } }

.depot-form, .depot-questionnaire { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.depot-form[hidden], .depot-questionnaire[hidden] { display: none; }

.depot-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 24px 28px 22px;
  background: var(--background-subtle);
  border-bottom: 1px solid var(--green-100);
}
.depot-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--text-brand); }
.depot-head h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--green-900); }
.depot-intro { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.depot-intro strong { font-weight: 500; color: var(--green-900); }
.depot-fermer {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin: -4px -6px 0 0;
  border: 0; border-radius: var(--radius-pill); background: var(--neutral-0); color: var(--text-secondary);
  box-shadow: var(--shadow-1); cursor: pointer; transition: color .15s, background-color .15s;
}
.depot-fermer:hover { color: var(--green-900); background: var(--green-100); }

.depot-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 28px 8px; }

.bloc { margin: 0; padding: 22px 0 6px; border: 0; min-width: 0; }
.bloc + .bloc { border-top: 1px solid var(--border-subtle); }
/* légende flottante : sinon la bordure du fieldset passe derrière elle */
.bloc legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 16px; font-size: 16px; font-weight: 500; color: var(--text-primary); }
.bloc legend + * { clear: both; }
.num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-900); font-size: 13px; font-weight: 700; }

.champ { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.champ input {
  display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-action);
  background: var(--neutral-0); font: 400 16px/1.5 var(--sans); color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
}
.champ input::placeholder { color: var(--neutral-500); }
.champ input:hover { border-color: var(--green-300); }
.champ input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.champ input.invalide { border-color: #A3261B; box-shadow: 0 0 0 3px #FBE3DF; }
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.requis { color: var(--text-accent); }
.facultatif { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--text-muted); }

.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.zone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0; padding: 22px 14px 18px; text-align: center;
  border: 1.5px dashed var(--green-300); border-radius: var(--radius-card);
  background: var(--green-50); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.zone:hover, .zone.survol { border-color: var(--green-600); background: var(--green-100); }
.zone:focus-within { box-shadow: 0 0 0 3px var(--green-100); border-color: var(--green-600); }
.zone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.zone-icone {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px;
  border-radius: var(--radius-pill); background: var(--neutral-0); color: var(--green-700); box-shadow: var(--shadow-1);
}
.zone-icone .i-ok { display: none; }
.zone-texte { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.zone-titre { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.zone-aide { max-width: 100%; font-size: 13px; line-height: 1.45; color: var(--text-muted); overflow-wrap: anywhere; }
.zone-aide .lien { color: var(--text-brand); text-decoration: underline; text-underline-offset: 3px; }
.zone.rempli { border-style: solid; border-color: var(--green-600); background: var(--neutral-0); }
.zone.rempli .zone-icone { background: var(--green-600); color: var(--neutral-0); box-shadow: none; }
.zone.rempli .i-doc { display: none; }
.zone.rempli .i-ok { display: block; }
.zone.rempli .zone-aide { color: var(--text-secondary); }
.zone.erreur { border-color: #A3261B; background: #FDF3F1; }
.zone.erreur .zone-aide { color: #A3261B; }
.aide { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); text-align: center; }

.case {
  display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 8px; padding: 14px 16px;
  border-radius: var(--radius-action); background: var(--background-editorial);
  font-size: 14px; line-height: 1.55; color: var(--text-secondary); cursor: pointer;
}
.case input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--action-primary-bg); cursor: pointer; }
.case.invalide { box-shadow: inset 0 0 0 1.5px #A3261B; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.depot-pied { display: grid; gap: 12px; padding: 16px 28px 20px; border-top: 1px solid var(--border-subtle); background: var(--neutral-0); }
.depot-progression { height: 6px; border-radius: var(--radius-pill); background: var(--green-100); overflow: hidden; }
.depot-progression span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--action-primary-bg); transition: width .2s; }
.depot-statut { margin: 0; font-size: 14px; color: var(--text-brand); }
.depot-statut:empty { display: none; }
.depot-statut.erreur { color: #A3261B; }
.depot-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* questionnaire : choix en pastilles, unités dans les champs, totaux calculés */
.question { margin-bottom: 16px; }
.question[hidden] { display: none; }
.question-titre { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { position: relative; display: inline-flex; }
.puce input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.puce span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
  background: var(--neutral-0); font-size: 14px; color: var(--text-secondary);
  transition: border-color .15s, background-color .15s, color .15s;
}
.puce:hover span { border-color: var(--green-300); color: var(--text-primary); }
.puce input:checked + span { border-color: var(--green-600); background: var(--green-600); color: var(--neutral-0); }
.puce input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.unite { position: relative; display: block; }
.unite input { padding-right: 52px; }
.unite > span { position: absolute; right: 14px; top: calc(50% + 3px); transform: translateY(-50%); font-size: 14px; font-weight: 400; color: var(--text-muted); pointer-events: none; }
.champ-aide { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--text-muted); }
.calcule { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-action); background: var(--background-subtle); font-size: 14px; color: var(--text-secondary); }
.calcule[hidden] { display: none; }
.calcule strong { font-weight: 500; color: var(--text-primary); }

.depot-ok { display: flex; flex-direction: column; align-items: center; padding: 48px 32px 36px; text-align: center; }
.depot-ok[hidden] { display: none; }
.ok-icone { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 20px; border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-700); box-shadow: 0 0 0 10px var(--green-50); }
.depot-ok h2 { margin: 0; max-width: 20em; text-wrap: balance; font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--green-900); }
.depot-ok p { margin: 10px 0 26px; font-size: 16px; color: var(--text-secondary); }

/* ---------- petits écrans ---------- */

@media (max-width: 900px) {
  .intro-block .container { grid-template-columns: 1fr; gap: 32px; padding-block: 40px; }
  .intro-block h1 { font-size: 32px; }
  .intro-block .lead { font-size: 17px; }
  .doc-head h1 { font-size: 30px; }
}
@media (max-width: 600px) {
  .timeline li { grid-template-columns: 1fr; }
  .depot { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .depot-head { padding: 16px 16px 14px; }
  .depot-kicker { display: none; }
  .depot-head h2 { font-size: 21px; }
  .depot-intro { margin-top: 4px; font-size: 14px; }
  .depot-fermer { margin: -2px -4px 0 0; }
  .depot-corps { padding: 0 16px 6px; }
  .depot-pied { padding: 12px 16px 14px; }
  .champs-2, .zones { grid-template-columns: 1fr; }
  .zone { flex-direction: row; text-align: left; gap: 12px; padding: 14px; }
  .zone-icone { margin: 0; flex: none; }
  .zone-texte { align-items: flex-start; }
  .depot-actions { flex-direction: column-reverse; }
  .depot-actions .btn { justify-content: center; }
  .depot-ok { padding: 36px 20px 24px; }
}
@media (max-width: 520px) {
  .intro-block h1 { font-size: 28px; }
  .header-link .long { display: none; }
  .brands { gap: 10px; }
  .brands-partner { height: 24px; }
  .brands-sep { height: 24px; }
  .brand img { height: 42px; }
}
.header-link .court { display: none; }
@media (max-width: 400px) {
  .site-header .container { gap: 10px; }
  .brands { gap: 8px; }
  .brand { gap: 7px; }
  .brand img { height: 36px; }
  .brands-partner { height: 20px; }
  .brands-sep { height: 20px; }
}
@media (max-width: 520px) { .header-link .court { display: inline; } }
