/* Habillage commun : administration et formulaire public (CFDT Interco 91) */
:root {
  --accent: #E7591C; --accent-fonce: #C2440F; --accent-clair: #FDEEE6; --lien: #B5410F;
  --rouge: #b3261e; --rouge-clair: #fdecea; --vert: #1e7b34; --vert-clair: #e6f4ea;
  --gris: #5f6b76; --bord: #d5dbe1; --fond: #f3f5f8; --ombre: 0 1px 3px rgba(16, 24, 40, .08);
  --rayon: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: #1d2733; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--lien); }

/* --- Barre du haut --- */
.topbar { background: var(--accent); color: #fff; box-shadow: var(--ombre); }
.topbar .inner { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 2rem; min-height: 64px; }
.topbar .marque { display: flex; align-items: center; gap: .8rem; color: #fff; text-decoration: none; white-space: nowrap; }
.topbar .marque img { height: 46px; width: auto; display: block; background: #fff; border-radius: 6px; padding: 4px 8px; }
.topbar .marque .sigle { display: inline-flex; flex-direction: column; line-height: 1; background: #fff; color: var(--accent); border-radius: 4px; padding: .3rem .55rem; }
.topbar .marque .sigle b { font-size: 1.25rem; font-weight: 900; letter-spacing: .04em; text-transform: lowercase; }
.topbar .marque .sigle small { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: lowercase; color: #333; margin-top: .1rem; }
.topbar .marque .titre { font-weight: 600; font-size: 1rem; opacity: .95; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { color: #fff; text-decoration: none; padding: .45rem .9rem; border-radius: 6px; font-weight: 500; }
.topbar nav a:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.topbar nav a.actif { background: #fff; color: var(--accent-fonce); }
.topbar .compte { margin-left: auto; display: flex; align-items: center; gap: .8rem; font-size: .85rem; white-space: nowrap; }
.topbar .compte a { color: #fff; border: 1px solid rgba(255, 255, 255, .7); border-radius: 6px; padding: .3rem .7rem; text-decoration: none; }
.topbar .compte a:hover { background: rgba(255, 255, 255, .18); }

/* --- Contenu --- */
main { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 1.2rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; color: var(--accent-fonce); }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.2rem 1.4rem; margin-bottom: 1.5rem; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.carte-titre h2 { margin: 0; }
.compteur { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; border-radius: 999px; background: var(--accent-clair); color: var(--lien); font-size: .8rem; text-align: center; vertical-align: middle; }
.help { font-size: .82rem; color: var(--gris); }
code { background: #eef1f4; padding: 0 .25rem; border-radius: 3px; font-size: .85em; }

/* --- Messages --- */
.alerte { padding: .7rem 1rem; border-radius: var(--rayon); margin-bottom: 1.2rem; font-weight: 600; border: 1px solid; }
.alerte.ok { background: var(--vert-clair); color: var(--vert); border-color: #b7dfc2; }
.alerte.bad { background: var(--rouge-clair); color: var(--rouge); border-color: #f3c1bd; }

/* --- Tableaux --- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th { text-align: left; background: #f7f9fb; color: var(--gris); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
td, th { padding: .55rem .7rem; border-bottom: 1px solid var(--bord); vertical-align: middle; }
tbody tr:hover, table tr:hover td { background: #f9fbfd; }
td.act { white-space: nowrap; text-align: right; }
tr.off td { color: #9aa4ad; }

/* --- Statuts --- */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--gris); }
.badge.envoye, .badge.oui { background: var(--vert-clair); color: var(--vert); }
.badge.erreur { background: var(--rouge-clair); color: var(--rouge); }
.badge.non { background: #eef1f4; color: #8a949d; }
.erreur-detail { display: block; color: var(--rouge); font-size: .78rem; margin-top: .2rem; }

/* --- Boutons --- */
button, .btn { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .8rem; border: 1px solid var(--bord); border-radius: 6px;
  background: #fff; color: #1d2733; font: inherit; font-size: .85rem; font-weight: 500; text-decoration: none; cursor: pointer; vertical-align: middle; line-height: 1.2; }
button:hover, .btn:hover { background: #f1f4f7; border-color: #b9c2cb; }
.btn-primary, button.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, button.btn-primary:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.btn-danger { color: var(--rouge); border-color: #e7b3af; }
.btn-danger:hover { background: var(--rouge-clair); border-color: var(--rouge); }
.btn-pdf { color: var(--rouge); border-color: #e7b3af; }
.btn-pdf:hover { background: var(--rouge-clair); border-color: var(--rouge); }
.btn-sm { padding: .25rem .55rem; font-size: .8rem; }
td.act .btn, td.act button { margin-left: .25rem; }
form.inline { display: inline; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

/* --- Formulaires --- */
label { display: block; font-weight: 600; font-size: .85rem; color: #34414d; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; margin-top: .25rem; padding: .45rem .6rem; border: 1px solid var(--bord);
  border-radius: 6px; font: inherit; font-size: .9rem; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #F6B596; outline-offset: 0; border-color: var(--accent); }
textarea { font-family: Consolas, "Courier New", monospace; }
.form-ligne { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.form-ligne > * { width: auto; }
.form-ligne select, .form-ligne input { width: auto; margin-top: 0; }
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
form.edit label { margin-top: .9rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
details { margin-top: 1rem; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .6rem 1rem; background: #fafbfc; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent-fonce); }
details[open] summary { margin-bottom: .6rem; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } .topbar .inner { flex-wrap: wrap; gap: .5rem; padding: .5rem 1rem; } }

/* ==================== Partie publique (formulaire) ==================== */
.public-entete { background: #fff; border-bottom: 6px solid var(--accent); box-shadow: var(--ombre); }
.public-entete .inner { max-width: 760px; margin: 0 auto; padding: 1.2rem 1.5rem; display: flex; align-items: center; justify-content: center; }
.public-entete img { height: 120px; width: auto; max-width: 100%; display: block; }
.public-entete .sigle-texte { font-size: 2.4rem; font-weight: 900; color: var(--accent); }
.public-titre { background: var(--accent); color: #fff; text-align: center; padding: 1.1rem 1.5rem; }
.public-titre h1 { margin: 0; font-size: 1.6rem; }
.public-titre p { margin: .35rem 0 0; opacity: .95; }
main.public { max-width: 640px; padding: 1.8rem 1.2rem 3rem; }
main.public .carte { padding: 1.6rem 1.8rem; }
main.public label { margin-top: 1rem; font-size: .92rem; }
main.public .cols > label { margin-top: 0; }   /* Nom et Prénom alignés sur la même ligne */main.public input:not([type=checkbox]):not([type=radio]), main.public select { padding: .65rem .75rem; font-size: 1rem; }
main.public .cols { gap: 0 1rem; }
.btn-grand { width: 100%; justify-content: center; margin-top: 1.6rem; padding: .85rem 1.2rem; font-size: 1.05rem; font-weight: 700; }
.alerte ul { margin: .3rem 0 0; padding-left: 1.2rem; font-weight: 500; }
.public-pied { text-align: center; color: var(--gris); font-size: .82rem; padding: 0 1rem 2rem; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 600px) { .public-entete img { height: 84px; } .public-titre h1 { font-size: 1.3rem; } main.public .carte { padding: 1.2rem; } }
.btn-google { gap: .7rem; border: 1px solid #c4c7c5; color: #1f1f1f; background: #fff; font-weight: 600; }
.btn-google:hover { background: #f6f8fa; }
.public-pied .lien-admin { display: inline-block; margin-left: .8rem; padding: .25rem .7rem; border: 1px solid var(--bord); border-radius: 6px; color: var(--gris); text-decoration: none; font-size: .8rem; }
.public-pied .lien-admin:hover { border-color: var(--accent); color: var(--lien); background: #fff; }
