:root {
  --jaune: #ffcc00;
  --jaune-vif: #ffb300;
  --jaune-pale: #fff6cc;
  --ambre: #8a6a00;          /* texte d'accent lisible sur fond clair */
  --noir: #16130d;
  --encre: #2a261d;
  --gris-600: #5f5a4e;
  --gris-300: #e6e1d3;
  --gris-100: #f6f3ea;
  --fond: #faf8f2;
  --blanc: #ffffff;
  --vert: #1d7a46;
  --rouge: #b3261e;
  --bleu: #22509e;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(22, 19, 13, .06), 0 8px 24px rgba(22, 19, 13, .06);
  --police: "Montserrat", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Le bandeau d'accueil pleine largeur (100vw) inclut la barre de défilement : on coupe le débordement sans casser la barre collante */
html { overflow-x: clip; }
body { font-family: var(--police); color: var(--noir); background: var(--fond); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ambre); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-decoration-color: var(--jaune); text-decoration-thickness: 2px; text-underline-offset: 3px; }
code { font-family: var(--mono); background: var(--gris-100); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--gris-600); }
.petit { font-size: .82em; }
.inline { display: inline; }
h1, h2, h3 { letter-spacing: -.01em; }

/* ---------- Barre du haut ---------- */
.barre { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); color: var(--noir);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; height: 68px; box-shadow: 0 1px 0 var(--gris-300); }
.logo { color: var(--noir); display: flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.logo-img { height: 42px; width: 42px; }
.logo-mark { font-weight: 900; letter-spacing: .1em; font-size: 1.3rem; }
.logo-sub { text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; font-weight: 700; color: var(--noir); background: var(--jaune); padding: 2px 8px; border-radius: 999px; }
.barre nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.barre nav a { color: var(--encre); font-size: .9rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; }
.barre nav a:hover { background: var(--jaune-pale); text-decoration: none; }
.barre nav a.btn { color: var(--noir); }
.lien { background: none; border: 0; padding: 0; color: var(--ambre); font: inherit; font-weight: 600; cursor: pointer; }
.barre .lien { color: var(--encre); padding: 7px 12px; border-radius: 999px; }
.barre .lien:hover { background: var(--jaune-pale); }

.contenu { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.pied { background: var(--noir); color: #cfc9b8; font-size: .82rem; padding: 22px 32px; display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--jaune); }
.pied strong { color: var(--jaune); letter-spacing: .08em; }
.pied a { color: var(--blanc); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--jaune); color: var(--noir); padding: 12px 22px;
  border-radius: 999px; border: 2px solid var(--jaune); cursor: pointer; font: inherit; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 2px 0 var(--jaune-vif); transition: transform .08s ease, background .15s ease; }
.btn:hover { background: var(--jaune-vif); border-color: var(--jaune-vif); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-secondaire { background: transparent; color: var(--noir); border-color: var(--noir); box-shadow: none; }
.btn-secondaire:hover { background: var(--noir); color: var(--jaune); border-color: var(--noir); }
.btn-small { padding: 7px 15px; font-size: .88rem; }

/* ---------- Accueil ---------- */
.hero { position: relative; overflow: hidden; margin: -32px calc(50% - 50vw) 0; padding: 72px calc(50vw - 50% + 24px) 80px;
  background: radial-gradient(circle at 85% 30%, rgba(255, 204, 0, .35), rgba(255, 204, 0, 0) 45%), var(--noir); color: var(--blanc); }
.hero-grille { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-soleil { width: 100%; max-width: 340px; justify-self: center; filter: drop-shadow(0 0 40px rgba(255, 204, 0, .35)); animation: tourne 60s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-soleil { animation: none; } }
.surtitre { display: inline-block; text-transform: uppercase; letter-spacing: .22em; font-size: .74rem; color: var(--noir); background: var(--jaune);
  font-weight: 800; margin: 0 0 18px; padding: 4px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 0 0 20px; font-weight: 900; }
.hero h1 em { font-style: normal; color: var(--jaune); }
.chapeau { font-size: 1.12rem; color: #d9d3c2; margin: 0 0 28px; max-width: 620px; }
.hero .btn-secondaire { color: var(--blanc); border-color: rgba(255, 255, 255, .6); }
.hero .btn-secondaire:hover { background: var(--blanc); color: var(--noir); border-color: var(--blanc); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 40px 0 28px; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.carte { background: var(--blanc); border: 1px solid var(--gris-300); border-radius: var(--rayon); padding: 22px 24px; box-shadow: var(--ombre); }
.carte h3 { margin: 0 0 8px; font-size: 1.05rem; }
.carte p { margin: 0 0 8px; }
.grille-3 .carte { border-top: 5px solid var(--jaune); }
.pictogramme { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--jaune-pale); color: var(--ambre);
  font-weight: 900; font-size: 1.2rem; margin-bottom: 12px; }
.bandeau-info { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--jaune);
  padding: 26px 30px; border-radius: var(--rayon); margin-top: 12px; }
.bandeau-info h2 { margin: 0 0 4px; font-size: 1.3rem; }
.bandeau-info p { margin: 0; }
.bandeau-info a:not(.btn) { color: var(--noir); text-decoration: underline; }
.bandeau-info .btn { background: var(--noir); color: var(--jaune); border-color: var(--noir); box-shadow: none; }
.bandeau-info .btn:hover { background: var(--encre); }

/* ---------- Formulaires ---------- */
.boite-login { max-width: 420px; margin: 48px auto; background: var(--blanc); border: 1px solid var(--gris-300); border-top: 6px solid var(--jaune);
  border-radius: var(--rayon); padding: 34px; box-shadow: var(--ombre); }
.boite-login h1 { margin: 0 0 4px; }
.formulaire { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .88rem; }
.formulaire input:not([type=radio]):not([type=checkbox]), .formulaire select, .formulaire textarea {
  padding: 11px 13px; border: 1.5px solid var(--gris-300); border-radius: 10px; font: inherit; font-weight: 500; background: var(--blanc); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jaune-vif) !important; box-shadow: 0 0 0 3px rgba(255, 204, 0, .35); }
.alerte { background: #fbe9e7; color: var(--rouge); padding: 11px 14px; border-radius: 10px; margin-top: 14px; font-size: .9rem; font-weight: 600; }
.alerte-erreur { background: #fbe9e7; color: var(--rouge); }
.alerte-ok { background: #e4f3ea; color: var(--vert); }
.alerte-info { background: var(--jaune-pale); color: var(--ambre); }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.formulaire-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.formulaire-inline label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 700; }
.formulaire-inline input, .formulaire-inline select, .formulaire-inline textarea { padding: 8px 11px; border: 1.5px solid var(--gris-300); border-radius: 10px; font: inherit; }

.boite-formulaire { max-width: 740px; margin: 36px auto; background: var(--blanc); border: 1px solid var(--gris-300); border-top: 6px solid var(--jaune);
  border-radius: var(--rayon); padding: 34px; box-shadow: var(--ombre); }
.boite-formulaire h1 { margin: 0 0 4px; }
.champs-pro[hidden] { display: none; }
.choix-type { border: 0; padding: 0; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.choix-type legend { font-weight: 700; font-size: .88rem; margin-bottom: 8px; }
.formulaire .choix { flex-direction: row; align-items: center; gap: 10px; border: 2px solid var(--gris-300); border-radius: 999px; padding: 10px 18px; cursor: pointer; }
.formulaire .choix input { accent-color: var(--noir); }
.formulaire .choix:has(input:checked) { border-color: var(--noir); background: var(--jaune); }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Espace admin ---------- */
.entete-page { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.entete-page h1 { margin: 0; font-size: 1.8rem; font-weight: 900; }
.entete-page h1::after { content: ""; display: block; width: 48px; height: 5px; border-radius: 3px; background: var(--jaune); margin-top: 6px; }
.entete-page p { margin: 6px 0 0; }
.filtres { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--blanc); border: 1px solid var(--gris-300); border-radius: var(--rayon);
  padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--ombre); }
.filtres label { display: flex; flex-direction: column; gap: 4px; font-size: .76rem; font-weight: 700; color: var(--gris-600); text-transform: uppercase; letter-spacing: .05em; }
.filtres input, .filtres select { padding: 8px 11px; border: 1.5px solid var(--gris-300); border-radius: 10px; font: inherit; min-width: 140px; text-transform: none; letter-spacing: 0; }
.totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tuile { background: var(--blanc); border: 1px solid var(--gris-300); border-radius: var(--rayon); padding: 16px 20px; display: flex; flex-direction: column; box-shadow: var(--ombre); }
.tuile .etiquette { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris-600); font-weight: 700; }
.tuile .valeur { font-size: 1.55rem; font-weight: 900; margin-top: 2px; }
.tuile-accent { background: var(--jaune); border-color: var(--jaune); }
.tuile-accent .etiquette { color: var(--noir); opacity: .7; }
.table-scroll { overflow-x: auto; background: var(--blanc); border: 1px solid var(--gris-300); border-radius: var(--rayon); box-shadow: var(--ombre); }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td { padding: 11px 13px; border-bottom: 1px solid var(--gris-100); text-align: left; vertical-align: top; }
.tableau th { background: var(--noir); color: var(--jaune); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.tableau tbody tr:nth-child(even) { background: #fdfcf8; }
.tableau tbody tr:hover { background: var(--jaune-pale); }
.tableau .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau.compact th, .tableau.compact td { padding: 7px 10px; }
.actions-ligne a { margin-right: 10px; white-space: nowrap; }
.h2-section { margin: 36px 0 12px; font-size: 1.25rem; font-weight: 900; }
.vide { background: var(--blanc); border: 2px dashed var(--gris-300); border-radius: var(--rayon); padding: 40px; text-align: center; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; margin: 10px 0 0; }
.dl dt { color: var(--gris-600); font-size: .85rem; font-weight: 600; }
.dl dd { margin: 0; }
.liste { margin: 8px 0; padding-left: 18px; }
details.carte summary { cursor: pointer; font-weight: 700; }
.json { background: var(--gris-100); padding: 12px; border-radius: 10px; font-size: .8rem; overflow-x: auto; max-height: 420px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge-ok, .badge-accepte { background: #e4f3ea; color: var(--vert); }
.badge-doublon, .badge-propose { background: var(--jaune-pale); color: var(--ambre); }
.badge-erreur { background: #fbe9e7; color: var(--rouge); }
.badge-refuse, .badge-expire { background: var(--gris-100); color: var(--gris-600); }
.lien-copie { display: flex; gap: 8px; align-items: center; }
.lien-copie input { flex: 1; padding: 9px 11px; border: 1.5px solid var(--gris-300); border-radius: 10px; font: inherit; font-family: var(--mono); font-size: .85rem; }
.boite-decision { background: var(--blanc); border: 2px solid var(--noir); border-radius: var(--rayon); padding: 24px; margin-top: 18px; box-shadow: 6px 6px 0 var(--jaune); }
.boite-decision h3 { margin-top: 0; }
.pastille { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--noir); color: var(--jaune); font-size: .72rem; font-weight: 800; text-align: center; }
details.refus { margin-top: 6px; }
details.refus summary { list-style: none; font-size: .85rem; }
details.refus .formulaire-inline { margin-top: 6px; gap: 6px; }

/* L'espace admin garde une barre sombre pour se distinguer du site public */
body.admin .barre { background: var(--noir); box-shadow: inset 0 -4px 0 var(--jaune); }
body.admin .logo, body.admin .logo-mark { color: var(--blanc); }
body.admin .barre nav a, body.admin .barre .lien { color: #e9e4d6; }
body.admin .barre nav a:hover, body.admin .barre .lien:hover { background: rgba(255, 204, 0, .15); color: var(--jaune); }

@media (max-width: 820px) {
  .hero-grille { grid-template-columns: 1fr; }
  .hero-soleil { max-width: 180px; order: -1; }
}
@media (max-width: 640px) {
  .barre { padding: 10px 16px; height: auto; flex-wrap: wrap; }
  .logo-sub { display: none; }
  .contenu { padding: 20px 16px 40px; }
  .hero { margin-top: -20px; padding: 48px calc(50vw - 50% + 16px) 56px; }
  .dl { grid-template-columns: 1fr; }
}
