/* Dossier d'inscription – Les Graines du Bonheur */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --framboise: #a6383f;
  --framboise-fonce: #7e2a30;
  --framboise-voile: #f8eaeb;
  --abricot: #ee9a2e;
  --abricot-voile: #fdf1e1;
  --feuille: #5e9a37;
  --feuille-voile: #edf4e6;
  --encre: #2e2724;
  --pierre: #6b625d;
  --trait: #d6dccf;
  --fond: #f1f5ec;
  --papier: #ffffff;
  --rayon: 10px;
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; scroll-padding-bottom: 24px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--fond);
}
[hidden] { display: none !important; }
.off { display: none !important; }
.nowrap { white-space: nowrap; }

a { color: var(--framboise-fonce); }
:focus-visible { outline: 3px solid var(--abricot); outline-offset: 2px; }

/* ------------------------------------------------------------ en-tête */
.masthead {
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem max(1rem, calc((100vw - 760px) / 2));
}
.masthead img { width: 150px; height: auto; flex: none; }
.masthead-kicker { margin: 0; color: var(--pierre); font-size: .95rem; }
.masthead h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; color: var(--framboise); letter-spacing: -.01em; }

.noscript { max-width: 760px; margin: 1rem auto; padding: 1rem; background: var(--abricot-voile); border-radius: var(--rayon); }

/* ------------------------------------------------------------ feuille */
.sheet { max-width: 760px; margin: 0 auto; padding: 0 1rem 7rem; }

.progress {
  position: sticky; top: 0; z-index: 5;
  background: var(--fond);
  padding: .9rem 0 .7rem;
}
.progress-count { margin: 0 0 .4rem; font-size: .95rem; color: var(--pierre); }
.progress-count #stepName { color: var(--encre); font-weight: 700; }
.progress-rail { height: 6px; background: #dfe6d6; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--feuille); border-radius: 3px; transition: width .35s ease; }
.progress-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem .9rem; }
.progress-steps button {
  font: inherit; font-size: .88rem; background: none; border: 0; padding: .1rem 0; cursor: pointer;
  color: var(--pierre); border-bottom: 2px solid transparent;
}
.progress-steps button:disabled { color: #a9a39f; cursor: default; }
.progress-steps .done button { color: var(--feuille); }
.progress-steps .current button { color: var(--encre); font-weight: 700; border-bottom-color: var(--framboise); }

form#dossier {
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 1.75rem 2rem 1.5rem;
}

h2 { font-size: 1.65rem; line-height: 1.2; margin: 0 0 1rem; color: var(--framboise); letter-spacing: -.01em; }
h2:focus { outline: none; }
h3 {
  font-size: 1.1rem; margin: 2rem 0 .8rem; padding-top: 1.1rem;
  border-top: 1px solid var(--trait);
}
h2 + h3, .finance > h3:first-child { border-top: 0; padding-top: 0; margin-top: .5rem; }
.lead { font-size: 1.12rem; }
.small { font-size: .92rem; color: var(--pierre); }
.note { background: var(--feuille-voile); padding: .8rem 1rem; border-radius: var(--rayon); }
.hint { margin: .3rem 0 0; font-size: .9rem; color: var(--pierre); }
h3 + .hint { margin: -.4rem 0 .8rem; }

.howto { padding-left: 1.4rem; }
.howto li { margin: .35rem 0; padding-left: .2rem; }
.howto li::marker { color: var(--framboise); font-weight: 700; }

details.docs, details.tarif-details {
  border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: .7rem 1rem; margin: .8rem 0;
}
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: .5rem; }
details.docs ul { padding-left: 1.2rem; margin: .4rem 0 .8rem; }
details.docs li { margin: .25rem 0; font-size: .96rem; }
.draft-note { font-size: .95rem; background: var(--abricot-voile); padding: .6rem .9rem; border-radius: var(--rayon); }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--framboise-fonce); text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------ champs */
.grid, .subgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.subgrid { margin: 0; }
.grid > *, .subgrid > * { grid-column: span 6; }
.grid > .half, .subgrid > .half { grid-column: span 3; }
.grid > .third, .subgrid > .third { grid-column: span 2; }

.field { min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; font-size: .97rem; margin-bottom: .35rem; padding: 0; }
.field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.req { color: var(--framboise); }
.opt { font-weight: 400; color: var(--pierre); font-size: .88rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"],
select, textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--encre);
  background: #fff;
  border: 1px solid #c3cabb; border-radius: 8px;
  padding: .7rem .8rem;
  min-height: 48px;
}
textarea { resize: vertical; min-height: 4.5rem; }
input[readonly] { background: #f6f7f4; color: var(--pierre); }
input:focus, select:focus, textarea:focus { border-color: var(--abricot); outline: 3px solid rgba(238, 154, 46, .35); outline-offset: 0; }
.narrow-input input { max-width: 8rem; }
.mono input { font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--framboise); background: #fffafa; }
.error { margin: .3rem 0 0; color: var(--framboise); font-size: .92rem; font-weight: 700; }
.error:empty { display: none; }
.field.invalid .pill { border-color: var(--framboise); }

/* Pastilles radio */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.field .pill {
  position: relative; display: inline-flex; align-items: center;
  border: 1px solid #c3cabb; border-radius: 999px;
  padding: .55rem 1.05rem; min-height: 46px;
  cursor: pointer; background: #fff; font-weight: 400; margin: 0; font-size: 1rem;
}
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill > span::before {
  content: ""; display: inline-block; width: 1.05rem; height: 1.05rem; margin-right: .55rem; vertical-align: -.15rem;
  border: 2px solid #9aa391; border-radius: 50%; background: #fff;
}
.pill:has(input:checked) { border-color: var(--framboise); background: var(--framboise-voile); }
.pill input:checked + span::before { border-color: var(--framboise); background: radial-gradient(circle, var(--framboise) 0 45%, #fff 50%); }
.pill:has(input:focus-visible) { outline: 3px solid var(--abricot); outline-offset: 2px; }
.stack .pills { flex-direction: column; }
.field.stack .pill { border-radius: var(--rayon); width: 100%; padding: .75rem 1rem; align-items: flex-start; }
.stack .pill > span { display: block; padding-left: 1.6rem; text-indent: -1.6rem; }
.stack .pill small { display: block; text-indent: 0; color: var(--pierre); font-size: .9rem; }
.stack .pill small span { white-space: nowrap; }

/* Cases à cocher */
.field .checkline { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; font-size: 1rem; cursor: pointer; margin: 0; }
.checkline input { flex: none; width: 1.35rem; height: 1.35rem; margin: .12rem 0 0; accent-color: var(--framboise); }
.field.check { margin: 1rem 0; }
.field.check.invalid .checkline { color: var(--framboise-fonce); }

/* Lignes répétées */
.rows { margin-bottom: 1rem; }
.row2, .row3 { display: grid; gap: .8rem 1rem; margin-bottom: .8rem; }
.row2 { grid-template-columns: 3fr 1fr; }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.add-row {
  font: inherit; font-size: .95rem; background: none; cursor: pointer;
  border: 1px dashed #a9b3a0; border-radius: 8px; padding: .55rem 1rem; color: var(--feuille);
}
.add-row::before { content: "+ "; font-weight: 700; }

/* Suivis */
.followups { display: grid; gap: .3rem; margin: 1rem 0; }
.followup { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.25rem; align-items: end; padding: .6rem 0; border-bottom: 1px solid #ecefe8; }
.followup .field.off + * { display: none; }

/* Autorisations */
.auths .field.auth { padding: .9rem 0; border-bottom: 1px solid #ecefe8; }
.auths .field.auth fieldset { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1.5rem; align-items: center; }
.auths .field.auth legend { float: left; font-weight: 400; margin: 0; }
.field.auth.check { margin: 0; }
[data-if="section=college"] .field.auth fieldset { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1.5rem; align-items: center; }
[data-if="section=college"] .field.auth legend { float: left; font-weight: 400; }

/* Finances */
.calc-line { margin: -.4rem 0 1rem; color: var(--feuille); font-size: .96rem; }
table.mini { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.mini td { padding: .4rem 0; border-bottom: 1px solid #ecefe8; vertical-align: top; }
table.mini td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.recap {
  margin: 1.6rem 0 1rem; padding: 1rem 1.2rem;
  background: var(--feuille-voile); border-left: 4px solid var(--feuille); border-radius: 0 var(--rayon) var(--rayon) 0;
}
.recap h3 { border: 0; padding: 0; margin: 0 0 .6rem; }
.recap dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0 0 .8rem; }
.recap dt { margin: 0; }
.recap dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* SEPA */
.creditor { display: flex; gap: 2rem; flex-wrap: wrap; font-size: .95rem; background: #f6f7f4; border-radius: var(--rayon); padding: .8rem 1rem; }
.creditor p { margin: 0; }

/* Protocole */
.protocol h3 { font-size: 1.02rem; }
.protocol p, .protocol li { font-size: .98rem; }
.warning { background: var(--abricot-voile); border-left: 4px solid var(--abricot); padding: .7rem 1rem; border-radius: 0 var(--rayon) var(--rayon) 0; }

/* Déclaration et signatures */
.declaration { background: #f6f7f4; border-radius: var(--rayon); padding: .9rem 1.1rem; }
.declaration p { margin: 0; }
.signatures { display: grid; gap: 1.6rem; margin: 1.6rem 0 1rem; }
.sig-title { margin: 0 0 .5rem; font-size: .95rem; color: var(--pierre); }
.sig-title strong { color: var(--encre); font-size: 1.05rem; }
.sigpad {
  position: relative; border: 1px solid #c3cabb; border-radius: var(--rayon);
  background: #fffefb; touch-action: none; overflow: hidden;
}
.sigpad canvas { display: block; width: 100%; height: 180px; cursor: crosshair; position: relative; z-index: 1; }
.sigpad::before {
  content: "×"; position: absolute; left: 1rem; bottom: 22%; z-index: 0;
  font-size: 1.4rem; line-height: 1; color: #b5ab9f;
}
.sigpad::after {
  content: ""; position: absolute; left: 2.6rem; right: 1rem; bottom: 24%; z-index: 0;
  border-bottom: 1px solid #cfc6bb;
}
.sig-guide {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center; z-index: 0;
  color: #a39a90; font-size: .95rem; pointer-events: none; padding: 0 1rem;
}
.sigpad.signed .sig-guide { display: none; }
.sig-clear {
  position: absolute; top: .4rem; right: .4rem; z-index: 2;
  font: inherit; font-size: .85rem; background: #fff; border: 1px solid var(--trait); border-radius: 6px;
  padding: .25rem .6rem; cursor: pointer; color: var(--pierre);
}
.field.sigfield.invalid .sigpad { border-color: var(--framboise); }
.signer .field.check { margin-top: .7rem; }

.cf-turnstile { margin: 1rem 0; }

/* ------------------------------------------------------------ navigation */
.nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--trait); }
.btn {
  font: inherit; font-weight: 700; font-size: 1.02rem;
  border-radius: 999px; padding: .8rem 1.6rem; min-height: 50px; cursor: pointer;
  border: 2px solid var(--framboise); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: var(--framboise); color: #fff; margin-left: auto; }
.btn.primary:hover { background: var(--framboise-fonce); border-color: var(--framboise-fonce); }
.btn.ghost { background: #fff; color: var(--framboise); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.small { font-size: .95rem; padding: .5rem 1.1rem; min-height: 0; margin-top: .6rem; }

.global-error {
  background: var(--framboise-voile); color: var(--framboise-fonce); font-weight: 700;
  border-radius: var(--rayon); padding: .9rem 1.1rem; margin-bottom: 1.2rem;
}
.global-error .btn { color: #fff; }

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

.sending {
  position: fixed; inset: 0; z-index: 50; background: rgba(241, 245, 236, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-size: 1.1rem; font-weight: 700;
}
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #d5e3c8; border-top-color: var(--feuille);
  animation: tourne .9s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

.foot { text-align: center; font-size: .85rem; color: var(--pierre); padding: 1.5rem 1rem 6rem; }

/* ------------------------------------------------------------ page de confirmation */
.done-sheet { background: var(--papier); border: 1px solid var(--trait); border-radius: 14px; padding: 2rem; margin-top: 1.5rem; }
.done-sheet h2 { margin-top: 0; }
.done-sheet ul { padding-left: 1.2rem; }
.done-sheet li { margin: .3rem 0; }
.address-card { background: #f6f7f4; border-radius: var(--rayon); padding: .9rem 1.1rem; display: inline-block; }

/* ------------------------------------------------------------ mobile */
@media (max-width: 640px) {
  html { scroll-padding-top: 70px; scroll-padding-bottom: 96px; }
  body { font-size: 1rem; }
  .masthead { gap: .8rem; }
  .masthead img { width: 104px; }
  .masthead h1 { font-size: 1.25rem; }
  .masthead-kicker { font-size: .85rem; }
  .sheet { padding: 0 .6rem 7rem; }
  .progress-steps { display: none; }
  form#dossier { padding: 1.2rem 1rem 1rem; border-radius: 12px; }
  h2 { font-size: 1.4rem; }
  .grid > .half, .grid > .third, .subgrid > .half, .subgrid > .third { grid-column: span 6; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :first-child { grid-column: span 2; }
  .followup { grid-template-columns: 1fr; }
  .auths .field.auth fieldset, [data-if="section=college"] .field.auth fieldset { grid-template-columns: 1fr; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--trait);
    padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom));
  }
  .btn { padding: .7rem 1.2rem; flex: 1; }
  .btn.primary { flex: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 2s !important; scroll-behavior: auto !important; }
}

@media print {
  .progress, .nav, .masthead img { display: none; }
}
