/* Pages légales Unisso — même palette que le portail (contrastes AA vérifiés).
   Sert aussi de base à la page de contact et à l'espace admin. */
:root {
  --fond: #faf9f6; --carte: #ffffff; --encre: #1c1b22; --sourdine: #6b6a75;
  --accent: #4F46E5; --accent-fort: #4338ca; --accent-doux: #eef2ff; --bord: #e8e6df;
  --vert-ok: #0a7d33; --vert-ok-fond: #e8f5ec;
  --ambre: #92600a; --ambre-fond: #faf1de;
  --danger: #b42318; --danger-fond: #fdecea;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-tiroir: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #131217; --carte: #1d1c24; --encre: #f1f0f5; --sourdine: #a3a1af;
    --accent: #8b83f6; --accent-fort: #a39cf8; --accent-doux: #262347; --bord: #2e2c38;
    --vert-ok: #5ed08a; --vert-ok-fond: #16301f;
    --ambre: #e6b566; --ambre-fond: #33270f;
    --danger: #f08b80; --danger-fond: #3a1c1c;
  }
}
* { box-sizing: border-box; margin: 0; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--fond); color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
/* viewport-fit=cover : le contenu se replie hors de l'encoche et de la barre d'accueil */
.page {
  max-width: 760px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
header { padding: calc(28px + env(safe-area-inset-top)) 0 8px; }
.marque {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-weight: 700; font-size: 22px; letter-spacing: -0.5px;
  color: var(--encre); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.marque .point { color: var(--accent); }
main h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -0.8px; margin: 20px 0 6px; text-wrap: balance; }
main .maj { color: var(--sourdine); font-size: 14px; margin-bottom: 28px; }
main h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.3px; margin: 34px 0 10px; }
main h3 { font-size: 16px; margin: 22px 0 6px; }
main p, main li { font-size: 15.5px; }
main p + p { margin-top: 10px; }
main ul { padding-left: 22px; margin: 8px 0; }
main li + li { margin-top: 5px; }
main a { color: var(--accent); }
/* Les tableaux défilent seuls : jamais de défilement horizontal de la page */
main table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14.5px;
}
main th, main td { text-align: left; padding: 8px 10px; border: 1px solid var(--bord); vertical-align: top; min-width: 8em; }
main th { background: var(--carte); }
.encart {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px;
  padding: 16px 18px; margin: 14px 0; font-size: 14.5px;
}
main .encart p, main .encart li { font-size: 14.5px; }
footer {
  margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--bord);
  color: var(--sourdine); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 0 18px;
}
/* Liens du pied de page : cible tactile confortable sans grossir le texte */
footer a { color: var(--sourdine); display: inline-flex; align-items: center; min-height: 40px; }

/* --- Contrôles ------------------------------------------------------------ */
button, a, summary, label, [role="button"] { touch-action: manipulation; }
button, summary, [role="button"], .btn { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none;
  cursor: pointer; background: var(--accent-doux); color: var(--accent);
  transition: transform .15s var(--ease-out), background-color .15s ease, color .15s ease, opacity .15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.principal { background: var(--accent); color: #fff; }
.btn.contour { background: var(--carte); border-color: var(--bord); color: var(--encre); }
.btn.danger { background: var(--danger-fond); color: var(--danger); }
.btn.danger.arme { background: var(--danger); color: #fff; }
.btn.petit { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.icone { width: 44px; padding: 0; flex: none; font-size: 17px; }
@media (hover: hover) and (pointer: fine) {
  .btn.principal:hover { background: var(--accent-fort); }
  .btn.contour:hover, .btn:not(.principal):not(.danger):hover { filter: brightness(0.97); }
  .btn.danger:hover { filter: brightness(0.95); }
}
@media (prefers-color-scheme: dark) { .btn.principal, .btn.danger.arme { color: #131217; } }

.champ {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin-top: 6px;
  border: 1px solid color-mix(in srgb, var(--bord), var(--encre) 10%); border-radius: 10px;
  background: var(--carte); color: var(--encre); font: inherit; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.champ:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
textarea.champ { min-height: 120px; resize: vertical; }
/* iOS zoome sur tout champ sous 16 px : 16 px sur écran tactile */
@media (pointer: coarse) { input, select, textarea, .champ { font-size: 16px; } }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; flex: none; }

/* --- Panneau d'édition : <dialog> natif, en bas sur mobile, centré sinon ---- */
dialog.panneau {
  margin: auto 0 0; width: 100%; max-width: none; max-height: 92dvh;
  padding: 0; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--bord); border-radius: 24px 24px 0 0;
  background: var(--carte); color: var(--encre);
  box-shadow: 0 12px 40px -8px rgb(0 0 0 / .28);
  opacity: 1; transform: none;
  transition: transform 320ms var(--ease-tiroir), opacity 200ms ease,
    overlay 320ms allow-discrete, display 320ms allow-discrete;
}
dialog.panneau:not([open]) { opacity: 0; transform: translateY(100%); }
@starting-style { dialog.panneau[open] { opacity: 0; transform: translateY(100%); } }
dialog.panneau::backdrop {
  background: rgb(0 0 0 / .45);
  transition: opacity 250ms ease, overlay 320ms allow-discrete, display 320ms allow-discrete;
}
dialog.panneau:not([open])::backdrop { opacity: 0; }
@starting-style { dialog.panneau[open]::backdrop { opacity: 0; } }
@media (min-width: 640px) {
  dialog.panneau { margin: auto; max-width: 560px; border-radius: 24px; }
  dialog.panneau:not([open]) { transform: translateY(12px) scale(.97); }
  @starting-style { dialog.panneau[open] { transform: translateY(12px) scale(.97); } }
}
.panneau .interieur { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .panneau .interieur { padding: 22px 24px 24px; } }
.panneau .poignee { width: 40px; height: 5px; border-radius: 99px; background: var(--bord); margin: 0 auto 10px; }
@media (min-width: 640px) { .panneau .poignee { display: none; } }
.panneau .titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panneau .titre h2 { margin: 0; font-size: 20px; }
.panneau .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.panneau .actions .btn { width: 100%; }
@media (min-width: 640px) {
  .panneau .actions { flex-direction: row-reverse; justify-content: space-between; }
  .panneau .actions .btn { width: auto; }
}

/* --- Entrée douce du contenu (animation-fill-mode: backwards, jamais both) - */
@keyframes monte { from { opacity: 0; transform: translateY(6px); } }
.monte > * { animation: monte 360ms var(--ease-out) backwards; }
.monte > :nth-child(2) { animation-delay: 30ms; }
.monte > :nth-child(3) { animation-delay: 60ms; }
.monte > :nth-child(4) { animation-delay: 90ms; }
.monte > :nth-child(n + 5) { animation-delay: 120ms; }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
::selection { background: var(--accent-doux); }

/* --- Habillage des pages publiques (body.legal) : polices et ambiance de
   l'accueil. Limité à .legal pour ne rien changer à l'espace admin. -------- */
@font-face {
  font-family: "Jakarta"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument"; font-style: italic; font-display: swap; font-weight: 400;
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}
:root {
  --chaud-doux: #fbeedf;
  --ombre-carte: 0 1px 2px rgb(28 27 34 / .04), 0 4px 16px -6px rgb(28 27 34 / .1);
  --serif: "Instrument", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --chaud-doux: #33261a; --ombre-carte: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px -6px rgb(0 0 0 / .5); }
}
.legal {
  font-family: "Jakarta", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(55% 380px at 88% -60px, var(--accent-doux), transparent 70%),
    radial-gradient(40% 320px at 0% -40px, var(--chaud-doux), transparent 70%),
    var(--fond);
  background-repeat: no-repeat;
}
.legal .marque { font-family: var(--serif); font-weight: 400; font-size: 30px; }
.legal main h1 {
  font-size: clamp(36px, 7vw, 54px); font-weight: 800; letter-spacing: -0.035em;
  line-height: 1.05; margin: 40px 0 14px;
}
.legal main h1 em { font-family: var(--serif); font-weight: 400; font-size: 1.1em; color: var(--accent); letter-spacing: -0.01em; }
.legal main h1 + .maj { font-size: 15.5px; max-width: 60ch; margin-bottom: 36px; }
.legal main h2 {
  font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
  margin: 56px 0 14px; padding-top: 24px; border-top: 1px solid var(--bord);
  scroll-margin-top: 16px;
}
.legal main h2 .num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 10px;
  border-radius: 10px; background: var(--accent-doux); color: var(--accent);
  font-size: 15px; vertical-align: 2px;
}
.legal main h3 { font-size: 17px; font-weight: 700; margin-top: 26px; }
.legal main a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.legal .encart { border-radius: 20px; padding: 20px 22px; margin: 20px 0; box-shadow: var(--ombre-carte); }
.legal .encart.accent { background: var(--accent-doux); border-color: transparent; box-shadow: none; }
.legal main table {
  border-collapse: separate; border-spacing: 0; border: 1px solid var(--bord);
  border-radius: 16px; background: var(--carte); box-shadow: var(--ombre-carte); margin: 18px 0;
}
.legal main th, .legal main td { border: 0; border-bottom: 1px solid var(--bord); padding: 12px 14px; }
.legal main tr:last-child > * { border-bottom: 0; }
.legal main th { background: none; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--sourdine); }
.legal main td:first-child { font-weight: 700; }

/* Listes à pastilles : ✓ ce qui est fait, ! ce qui manque */
.legal ul.coches, .legal ul.manques { list-style: none; padding-left: 0; }
.legal ul.coches li, .legal ul.manques li { position: relative; padding-left: 36px; }
.legal ul.coches li + li, .legal ul.manques li + li { margin-top: 12px; }
.legal ul.coches li::before, .legal ul.manques li::before {
  position: absolute; left: 0; top: .15em; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; line-height: 1;
}
.legal ul.coches li::before { content: "✓"; background: var(--vert-ok-fond); color: var(--vert-ok); }
.legal ul.manques li::before { content: "!"; background: var(--ambre-fond); color: var(--ambre); }

/* Trois cartes « réponse rapide » */
.legal .trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 8px 0 28px; }
.legal .trio > div {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 20px;
  padding: 18px 20px 20px; box-shadow: var(--ombre-carte);
}
.legal main .trio p { font-size: 14.5px; }
.legal .trio .q { font-family: var(--serif); font-style: italic; font-size: 25px; line-height: 1.15; color: var(--accent); margin-bottom: 8px; }

/* Sommaire en pastilles */
.legal .sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.legal main .sommaire a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--bord); border-radius: 999px; background: var(--carte);
  color: var(--encre); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .legal main .sommaire a:hover { border-color: var(--accent); color: var(--accent); } }
.legal footer { margin-top: 64px; }
/* Cartes plus larges (une par application) */
.legal .trio.large { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.legal main .trio h3 { margin-top: 0; }
.legal main .trio ul { padding-left: 18px; }
.legal main .trio li { font-size: 14.5px; }
/* Liste d'interdits : ✕ rouge */
.legal ul.interdits { list-style: none; padding-left: 0; }
.legal ul.interdits li { position: relative; padding-left: 36px; }
.legal ul.interdits li + li { margin-top: 12px; }
.legal ul.interdits li::before {
  content: "✕"; position: absolute; left: 0; top: .15em; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; line-height: 1;
  background: var(--danger-fond); color: var(--danger);
}
