/* Formulaire du dossier (fr/onboarding), habillé comme les pages de la refonte du 2026-10-13, et les pages
   qui l'entourent : l'entrée anglaise (en/get-started), la confirmation de l'adresse (fr/confirmation), la 404.
   Se charge après /site/site.css, dont il reprend les jetons (encre, filets, fonds), la barre et le pied.
   Le balisage et les classes restent ceux qu'attend onboarding.js : écrans .step, .form-grid,
   .checkbox-group, .recap, .field-error, .has-error. Ce fichier est écrit à la main : le portage de la
   maquette (integrer.py) ne le touche pas. */

:root {
  /* Bord des champs : c'est leur seul repère visuel, WCAG 1.4.11 lui demande 3:1. #868c99 donne 3,4:1 sur
     le blanc du champ, 3,2:1 sur le fond de page. Formulaire de conversion, rempli jusqu'à 70 ans. */
  --champ: #868c99;
  --erreur: #b42318;
}

/* La barre : la marque, et le retour à l'accueil, sans menu ni bouton de commande */
.nav-retour {
  margin-left: auto; margin-right: -12px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 6px; font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav-retour:hover { background: var(--fond); color: var(--ink); }
@media (max-width: 640px) { .nav-retour { margin-right: -8px; } }

/* Le cadre de la page */
/* Même largeur que le pied (.wrap) : le contenu et le pied partent du même bord. */
.df-onboarding { max-width: 1200px; margin: 0 auto; padding: 56px 28px 24px; }
.df-onboarding > .resume-banner,
.df-onboarding > .progress,
.df-onboarding > .d-engagements,
.df-onboarding form > .step:not(.df-entree) { max-width: 720px; margin-left: auto; margin-right: auto; }

/* Chaque écran tient dans une carte, comme la fiche de la page Équipe */
.df-onboarding > .df-carte { max-width: 720px; margin-left: auto; margin-right: auto; }
.df-onboarding form > .step:not(.df-entree),
.df-carte,
.df-entree-colonne {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px 32px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 18px 40px -28px rgba(17, 19, 23, 0.35);
}
.step { animation: df-apparait 300ms var(--ease); }
@keyframes df-apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }

/* L'écran d'entrée : l'agenda à gauche, le questionnaire à droite au-dessus de 1000 px (revue de
   Hugues du 07-09). L'ordre du source reste questionnaire puis agenda, pour le clavier et le téléphone. */
.df-entree { display: grid; gap: 40px; align-items: start; }
@media (min-width: 1001px) {
  .df-entree { grid-template-columns: minmax(360px, 1fr) minmax(0, 1.1fr); gap: 56px; }
  .df-entree .df-appel { order: -1; padding-top: 37px; }
}
.df-appel .df-appel-agenda { display: block; width: 100%; height: 700px; border: 0; background: transparent; color-scheme: light; }
@media (max-width: 1000px) {
  .df-appel { padding-top: 32px; border-top: 1px solid var(--line-2); }
}

/* Titres et chapeaux. Le titre de l'agenda prend la taille du h1 voisin, pour que les deux chapeaux
   partent de la même hauteur (revue de Hugues du 07-09). */
.df-onboarding h1,
.df-appel .df-appel-titre { font-size: clamp(30px, 1.2vw + 22px, 40px); font-weight: 620; letter-spacing: -0.035em; line-height: 1.08; margin: 0 0 12px; text-wrap: balance; }
.step h2 { font-size: clamp(25px, 0.6vw + 19px, 30px); font-weight: 620; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 24px; text-wrap: balance; }
.lede,
.df-appel .df-appel-texte { font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 54ch; margin: 0 0 28px; }
.step h2 + .lede { margin-top: -14px; }

/* Les champs */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; min-width: 0; border: 0; padding: 0; margin: 0 0 24px; }
.form-grid > .field-error { grid-column: 1 / -1; margin-top: -8px; }
.form-grid label,
.form-label-block,
.file-upload > label { display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; font-weight: 560; letter-spacing: -0.01em; color: var(--ink); }
.form-label-block { margin: 0 0 24px; }
.form-grid > .form-label-block { margin: 0; }
.form-grid > div > label { height: 100%; }

.df-onboarding input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.df-onboarding select,
.df-onboarding textarea {
  width: 100%; min-height: 46px; margin: 0; padding: 0 14px;
  font: inherit; font-size: 16px; font-weight: 400; letter-spacing: -0.011em; color: var(--ink);
  background-color: #fff; border: 1px solid var(--champ); border-radius: 8px;
  -webkit-appearance: none; appearance: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.df-onboarding select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234f5562' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.df-onboarding textarea { min-height: 100px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
/* Les zones de texte suivent leur contenu, exemple compris, là où le navigateur le sait ; ailleurs, sur
   téléphone, une hauteur qui loge l'exemple des questions du repérage. */
@supports (field-sizing: content) { .df-onboarding textarea { field-sizing: content; } }
@supports not (field-sizing: content) {
  @media (max-width: 640px) {
    .df-onboarding textarea[rows="3"], .df-onboarding textarea[rows="4"] { min-height: 150px; }
    .df-onboarding textarea[rows="5"] { min-height: 200px; }
  }
}
.df-onboarding ::placeholder { color: #8a909c; opacity: 1; }
.df-onboarding input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.df-onboarding select:hover,
.df-onboarding textarea:hover { border-color: var(--ink-3); }
.df-onboarding input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.df-onboarding select:focus,
.df-onboarding textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 24, 29, 0.12); }

.hint { display: block; margin: 0; font-size: 13.5px; font-weight: 400; line-height: 1.45; letter-spacing: -0.005em; color: var(--ink-3); }
.step > .hint,
.step > div > .hint { margin: -12px 0 24px; }
.step > h2 + .hint { margin: -14px 0 20px; font-size: 15px; }
.counter { align-self: flex-end; margin-top: -2px; font-size: 12.5px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Cases et boutons radio. Les listes à choix multiples (secteurs, formations, documents) en pastilles
   à la largeur de leur texte ; les choix rédigés en phrase (groupes .inline) en tuiles pleine largeur. */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0 0 24px; }
.checkbox-group.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
/* La légende flotte : elle devient un élément du flux, sur toute la ligne, dans tous les navigateurs. */
.checkbox-group legend { float: left; grid-column: 1 / -1; width: 100%; padding: 0; margin: 0 0 2px; font-size: 14.5px; font-weight: 560; letter-spacing: -0.01em; color: var(--ink); }
.checkbox-group:not(.inline) > label { align-items: center; min-height: 44px; padding: 10px 14px; }
.checkbox-group > label {
  display: flex; align-items: flex-start; gap: 10px; min-height: 46px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  font-size: 15px; line-height: 1.35; color: var(--ink); cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.checkbox-group > label:hover { border-color: var(--champ); }
.checkbox-group > label:has(input:checked) { border-color: var(--ink); background: var(--fond); }
.checkbox-group > .field-error { grid-column: 1 / -1; flex-basis: 100%; }
.df-onboarding input[type="checkbox"],
.df-onboarding input[type="radio"] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.checkbox-group input { margin-top: 0.5px; }
[data-branch-only] { margin-top: 0; }

/* Dépôt du CV */
.file-upload { margin: 0 0 24px; padding: 16px 18px; border: 1px dashed var(--champ); border-radius: 10px; background: #fff; }
.file-upload input[type="file"] { max-width: 100%; font: inherit; font-size: 14.5px; font-weight: 400; color: var(--ink-2); }
.file-upload input[type="file"]::file-selector-button {
  margin-right: 12px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--fond); box-shadow: inset 0 0 0 1px var(--line-2); font: inherit; font-weight: 560; color: var(--ink);
}
.cv-fallback { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink); }

/* Récapitulatif, écrit par onboarding.js */
.recap { margin: 0 0 20px; padding: 18px 20px; border-radius: 10px; background: var(--fond); }
.recap:empty { display: none; }
.recap h3 { margin: 0 0 10px; font-size: 15px; font-weight: 620; letter-spacing: -0.015em; }
.recap dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.recap dt { font-size: 13.5px; color: var(--ink-3); }
.recap dd { margin: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }

/* Consentement */
.consent {
  display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--fond);
  font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer;
  transition: border-color 150ms ease;
}
.consent:has(input:checked) { border-color: var(--ink); }
.consent input { margin-top: 1px; }
.consent a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--champ); text-underline-offset: 3px; }
.consent a:hover { text-decoration-color: currentColor; }
.consent > .field-error { flex-basis: 100%; }
.consent.has-error { flex-wrap: wrap; border-color: var(--erreur); }

/* Erreurs */
.field-error { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; color: var(--erreur); }
.has-error input:not([type="checkbox"]):not([type="radio"]),
.has-error select,
.has-error textarea { border-color: var(--erreur); }
.checkbox-group.has-error > label { border-color: rgba(180, 35, 24, 0.45); }

/* Bandeaux : brouillon à reprendre, ancien format, changement de stade */
.resume-banner,
.branch-switch-notice { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.resume-banner-obsolete { border-color: rgba(180, 35, 24, 0.3); background: #fdf4f3; }
.branch-switch-notice { margin: -8px 0 0; background: var(--fond); border-color: var(--line); }
.btn-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 560; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Progression */
.progress { margin-bottom: 16px; }
.df-progress-label { margin: 0 0 8px; font-size: 13.5px; font-weight: 560; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.progress-track { height: 4px; border-radius: 999px; background: var(--dep); overflow: hidden; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--ink); transition: width 300ms var(--ease); }

/* Boutons, ceux du site */
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.df-onboarding .btn-primary,
.df-onboarding .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 22px;
  border: 0; border-radius: 6px; font: inherit; font-size: 15.5px; font-weight: 580; letter-spacing: -0.012em;
  text-decoration: none; cursor: pointer; transition: background-color 150ms ease, transform 90ms ease-out;
}
.df-onboarding .btn-primary { background: var(--ink); color: #fff; }
.df-onboarding .btn-primary:hover { background: #2a2d34; }
.df-onboarding .btn-secondary { padding: 12px 18px; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.df-onboarding .btn-secondary:hover { background: var(--fond); }
.df-onboarding .btn-primary:active,
.df-onboarding .btn-secondary:active { transform: scale(0.97); }
.df-onboarding .btn-primary:disabled { background: var(--ink); opacity: 0.38; cursor: not-allowed; transform: none; }

/* Écrans de confirmation */
.step.confirmation h2 { margin-bottom: 14px; }
.step.confirmation p { margin: 10px 0 0; max-width: 62ch; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.step.confirmation strong { font-weight: 600; color: var(--ink); }
.step.confirmation a:not(.btn-secondary):not(.btn-primary) { color: var(--ink); text-underline-offset: 3px; }
.step.confirmation p:last-child { margin-top: 24px; }

/* Les lignes de fin : engagements, contact, agenda */
.d-engagements { margin-top: 20px; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.d-engagements:first-of-type { margin-top: 32px; }
.d-engagements a { color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.d-engagements a:hover { text-decoration-color: currentColor; }
.lien-fleche::after { content: "\2192"; display: inline-block; margin-left: 5px; transition: transform 150ms ease; }
.lien-fleche:hover::after { transform: translateX(2px); }
/* Au-dessus de 1000 px et tant que l'entrée est affichée, les lignes de fin courent sous les deux
   colonnes (revue de Hugues du 07-09). La ligne de l'agenda n'a de sens que sous l'écran d'entrée. */
@media (min-width: 1001px) {
  .df-onboarding:has(.df-entree:not([hidden])) > .d-engagements { max-width: none; }
}
.df-onboarding:not(:has(.df-entree:not([hidden]))) > .df-appel-source { display: none; }

/* Pages simples : confirmation de l'adresse, 404 */
.df-carte p { margin: 10px 0 0; max-width: 62ch; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.df-carte h1 + p { margin-top: 0; }
.df-carte .gs-etiquette { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-3); }
.df-carte a:not(.btn) { color: var(--ink); text-underline-offset: 3px; }
.df-carte .df-carte-action,
.df-carte form { margin-top: 24px; }
.df-carte button.btn { border: 0; cursor: pointer; }
.df-carte-liens { display: grid; gap: 2px; margin: 14px 0 6px; }
.df-carte-liens a { display: inline-flex; align-items: center; min-height: 40px; font-size: 16.5px; font-weight: 560; text-decoration: none; }
.df-carte-liens a:hover { text-decoration: underline; }

/* Page anglaise : les actions de l'entrée, puis trois sections sous la grille */
.gs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.gs-lien { font-size: 15px; color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.gs-lien:hover { text-decoration-color: currentColor; }
.gs-etiquette { margin: 0 0 8px; font-size: 13.5px; font-weight: 560; color: var(--ink-3); }
.gs-section { padding-top: 72px; }
.gs-section h2 { margin: 0; max-width: 32ch; font-size: clamp(26px, 1vw + 18px, 36px); font-weight: 620; letter-spacing: -0.032em; line-height: 1.12; text-wrap: balance; }
.gs-trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; border-top: 1px solid var(--line-2); }
.gs-trois li { padding: 22px 24px 6px 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.gs-trois li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.gs-trois strong { display: block; margin-bottom: 8px; font-size: 18px; font-weight: 620; letter-spacing: -0.02em; color: var(--ink); }
.gs-liste { display: grid; gap: 12px; max-width: 70ch; margin-top: 24px; }
.gs-liste li { position: relative; padding-left: 30px; font-size: 16.5px; line-height: 1.5; color: var(--ink-2); }
.gs-liste li::before { content: ""; position: absolute; left: 3px; top: 0.42em; width: 11px; height: 6px; border-left: 1.8px solid var(--ink); border-bottom: 1.8px solid var(--ink); transform: rotate(-45deg); }
.gs-panneau { padding: 48px; }
.gs-panneau .gs-etiquette { color: rgba(255, 255, 255, 0.7); }
.gs-panneau h2 { color: var(--on-accent); }
.gs-texte { margin: 16px 0 28px; max-width: 64ch; font-size: 16.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.82); }
.gs-texte a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.gs-panneau .gs-lien { color: rgba(255, 255, 255, 0.85); }
@media (max-width: 900px) {
  .gs-trois { grid-template-columns: minmax(0, 1fr); }
  .gs-trois li, .gs-trois li + li { padding: 18px 0 8px; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* Pot de miel : invisible, hors du flux */
.hp-field { position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important; pointer-events: none !important; }

/* Téléphone */
@media (max-width: 640px) {
  .df-onboarding { padding: 24px 16px 8px; }
  .df-onboarding form > .step:not(.df-entree),
  .df-carte,
  .df-entree-colonne { padding: 24px 18px 20px; border-radius: 12px; }
  .gs-section { padding-top: 48px; }
  .gs-panneau { padding: 26px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .checkbox-group.inline { grid-template-columns: minmax(0, 1fr); }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn-primary,
  .step-nav .btn-secondary { width: 100%; }
  .recap dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .recap dt { margin-top: 8px; }
  .recap dt:first-child { margin-top: 0; }
}

/* L'attribut hidden gagne toujours sur les display de cette feuille */
[hidden] { display: none !important; }
