/* =========================================================
   Bilan de competences - feuille de style principale.

   MARQUE BLANCHE
   Les valeurs de :root ci-dessous ne sont que la charte de secours.
   En fonctionnement normal elles sont ecrasees par le bloc <style id="charte">
   injecte dans chaque page (views/partials/theme.ejs), genere a partir des
   reglages de /admin/apparence par src/services/branding.js.
   => Pour changer les couleurs d'un site, passer par l'administration et non
      par ce fichier. N'ajoutez ici aucune couleur en dur : utilisez toujours
      une variable, sinon elle echappera au parametrage.
   ========================================================= */
:root {
  --brand: #0e2a47;
  --brand-dark: #081b2f;
  --brand-light: #17416c;
  --accent: #1a8374;
  --accent-dark: #146559;
  --ink: #12202e;
  --muted: #5b6b7c;
  --line: #dfe6ee;
  --bg: #ffffff;
  --bg-soft: #f4f7fa;
  --bg-brand-soft: #eef4fa;
  --ok: #197b49;
  --ok-bg: #e7f6ee;
  --warn: #a8590a;
  --warn-bg: #fdf1e0;
  --err: #b3261e;
  --err-bg: #fdecea;
  --signature-paper: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 38, 63, .06), 0 8px 24px rgba(16, 38, 63, .07);
  --maxw: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Jetons derives automatiquement de la charte (voir branding.js).
     Certains dependent du SENS de la palette : sur un theme sombre, --surface
     est plus clair que --bg (les cartes se detachent), et --panel-bg devient un
     bandeau attenue au lieu d'un aplat de la couleur principale. */
  color-scheme: light;
  --surface: #ffffff;
  --line-strong: #c3cfdb;
  --brand-text: #ffffff;
  --brand-text-soft: #c6d5e3;
  --header-bg: #ffffff;
  --header-text: #12202e;
  --header-muted: #5b6b7c;
  --header-hover-bg: #eef4fa;
  --header-active-bg: #e3ecf5;
  --header-border: #dfe6ee;
  --header-position: sticky;
  --hero-from: #0e2a47;
  --hero-to: #081b2f;
  --hero-text: #ffffff;
  --hero-text-soft: #cfdce8;
  --footer-bg: #081b2f;
  --footer-text: #a9bece;
  --footer-heading: #ffffff;
  --footer-link: #cddced;
  --panel-bg: #0e2a47;
  --panel-text: #ffffff;
  --panel-text-soft: #bccfe0;
  --panel-veil: rgba(255, 255, 255, .12);
  --panel-veil-strong: rgba(255, 255, 255, .22);
  --hero-veil: rgba(255, 255, 255, .08);
  --hero-veil-strong: rgba(255, 255, 255, .18);
  --hero-veil-line: rgba(255, 255, 255, .22);
  --footer-veil: rgba(255, 255, 255, .14);
  --ok-line: #b7e2c9;
  --warn-line: #f0c36d;
  --err-line: #f3c3bf;
  --btn-text: #ffffff;
  --btn-radius: 999px;
  --btn-shadow: rgba(31, 157, 139, .28);
}

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

/*
  L'attribut `hidden` du HTML ne pose qu'un `display: none` de faible priorite :
  la moindre regle `display: flex` d'un composant l'annule, et l'element reste
  visible alors que le JavaScript le croit masque. On lui redonne le dernier mot.
*/
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; color: var(--brand); margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-light); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
small { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 820px; }
.section { padding: 4rem 0; }
.section-soft { background: var(--bg-soft); }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
/* Texte reserve aux lecteurs d'ecran : precise ce qu'une pastille chiffree compte. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius-sm); }

/* ---------- En-tete ---------- */
.site-header { position: var(--header-position); top: 0; z-index: 40; background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 74px; }
.logo { display: flex; align-items: center; gap: .65rem; font-weight: 800; color: var(--header-text); text-decoration: none; font-size: 1.1rem; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: var(--brand-text); display: grid; place-items: center; font-size: .95rem; font-weight: 800; }
.logo small { display: block; font-size: .7rem; font-weight: 500; color: var(--header-muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--header-text); text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius-sm); font-size: .94rem; font-weight: 500; }
.nav a:hover { background: var(--header-hover-bg); color: var(--header-text); }
.nav a.active { color: var(--header-text); background: var(--header-active-bg); font-weight: 600; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--btn-text); }
.nav-toggle { display: none; margin-left: auto; background: none; color: var(--header-text); border: 1px solid var(--header-border); border-radius: var(--radius-sm); padding: .5rem .7rem; font-size: 1.1rem; cursor: pointer; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.3rem; border-radius: var(--btn-radius); border: 1px solid transparent; font-weight: 600; font-size: .97rem; text-decoration: none; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; font-family: inherit; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--btn-text); box-shadow: 0 6px 16px var(--btn-shadow); }
.btn-primary:hover { background: var(--accent-dark); color: var(--btn-text); }
.btn-dark { background: var(--panel-bg); color: var(--panel-text); }
.btn-dark:hover { background: var(--panel-bg); filter: brightness(1.12); color: var(--panel-text); }
.btn-ghost { border-color: var(--line); color: var(--brand); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: var(--hero-veil-strong); color: var(--hero-text); border-color: var(--hero-veil-line); }
.btn-light:hover { background: var(--hero-veil-strong); border-color: var(--hero-text); color: var(--hero-text); }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%); color: var(--hero-text); padding: 4.5rem 0 4rem; }
.hero h1 { color: var(--hero-text); max-width: 16ch; }
.hero p { color: var(--hero-text-soft); font-size: 1.12rem; max-width: 58ch; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-badges { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--hero-veil-line); font-size: .88rem; color: var(--hero-text-soft); }
.hero-card { background: var(--hero-veil); border: 1px solid var(--hero-veil-line); border-radius: 16px; padding: 1.75rem; }
.hero-card h3 { color: var(--hero-text); font-size: 1.05rem; }
.hero-card ol { margin: 0; padding-left: 1.1rem; color: var(--hero-text-soft); font-size: .95rem; }
.hero-card li { margin-bottom: .55rem; }

/* ---------- Cartes / grilles ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card-flat { box-shadow: none; }

.phase-card { position: relative; padding-top: 2.2rem; }
.phase-num { position: absolute; top: -14px; left: 1.6rem; background: var(--accent); color: var(--btn-text); font-weight: 700; font-size: .82rem; padding: .28rem .8rem; border-radius: 999px; letter-spacing: .06em; }
.phase-card ul { margin: .9rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .95rem; }
.phase-card li { margin-bottom: .4rem; }
.phase-duree { font-size: .85rem; color: var(--accent-dark); font-weight: 600; }

.stat { text-align: center; padding: 1.6rem 1rem; }
.stat-value { font-size: 2.2rem; font-weight: 800; color: var(--accent-dark); line-height: 1; }
.stat-label { font-weight: 600; margin-top: .5rem; color: var(--brand); }
.stat-detail { font-size: .85rem; color: var(--muted); }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.8rem; margin-bottom: .6rem; }
.check-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.price-box { border: 2px solid var(--accent); border-radius: var(--radius); padding: 2rem; background: var(--surface); }
.price-amount { font-size: 2.6rem; font-weight: 800; color: var(--brand); line-height: 1; }

/* ---------- FAQ ---------- */
details.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: .8rem; background: var(--surface); }
details.faq-item summary { font-weight: 600; color: var(--brand); cursor: pointer; }
details.faq-item[open] summary { margin-bottom: .7rem; }

/* ---------- CTA ---------- */
.cta { background: var(--panel-bg); color: var(--panel-text); border-radius: 16px; padding: 2.6rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta h2 { color: var(--panel-text); margin-bottom: .3rem; }
.cta p { color: var(--panel-text-soft); margin: 0; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field-full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: .93rem; color: var(--brand); }
/* Tous les champs de saisie partagent la meme presentation. La liste des types
   etait enumeree, ce qui laissait de cote `time`, `url`, `search` ou tout type
   ajoute plus tard : on exclut plutot les rares types a l'apparence propre. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="image"]):not([type="hidden"]),
select, textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
/* Asterisque des champs obligatoires : meme signal partout, legende comprise. */
.req { color: var(--err); font-weight: 700; }

.field-hint { font-size: .84rem; color: var(--muted); font-weight: 400; }
.checkbox { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; font-size: .93rem; color: var(--ink); }
.checkbox input { margin-top: .25rem; }
.honeypot { position: absolute; left: -9999px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 600; color: var(--brand); padding: 0 .4rem; font-size: .95rem; }
.radio-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.radio-row label { font-weight: 400; display: flex; align-items: center; gap: .35rem; }
.scale { display: flex; gap: .5rem; flex-wrap: wrap; }
.scale label { display: flex; flex-direction: column; align-items: center; gap: .2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .9rem; cursor: pointer; font-weight: 500; }
.scale input { margin: 0; }
.form-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

/* ---------- Alertes ----------
   Les couleurs de statut (succes / avertissement / erreur) restent volontairement
   fixes : ce sont des signaux dont le sens ne doit pas dependre de la marque.
   Seule l'alerte d'information suit la charte.                              */
.alert { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-size: .95rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.alert-info { background: var(--bg-brand-soft); color: var(--brand); border-color: var(--line-strong); }
.alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg-brand-soft); color: var(--brand-light); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-muted { background: var(--bg-soft); color: var(--muted); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }

/* ---------- Espace / administration ---------- */
.app-header { background: var(--panel-bg); color: var(--panel-text); padding: 2.2rem 0; }
.app-header h1 { color: var(--panel-text); margin-bottom: .2rem; font-size: 1.8rem; }
.app-header p { color: var(--panel-text-soft); margin: 0; }
.app-header-note { color: var(--panel-text-soft); }
.app-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1.2rem; }
.app-nav a { color: var(--panel-text); text-decoration: none; padding: .4rem .9rem; border-radius: 999px; font-size: .9rem; background: var(--panel-veil); }
.app-nav a:hover, .app-nav a.active { background: var(--panel-text); color: var(--panel-bg); }

.progress { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.3rem 1.7rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.done::before { background: var(--accent); }

.answer-block { border-left: 3px solid var(--line); padding-left: 1rem; margin-bottom: 1.1rem; }
.answer-block .q { font-weight: 600; color: var(--brand); font-size: .92rem; }
.answer-block .a { white-space: pre-wrap; color: var(--ink); }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 3rem 0 1.5rem; margin-top: 4rem; font-size: .92rem; }
.site-footer h4 { color: var(--footer-heading); font-size: .95rem; margin-bottom: .8rem; }
.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { color: var(--footer-heading); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }

/* Reseaux sociaux du pied de page (views/partials/reseaux.ejs).
   La rubrique n'est rendue que si au moins une adresse est renseignee dans
   /admin/apparence : il n'y a donc jamais d'icone morte. */
.reseaux { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.reseau-lien {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--footer-veil);
  border-radius: 50%;
  color: var(--footer-link);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.reseau-lien svg { width: 1.15rem; height: 1.15rem; display: block; }
.reseau-lien:hover,
.reseau-lien:focus-visible {
  color: var(--footer-heading);
  border-color: var(--footer-heading);
  background: var(--footer-veil);
  text-decoration: none;
}
.footer-grid li { margin-bottom: .45rem; }
.footer-bottom { border-top: 1px solid var(--footer-veil); margin-top: 2.2rem; padding-top: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }

/* ---------- Impression ---------- */
@media print {
  /* Un theme sombre a l'ecran doit rester imprimable : on repasse la page en
     clair, quelles que soient les couleurs choisies dans /admin/apparence. */
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --bg-soft: #f4f7fa;
    --ink: #000000;
    --muted: #444444;
    --line: #cccccc;
  }
  .site-header, .site-footer, .no-print, .app-nav { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .container { max-width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .grid-2, .grid-3, .footer-grid, .form-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 1rem; }
  .nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; min-height: 64px; }
  .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 2.8rem 0; }
  .cta { padding: 1.8rem; }
}

/* ---------- Complements : parcours d'inscription, livrets, dossier ---------- */
.logo-img { display: block; }
.nav-form { display: inline-flex; margin: 0; }
.mt-1 { margin-top: .5rem; }
.field-label { display: block; font-weight: 600; margin-bottom: .4rem; }

.alert-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.alert-warn .btn { margin-left: .6rem; }

/* Etapes numerotees de la page d'accueil */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.4rem;
}
.steps li h3 { font-size: 1.02rem; margin: .6rem 0 .4rem; }
.steps-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 700;
  font-size: .9rem;
}

/* Cartes de livrets (espace beneficiaire) */
.lv-cards {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.lv-card-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.lv-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }

/* Champs radio riches du formulaire de demande */
.radio-row {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  cursor: pointer;
}
.radio-row:hover { border-color: var(--brand); }
.radio-row span strong { display: block; }
.radio-row span .muted { font-size: .9rem; }


/* =========================================================
   Administration > Apparence (marque blanche)
   Le panneau utilise la charte du site ; l'apercu, lui, est isole dans ses
   propres variables --pv-* pilotees par public/js/admin-branding.js, pour
   simuler une charte differente de celle actuellement appliquee.
   ========================================================= */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: start; }
.brand-group { margin-bottom: 1.6rem; }
.brand-group legend { font-size: 1.05rem; }
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; margin-top: .8rem; }
.brand-badge { margin-left: .4rem; font-weight: 600; text-transform: none; }
.brand-actions { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 1rem 0; margin-top: 1rem; z-index: 5; }

.brand-color { display: flex; align-items: center; gap: .4rem; }
.brand-color input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
.brand-color input[type="text"] { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; text-transform: lowercase; min-width: 0; }
.brand-color .btn { flex: none; }

.brand-number { display: flex; align-items: center; gap: .5rem; }
.brand-number input { max-width: 120px; }

.brand-image { display: flex; gap: 1rem; align-items: flex-start; }
.brand-image-preview { flex: none; width: 96px; height: 96px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); padding: .5rem; }
.brand-image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-image-actions { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.brand-image-actions code { word-break: break-all; font-size: .8rem; }

/* ------------------------------- apercu ------------------------------- */
.brand-preview { position: sticky; top: 90px; }
.pv-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: var(--pv-font);
  background: var(--pv-bg);
  color: var(--pv-ink);
  font-size: .9rem;
  line-height: 1.5;
}
.pv-header { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; background: var(--pv-header-bg); color: var(--pv-header-text); border-bottom: 1px solid var(--pv-header-border); }
.pv-logo { flex: none; display: grid; place-items: center; }
.pv-logo img { height: var(--pv-logo-height); width: auto; max-width: 80px; object-fit: contain; }
.pv-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pv-name strong { font-size: .95rem; }
.pv-name small { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pv-header-muted); }
.pv-nav { margin-left: auto; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.pv-link { font-size: .78rem; padding: .25rem .5rem; border-radius: 6px; }
.pv-link-active { background: var(--pv-header-active-bg); font-weight: 600; }
.pv-btn { display: inline-block; font-size: .76rem; font-weight: 600; padding: .35rem .8rem; border-radius: var(--pv-btn-radius); background: var(--pv-accent); color: var(--pv-btn-text); box-shadow: 0 4px 12px var(--pv-btn-shadow); }
.pv-btn-light { background: var(--pv-hero-veil); color: var(--pv-hero-text); box-shadow: none; border: 1px solid var(--pv-hero-veil-line); }

.pv-hero { background: linear-gradient(160deg, var(--pv-hero-from) 0%, var(--pv-hero-to) 100%); color: var(--pv-hero-text); padding: 1.4rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.pv-hero strong { font-size: 1.1rem; line-height: 1.2; }
.pv-hero > span { color: var(--pv-hero-text-soft); font-size: .82rem; }
.pv-hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }

.pv-body { padding: 1.1rem; display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-card { border: 1px solid var(--pv-line); border-radius: var(--pv-radius); padding: .8rem; background: var(--pv-surface); display: flex; flex-direction: column; gap: .3rem; }
.pv-card strong { color: var(--pv-brand); font-size: .85rem; }
.pv-card span { color: var(--pv-muted); font-size: .78rem; }
.pv-card-soft { background: var(--pv-bg-soft); }
.pv-progress { display: block; height: 6px; border-radius: 999px; background: var(--pv-bg-soft); overflow: hidden; margin-top: .3rem; }
.pv-progress i { display: block; width: 62%; height: 100%; background: var(--pv-accent); }

.pv-panel { background: var(--pv-panel-bg); color: var(--pv-panel-text); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; }
.pv-panel strong { font-size: .9rem; }
.pv-panel span { color: var(--pv-panel-text-soft); }

.pv-footer { background: var(--pv-footer-bg); color: var(--pv-footer-text); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; }
.pv-footer strong { color: var(--pv-footer-heading); font-size: .85rem; }

@media (max-width: 1080px) {
  .brand-layout { grid-template-columns: 1fr; }
  .brand-preview { position: static; }
}
@media (max-width: 760px) {
  .brand-grid { grid-template-columns: 1fr; }
  .brand-image { flex-direction: column; }
  .pv-body { grid-template-columns: 1fr; }
}

/* ---------- Module beta : inventaire de personnalite ---------- */
.psy-beta { border-left: 4px solid var(--warn-line); }

.psy-dim { margin-bottom: 1.4rem; }
.psy-dim-compact { margin-bottom: 1rem; }
.psy-dim-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.psy-dim-head strong { font-size: .98rem; }

.psy-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--line) 50%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
}
.psy-bar-zone-mid {
  position: absolute;
  left: 40%;
  width: 20%;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .05);
}
.psy-bar-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 999px;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transform: translateY(-50%);
}
.psy-dim-poles {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .82rem;
  color: var(--muted);
  margin-top: .35rem;
}
.psy-dim-poles span:last-child { text-align: right; }
.psy-dim-comment { margin: .7rem 0 0; font-size: .93rem; }

/* Passation */
.psy-item { margin-bottom: 1rem; padding-top: .9rem; border-left: 3px solid transparent; }
.psy-item-done { border-left-color: var(--accent); }
.psy-item-missing { border-left-color: var(--err); }
.psy-item-num { font-size: .8rem; color: var(--muted); padding: 0 .4rem; }
.psy-item-text { font-size: 1.02rem; margin: 0 0 .9rem; }

.psy-scale { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.psy-choice {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
}
.psy-choice:hover { border-color: var(--brand); }
.psy-choice input { margin: 0; }
.psy-choice:has(input:checked) { border-color: var(--brand); background: var(--bg-soft); font-weight: 600; }

.psy-row-facette td:first-child { padding-left: 1.6rem; color: var(--muted); }
.psy-row-domaine td { border-top: 2px solid var(--line); }


/* Cartes de selection du theme (Clair / Sombre / Conseil) */
.brand-presets { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: .3rem 0 .6rem; }
.brand-preset { display: flex; gap: .7rem; align-items: flex-start; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .7rem; cursor: pointer; font-weight: 400; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.brand-preset:hover { border-color: var(--brand); }
.brand-preset.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--btn-shadow); }
.brand-preset input { position: absolute; opacity: 0; width: 0; height: 0; }
.brand-preset:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-preset-swatch { position: relative; flex: none; width: 54px; height: 54px; border-radius: var(--radius-sm); border: 1px solid var(--line); overflow: hidden; display: block; }
.brand-preset-swatch b { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.brand-preset-swatch i { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; border-radius: 999px; }
.brand-preset-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.brand-preset-body strong { color: var(--brand); font-size: .95rem; }


/* =========================================================
   Liste des comptes (/admin/utilisateurs)
   Le role doit se lire d'un coup d'oeil : trois pastilles contrastees, du plus
   au moins privilegie. Les couleurs viennent de la charte : elles suivent le
   theme clair, sombre ou conseil.
   ========================================================= */
.badge-role { font-weight: 700; letter-spacing: .01em; }
.badge-role-admin { background: var(--panel-bg); color: var(--panel-text); }
.badge-role-consultant { background: var(--bg-brand-soft); color: var(--brand); border: 1px solid var(--line-strong); }
.badge-role-beneficiaire { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }

/* Barre de filtres et de recherche */
.us-barre { display: flex; gap: 1rem; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.us-onglets { display: flex; gap: .3rem; flex-wrap: wrap; }
.us-onglet {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
}
.us-onglet:hover { border-color: var(--brand); color: var(--brand); }
.us-onglet.is-actif { background: var(--brand); border-color: var(--brand); color: var(--brand-text); font-weight: 600; }
.us-onglet-n { font-size: .78rem; opacity: .75; font-variant-numeric: tabular-nums; }
.us-onglet.is-actif .us-onglet-n { opacity: .9; }

.us-recherche { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.us-recherche input[type="search"] {
  width: auto;
  min-width: 190px;
  padding: .4rem .7rem;
  font-size: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

/* Tableau */
.us-table td, .us-table th { vertical-align: top; }
.us-table tbody th { font-weight: 400; text-align: left; background: none; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; }
.us-compte { display: table-cell; min-width: 220px; }
.us-nom { display: block; font-weight: 700; color: var(--brand); }
.us-email { display: block; font-size: .88rem; color: var(--muted); text-decoration: none; word-break: break-all; }
.us-email:hover { color: var(--brand); text-decoration: underline; }
.us-meta { display: block; font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.us-responsable { font-weight: 600; }

/* Le role, la mention d'assistance et le selecteur s'empilent : cote a cote
   ils se touchaient et se lisaient mal. */
.us-role-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; min-width: 190px; }
.us-role-cell .badge { margin: 0; }

.us-role-form { display: flex; gap: .4rem; align-items: center; margin: 0; flex-wrap: wrap; }
.us-role-form select { max-width: 170px; padding: .35rem .5rem; font-size: .85rem; }

.us-actions { white-space: nowrap; }
.us-actions form { margin-bottom: .35rem; }
.us-actions form:last-child { margin-bottom: 0; }

/* Rappel des roles, cote formulaire de creation */
.us-roles { margin: 0; }
.us-roles dt { margin-top: .8rem; }
.us-roles dt:first-child { margin-top: 0; }
.us-roles dd { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }

@media (max-width: 1100px) {
  .us-barre { flex-direction: column; align-items: stretch; }
  .us-recherche input[type="search"] { flex: 1; min-width: 0; }
}


/* Invitation directe d'un beneficiaire (/admin/demandes) : repliee par defaut,
   pour ne pas concurrencer la liste des demandes. */
.inviter { margin-bottom: 1.5rem; }
.inviter > summary { cursor: pointer; color: var(--brand); }
.inviter[open] > summary { margin-bottom: .4rem; }


/* Champ « duree » : trois cases chiffrees sous un seul libelle
   (anciennete dans le poste, duree d'experience). */
.duree { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.duree-case { display: flex; flex-direction: column-reverse; gap: .15rem; }
.duree-case input { width: 5.5rem; text-align: right; }
.duree-case label { font-size: .8rem; font-weight: 500; color: var(--muted); }
