:root {
    --tos-navy: #071440;
    --tos-blue: #0d3e82;
    --tos-blue-soft: #155aa8;
    --tos-gold: #ffb300;
    --tos-yellow: #ffd400;
    --tos-orange: #f59e0b;
    --green: #1f9d55;
    --light: #f4f7fb;
    --muted: #64748b;
    --border: #d8e0ec;
    --text: #172033;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(7, 20, 64, .18);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--light); }
a { color: var(--tos-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Les liens transformés en boutons gardent une couleur lisible au survol. */
a.btn:hover { color: inherit; }

/* =============================
   Front-office : style sportif TOS
   ============================= */
.hero {
    min-height: 78vh;
    position: relative;
    overflow: hidden;
    color: var(--white);
    padding: 32px 20px 52px;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 211, 0, .35), transparent 25%),
        linear-gradient(135deg, #030816 0%, var(--tos-navy) 45%, #08245a 100%);
}
.hero::before {
    content: "";
    position: absolute;
    inset: auto -120px -180px auto;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: rgba(255, 179, 0, .16);
    filter: blur(4px);
}
.hero::after {
    content: "";
    position: absolute;
    left: -120px;
    bottom: -170px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 80px solid rgba(255, 212, 0, .11);
}
.topbar, .hero-content { position: relative; z-index: 1; }
.topbar { max-width: 1120px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand-public { display: flex; align-items: center; gap: 16px; font-weight: 850; letter-spacing: .3px; }
.brand-public img { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(0,0,0,.30)); }
.brand-public span { color: rgba(255,255,255,.72); font-weight: 650; font-size: .92rem; }
.nav-public { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nav-public a { color: var(--white); opacity: .95; font-weight: 750; }
.hero-content { max-width: 1120px; margin: 76px auto 0; display: grid; grid-template-columns: 1.08fr .92fr; gap: 42px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.20); background: rgba(255,255,255,.10); padding: 7px 12px; border-radius: 999px; font-size: .92rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--tos-yellow); }
.hero h1 { font-size: clamp(2.25rem, 5.4vw, 4.85rem); line-height: .96; margin: 18px 0 22px; letter-spacing: -.045em; }
.hero h1 strong { color: var(--tos-yellow); }
.hero p { font-size: 1.15rem; line-height: 1.65; opacity: .95; max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-card {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 28px;
    padding: 28px;
    backdrop-filter: blur(10px);
    box-shadow: 0 30px 70px rgba(0,0,0,.20);
}
.hero-card h2 { margin-top: 0; font-size: 1.55rem; }
.hero-card .logo-large { display: block; width: min(260px, 80%); margin: 0 auto 18px; filter: drop-shadow(0 18px 28px rgba(0,0,0,.35)); }
.hero-card ul { padding-left: 20px; line-height: 1.8; margin-bottom: 0; }
.hero-card li::marker { color: var(--tos-yellow); }

/* Bloc visuel prévu pour une photo réelle de bénévoles.
   Remplacer assets/img/photo-benevoles-hero.jpg par une photo du club quand elle sera disponible. */
.volunteer-visual {
    margin-top: 18px;
    border-radius: 24px;
    min-height: 220px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,212,0,.78), rgba(245,158,11,.86)),
        linear-gradient(135deg, #0d3e82, #071440);
    border: 1px solid rgba(255,255,255,.22);
    display: flex;
    align-items: flex-end;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.volunteer-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--volunteer-photo, none);
    background-size: cover;
    background-position: center;
    opacity: .82;
}
.volunteer-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 25%, rgba(3,8,22,.82) 100%);
}
.volunteer-visual-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    color: var(--white);
}
.volunteer-visual-content strong { display: block; font-size: 1.25rem; }
.volunteer-visual-content span { opacity: .88; font-size: .95rem; }

.public-strip { background: var(--white); border-bottom: 1px solid var(--border); }
.public-strip-inner { max-width: 1120px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 20px; }
.public-strip strong { display: block; color: var(--tos-navy); font-size: 1.08rem; }
.public-strip span { color: var(--muted); font-size: .95rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 38px 20px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-title h2 { margin: 0; color: var(--tos-navy); font-size: clamp(1.6rem, 3vw, 2.35rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.card h1, .card h3 { margin-top: 0; color: var(--tos-navy); }
.event-card { position: relative; overflow: hidden; }
.event-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--tos-yellow), var(--tos-orange)); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 800; background: #e8eef9; color: var(--tos-blue); }
.badge-open { background: #dcfce7; color: #166534; }
.badge-closed { background: #fee2e2; color: #991b1b; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 850; cursor: pointer; background: var(--tos-blue); color: var(--white); text-decoration: none; line-height: 1.2; box-shadow: 0 10px 22px rgba(13,62,130,.18); }
.btn:hover { text-decoration: none; background: var(--tos-navy); color: var(--white); }
.btn-gold { background: linear-gradient(135deg, var(--tos-yellow), var(--tos-orange)); color: #111827; box-shadow: 0 12px 26px rgba(245,158,11,.24); }
.btn-gold:hover { background: linear-gradient(135deg, #ffe15e, #f59e0b); color: #111827; }
.btn-light { background: #e8eef9; color: var(--tos-navy); box-shadow: none; }
.btn-light:hover { background: var(--white); color: var(--tos-navy); box-shadow: 0 10px 22px rgba(255,255,255,.12); }
.hero .btn-light:hover { background: var(--white); color: var(--tos-navy); }
.btn-small { padding: 7px 10px; font-size: .9rem; }
.btn-outline { background: transparent; color: var(--tos-blue); border: 1px solid var(--border); box-shadow: none; }
.btn-outline:hover { background: #eef4ff; color: var(--tos-navy); }

.alert { padding: 12px 14px; border-radius: 12px; margin: 10px 0 18px; border: 1px solid transparent; background: #e8eef9; }
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #e8eef9; border-color: #dbeafe; color: var(--tos-navy); }
.form-row { margin-bottom: 14px; }
label { display: block; font-weight: 750; margin-bottom: 6px; color: var(--tos-navy); }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--white); }
textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.table-wrap { overflow-x: auto; background: var(--white); border-radius: 18px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; color: var(--tos-navy); font-size: .92rem; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.empty { background: #f8fafc; border: 1px dashed var(--border); border-radius: 16px; padding: 20px; color: var(--muted); }

/* =============================
   Back-office
   ============================= */
.admin-body { background: #eef3f9; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 278px 1fr; }
.admin-sidebar { background: linear-gradient(180deg, var(--tos-navy), #050b24); color: var(--white); padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.15); }
.brand-mark-img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0,0,0,.28)); }
.brand span { display: block; font-size: .82rem; opacity: .75; margin-top: 2px; }
.admin-nav { display: grid; gap: 6px; }
.admin-nav a { color: rgba(255,255,255,.86); padding: 10px 12px; border-radius: 11px; text-decoration: none; font-weight: 650; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.12); color: var(--white); }
.admin-user { margin-top: auto; font-size: .9rem; opacity: .9; }
.admin-user a { color: var(--white); text-decoration: underline; }
.admin-main { padding: 28px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title h1 { margin: 0; color: var(--tos-navy); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 8px 22px rgba(15,23,42,.05); }
.stat strong { display: block; font-size: 2rem; color: var(--tos-blue); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #030816, var(--tos-navy), var(--tos-blue)); }
.login-card { width: min(440px, 100%); background: var(--white); padding: 30px; border-radius: 24px; box-shadow: var(--shadow); }
.login-logo { display: block; width: 110px; margin: 0 auto 12px; }
.login-card h1 { margin-top: 0; color: var(--tos-navy); text-align: center; }
.login-card .muted { text-align: center; }

@media (max-width: 900px) {
    .hero-content { grid-template-columns: 1fr; margin-top: 42px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .public-strip-inner { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
    .admin-nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .page-title, .section-title { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .hero { padding-top: 22px; }
    .brand-public img { width: 58px; height: 58px; }
    .hero-card { padding: 22px; }
    .nav-public { width: 100%; }
    .nav-public .btn { width: 100%; }
}

/* =============================
   V1.3 - Accessibilité et accueil compact
   =============================
   Objectif : garder une page dynamique sans perdre trop de place en haut,
   rendre le logo cliquable, et poser les premières règles utiles aux lecteurs
   d'écran et à la navigation clavier.
*/
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 9999;
    background: var(--tos-yellow);
    color: #111827;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 850;
    text-decoration: none;
}
.skip-link:focus { top: 12px; outline: 3px solid var(--white); outline-offset: 3px; }

:focus-visible {
    outline: 3px solid var(--tos-yellow);
    outline-offset: 3px;
}

.brand-public-link,
.brand-logo-link { text-decoration: none; color: inherit; }
.brand-public-link:hover,
.brand-logo-link:hover { text-decoration: none; }
.brand-public span { display: block; }
.brand-public em { color: rgba(255,255,255,.72); font-style: normal; font-weight: 650; font-size: .92rem; }
.brand-logo-link { display: inline-flex; border-radius: 12px; }

/* Bandeau volontairement plus compact pour ne pas manger trop de hauteur. */
.hero-home {
    min-height: auto;
    padding: 18px 20px 36px;
}
.topbar-compact .brand-public img {
    width: 58px;
    height: 58px;
}
.hero-content-compact {
    margin-top: 38px;
    gap: 34px;
}
.hero-content-compact .hero h1,
.hero-home h1 {
    margin-top: 14px;
}
.hero-home p {
    font-size: 1.08rem;
}
.hero-card-photo {
    padding: 0;
    overflow: hidden;
}
.volunteer-photo-card {
    margin: 0;
    position: relative;
    min-height: 340px;
    background: #030816;
}
.volunteer-photo-card img {
    display: block;
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center;
}
.volunteer-photo-card figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px;
    color: var(--white);
    background: linear-gradient(180deg, rgba(3,8,22,0), rgba(3,8,22,.92));
}
.volunteer-photo-card strong {
    display: block;
    font-size: 1.2rem;
}
.volunteer-photo-card span {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,.90);
}
.hero-compact-page {
    min-height: auto;
    padding: 18px 20px 46px;
}
.hero-content-single {
    margin-top: 34px;
    grid-template-columns: 1fr;
}
.notice-light { color: rgba(255,255,255,.78); }

/* Les liens ont un comportement lisible au clavier et au survol. */
a:hover { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.btn:focus-visible,
.admin-nav a:focus-visible,
.nav-public a:focus-visible {
    outline: 3px solid var(--tos-yellow);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .hero-content-compact { margin-top: 30px; }
    .volunteer-photo-card,
    .volunteer-photo-card img { min-height: 280px; height: 280px; }
}

@media (max-width: 560px) {
    .hero-home,
    .hero-compact-page { padding-top: 14px; }
    .topbar-compact .brand-public img { width: 50px; height: 50px; }
    .brand-public { gap: 12px; }
    .volunteer-photo-card,
    .volunteer-photo-card img { min-height: 245px; height: 245px; }
    .volunteer-photo-card figcaption { padding: 18px; }
}
.brand-public-link > span { color: var(--white); font-weight: 850; font-size: 1rem; line-height: 1.18; }
.brand-public-link > span em { color: rgba(255,255,255,.72); font-weight: 650; font-size: .9rem; }

/* =============================
   V2 - Espace adhérent sécurisé
   =============================
   - Les pages internes publiques utilisent un bandeau plus bas que l'accueil.
   - Les formulaires conservent des labels et des textes accessibles.
*/
.hero-internal-page {
    min-height: auto;
    padding: 14px 20px 30px;
}
.hero-internal-page .topbar-compact .brand-public img {
    width: 48px;
    height: 48px;
}
.hero-content-internal {
    margin-top: 20px;
}
.hero-content-internal .hero-card {
    padding: 20px 22px;
}
.hero-content-internal h1 {
    margin: 10px 0 10px;
    font-size: clamp(1.9rem, 4vw, 3rem);
}
.hero-content-internal p {
    font-size: 1rem;
    margin-bottom: 0;
}
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.space-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 26px;
}
.clean-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}
.clean-list li {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}
.cancel-choice-form { margin-top: 10px; }
.post-choice-card details {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.post-choice-card summary {
    cursor: pointer;
    font-weight: 850;
    color: var(--tos-blue);
}
.post-choice-card summary:hover { color: var(--tos-navy); }
.choice-form { margin-top: 14px; }
.access-card { max-width: 760px; }
.link-result input[readonly] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    background: #f8fafc;
}
.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.inline-form input { min-width: 0; }

@media (max-width: 560px) {
    .hero-internal-page { padding-top: 12px; }
    .hero-internal-page .topbar-compact .brand-public img { width: 44px; height: 44px; }
    .hero-content-internal { margin-top: 16px; }
    .hero-content-internal .hero-card { padding: 18px; }
    .inline-form { grid-template-columns: 1fr; }
}

/* V2.1 - corrections lisibilité boutons back-office */
.admin-main .actions .btn,
.admin-main .actions button.btn,
.admin-main .inline-form .btn {
    text-decoration: none;
}

.admin-main .actions .btn:hover,
.admin-main .actions button.btn:hover,
.admin-main .inline-form .btn:hover {
    background: var(--tos-navy);
    color: var(--white);
}

.admin-main .actions .btn-light:hover,
.admin-main .actions button.btn-light:hover,
.admin-main .inline-form .btn-light:hover {
    background: #ffffff;
    color: var(--tos-navy);
    box-shadow: 0 8px 20px rgba(13,62,130,.16);
}

.btn-danger {
    background: #b91c1c;
    color: #ffffff;
}

.btn-danger:hover,
.admin-main .actions .btn-danger:hover,
.admin-main .actions button.btn-danger:hover {
    background: #7f1d1d;
    color: #ffffff;
}

.admin-version {
    margin-top: 32px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .82rem;
    text-align: right;
}

.space-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.log-details { white-space: pre-wrap; max-width: 520px; font-size: .82rem; background: rgba(15,23,42,.04); border-radius: 10px; padding: .6rem; }
.inline-form { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.inline-form input { min-width: 260px; }

/* V2.5 - Champs de copie dans le journal mail */
.copy-input {
    width: 260px;
    max-width: 100%;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #10243a;
}
.copy-input:focus {
    outline: 3px solid rgba(245,180,0,.45);
    border-color: #f5b400;
}

/* V2.6 - Choix de la personne qui réalise l'action bénévole
   L'adhérent indique d'abord s'il vient lui-même ou s'il délègue l'action.
   Les champs restent utilisables sans JavaScript et conservent labels/fieldset
   pour les lecteurs d'écran. */
.choice-fieldset {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    margin: 0 0 16px;
    background: #f8fafc;
}
.choice-fieldset legend {
    font-weight: 850;
    color: var(--tos-navy);
    padding: 0 6px;
}
.radio-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 12px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
}
.radio-card:hover {
    border-color: var(--tos-blue-soft);
    box-shadow: 0 8px 18px rgba(13,62,130,.08);
}
.radio-card input {
    width: auto;
    margin-top: 4px;
}
.radio-card small {
    color: var(--muted);
}

/* V2.7 - Postes nécessitant un permis de conduire */
.badge-warning {
    background: #fff4d6;
    color: #6b4300;
    border: 1px solid #f3c95b;
}
.help-text {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.35;
}
.permit-fieldset {
    background: #fffaf0;
    border-color: #f3c95b;
}
.permit-fieldset legend {
    color: #6b4300;
}

/* V2.8 - Traçabilité, RGPD et pied de page public */
.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}
.checkline {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 14px 0;
    font-weight: 700;
    color: var(--tos-navy);
}
.checkline input { width: auto; margin-top: .25rem; }
.privacy-notice {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    color: #334155;
    font-size: .94rem;
    line-height: 1.55;
}
.privacy-notice a { font-weight: 800; }
.public-footer {
    background: #071440;
    color: rgba(255,255,255,.82);
    padding: 22px 0;
    margin-top: 36px;
}
.public-footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.public-footer-credit {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: .92rem;
    line-height: 1.35;
}
.public-footer-links {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    font-size: .92rem;
}
.public-footer a {
    color: #ffd400;
    font-weight: 800;
}
.public-footer .footer-studio-line,
.public-footer .footer-contact-line {
    display: block;
}
.public-footer .footer-contact-line a {
    font-weight: 800;
}
.public-footer .studio-credit {
    display: inline-block;
    color: rgba(255,255,255,.82);
    font-weight: 400;
    text-decoration: none;
}
.public-footer .footer-separator {
    color: rgba(255,255,255,.55);
    margin: 0 2px;
}
.public-footer .studio-credit:hover,
.public-footer .studio-credit:focus {
    color: #ffd400;
    text-decoration: underline;
}
@media (max-width: 640px) {
    .public-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}
.readable-page {
    max-width: 980px;
}
.impact-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e5edf5;
}
.impact-list li:last-child { border-bottom: 0; }

/* V2.9 - Journal impacts plus lisible et postes regroupés */
.impact-changes {
    margin-bottom: 10px;
}
.impact-changes summary {
    font-weight: 850;
    color: var(--tos-navy);
    cursor: pointer;
    margin-bottom: 8px;
}
.impact-diff-table {
    font-size: .86rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.impact-diff-table th,
.impact-diff-table td {
    padding: 8px 10px;
}
.impact-changed-row {
    background: #fffbeb;
}
.impact-old,
.impact-new {
    display: inline-block;
    max-width: 320px;
    padding: 5px 8px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}
.impact-old {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}
.impact-new {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.impact-reason {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--tos-navy);
    font-weight: 700;
}
.filter-card {
    margin: 18px 0;
}
.filter-card h3 {
    margin-top: 0;
}
.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .6fr) minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.poste-event-group {
    margin: 22px 0 28px;
}
.poste-event-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(90deg, #ffffff, #f8fafc);
}
.poste-event-title h3 {
    margin: 0;
    color: var(--tos-navy);
}
.poste-event-title p {
    margin: 4px 0 0;
}
@media (max-width: 980px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    .poste-event-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* V3.0 - badges de suivi obligations */
.badge-info { background: #dbeafe; color: #1e3a8a; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f1f5f9; color: #334155; }

/* V3.2 - Bloc de recherche responsable dans les formulaires admin. */
.responsable-search-box {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: #f8fafc;
}
.responsable-search-box h4 { margin-top: 0; }
.responsable-public {
    padding: .75rem;
    border-left: 4px solid #f5b400;
    background: #f8fafc;
    border-radius: 10px;
}

/* V3.3 - Parcours adhérent par événement puis par poste
   L'espace bénévole ne montre plus directement tous les postes en vrac :
   l'adhérent choisit d'abord un événement, puis voit les postes disponibles. */
.choice-step {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
}
.choice-step > strong {
    display: block;
    margin-top: 8px;
    color: var(--tos-navy);
    font-size: 1.1rem;
}
.event-choice-grid {
    align-items: stretch;
}
.event-select-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.event-select-card h3 {
    margin-bottom: 0;
}
.event-select-card .btn {
    margin-top: auto;
}
.selected-event-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.selected-event-summary h3 {
    margin: 8px 0 4px;
    color: var(--tos-navy);
    font-size: 1.55rem;
}
.choice-done-item .choice-event-name {
    display: inline-block;
    margin-left: 6px;
    color: var(--tos-navy);
    font-size: 1.05rem;
}
.choice-post-name {
    display: inline-block;
    margin-top: 6px;
}
@media (max-width: 760px) {
    .selected-event-summary {
        align-items: flex-start;
        flex-direction: column;
    }
    .selected-event-summary .btn {
        width: 100%;
    }
}

/* V3.3.1 - Meilleure mise en avant des événements et des dates dans l'espace adhérent */
.event-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.event-card-label {
    display: block;
    margin-bottom: 5px;
    color: var(--tos-blue);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.event-card-title,
.selected-event-title {
    color: var(--tos-navy);
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.08;
    margin: 0;
    letter-spacing: -.02em;
}
.event-date-box {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0 2px;
    padding: 10px 13px;
    border-radius: 14px;
    border: 1px solid rgba(13, 62, 130, .16);
    background: linear-gradient(135deg, rgba(255, 212, 0, .22), rgba(13, 62, 130, .06));
    color: var(--tos-navy);
}
.event-date-box strong {
    font-size: 1.02rem;
    line-height: 1.2;
}
.event-date-label {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.event-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: var(--muted);
}
.event-card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: .9rem;
}
.selected-event-main {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.event-date-box-inline {
    margin-top: 2px;
}
.choice-done-event {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.choice-done-date {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 8px;
    padding: 8px 11px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
}
.choice-done-date strong {
    color: var(--tos-navy);
}
@media (max-width: 760px) {
    .event-card-head {
        flex-direction: column;
    }
    .event-card-head .badge {
        align-self: flex-start;
    }
    .event-date-box {
        width: 100%;
    }
}

/* V3.3.2 - Correction globale des contrastes boutons au survol/focus
   Objectif : éviter les cas où un texte devient noir sur fond sombre ou blanc
   sur fond clair, notamment dans les tableaux du back-office et l'espace adhérent.
   Les règles ci-dessous sont volontairement placées en fin de fichier pour
   prendre le dessus sur les anciennes variantes. */
.btn,
button.btn,
a.btn,
input[type="submit"].btn {
    color: #ffffff !important;
    text-decoration: none !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover,
input[type="submit"].btn:hover,
.btn:focus-visible,
button.btn:focus-visible,
a.btn:focus-visible,
input[type="submit"].btn:focus-visible {
    background: var(--tos-navy) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Boutons dorés : fond clair, texte foncé maintenu au repos comme au survol. */
.btn-gold,
button.btn-gold,
a.btn-gold,
input[type="submit"].btn-gold,
.btn-gold:hover,
button.btn-gold:hover,
a.btn-gold:hover,
input[type="submit"].btn-gold:hover,
.btn-gold:focus-visible,
button.btn-gold:focus-visible,
a.btn-gold:focus-visible,
input[type="submit"].btn-gold:focus-visible {
    background: linear-gradient(135deg, var(--tos-yellow), var(--tos-orange)) !important;
    color: #111827 !important;
}

/* Boutons clairs et outline : fond clair, texte bleu foncé maintenu. */
.btn-light,
button.btn-light,
a.btn-light,
input[type="submit"].btn-light,
.btn-outline,
button.btn-outline,
a.btn-outline,
input[type="submit"].btn-outline {
    color: var(--tos-navy) !important;
}

.btn-light:hover,
button.btn-light:hover,
a.btn-light:hover,
input[type="submit"].btn-light:hover,
.btn-light:focus-visible,
button.btn-light:focus-visible,
a.btn-light:focus-visible,
input[type="submit"].btn-light:focus-visible {
    background: #ffffff !important;
    color: var(--tos-navy) !important;
}

.btn-outline:hover,
button.btn-outline:hover,
a.btn-outline:hover,
input[type="submit"].btn-outline:hover,
.btn-outline:focus-visible,
button.btn-outline:focus-visible,
a.btn-outline:focus-visible,
input[type="submit"].btn-outline:focus-visible {
    background: #eef4ff !important;
    color: var(--tos-navy) !important;
    border-color: rgba(13, 62, 130, .28) !important;
}

/* Boutons danger : texte blanc conservé sur fond rouge foncé. */
.btn-danger,
button.btn-danger,
a.btn-danger,
input[type="submit"].btn-danger,
.btn-danger:hover,
button.btn-danger:hover,
a.btn-danger:hover,
input[type="submit"].btn-danger:hover,
.btn-danger:focus-visible,
button.btn-danger:focus-visible,
a.btn-danger:focus-visible,
input[type="submit"].btn-danger:focus-visible {
    color: #ffffff !important;
}

/* Liens de navigation sombres : couleur claire maintenue au survol. */
.admin-nav a:hover,
.admin-nav a:focus-visible,
.nav-public a:hover,
.nav-public a:focus-visible {
    color: #ffffff !important;
}

/* V3.4 - Formulaires de validation présence dans les tableaux */
.status-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}
.status-form textarea {
    min-height: 68px;
    font-size: .92rem;
}
.status-form select {
    font-size: .92rem;
}

/* V4.0 - Liaison MachForm : cartes statistiques et aides de formulaire */
.form-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.4;
}
.checkbox-row label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.checkbox-row input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}
.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 16px;
}
.stat-card {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 16px;
    padding: 14px;
}
.stat-card strong {
    display: block;
    color: var(--tos-navy);
    font-size: 1.8rem;
    line-height: 1;
}
.stat-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

/* V4.1.1 - Sources MachForm : formulaire déjà rattaché visuellement identifiable. */
.machform-attached-row td {
    background: #f0fdf4;
}
.machform-attached-row td:first-child {
    border-left: 4px solid #16a34a;
}

/* V4.2 - Tableau de bord de pilotage bénévoles */
.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border-left: 6px solid var(--tos-gold);
}
.dashboard-hero h2 {
    margin: 0 0 6px;
    color: var(--tos-navy);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}
.dashboard-kicker {
    margin: 0 0 6px;
    color: var(--tos-blue);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .82rem;
}
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.dashboard-filters {
    align-items: end;
}
.dashboard-stats .stat-primary strong { color: var(--tos-blue); }
.dashboard-stats .stat-success strong { color: #166534; }
.dashboard-stats .stat-warning strong { color: #b45309; }
.dashboard-stats .stat-danger strong { color: #991b1b; }
.dashboard-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 18px;
}
.dashboard-section {
    margin-top: 18px;
}
.compact-title {
    margin-bottom: 12px;
}
.compact-title h3 {
    margin: 0 0 4px;
}
.progress-block {
    margin: 14px 0 18px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--tos-navy);
    font-weight: 800;
}
.progress-bar,
.mini-progress {
    height: 12px;
    border-radius: 999px;
    background: #e8eef9;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-bar span,
.mini-progress span {
    display: block;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--tos-blue), var(--tos-blue-soft));
}
.progress-bar-green span {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}
.mini-progress {
    width: 120px;
    height: 9px;
    margin-bottom: 4px;
}
.status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}
@media (max-width: 760px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }
    .dashboard-actions {
        justify-content: flex-start;
    }
    .mini-progress {
        width: 90px;
    }
}

/* V4.2.1 - Détails compact du tableau de bord */
.dashboard-details {
    max-width: 360px;
    font-size: 0.92rem;
}
.dashboard-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #0d3b66;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.dashboard-details summary:hover,
.dashboard-details summary:focus {
    color: #061f38;
}
.dashboard-details ul {
    margin: .45rem 0 0 1.1rem;
    padding: 0;
}
.dashboard-details li {
    margin-bottom: .35rem;
    line-height: 1.35;
}


/* V4.4.2 - Identité adhérent dans les journaux mails. */
.journal-adherent-id {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.82rem;
    line-height: 1.25;
    color: var(--muted);
    font-weight: 600;
}

/* V4.5 - formulaires d'action courts dans les tableaux back-office. */
.inline-action-form {
    display: inline-block;
    margin: 0.15rem 0.2rem 0.15rem 0;
    vertical-align: middle;
}
.inline-action-form button {
    margin: 0;
}
.text-danger {
    color: #b42318;
    font-weight: 600;
}

/* V4.5.2 - Message explicatif pour le filtre par saison dans Sources MachForm. */
.notice-small {
    margin: 0.65rem 0 0;
    padding: 0.65rem 0.8rem;
    border-left: 4px solid var(--tos-gold);
    border-radius: 10px;
    background: #fff8e5;
    color: #3b2f0b;
    font-size: 0.92rem;
}

/* V4.8 - cases de confirmation dans les relances. */
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox-inline input { width: auto; }


/* V4.9.2 - Page adhérent : tuiles de résumé plus compactes et responsives.
   Les noms longs, les libellés de saison et les petits écrans ne doivent plus déborder. */
.space-summary {
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 10px;
    align-items: stretch;
}
.space-summary .stat {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
}
.space-summary .stat span {
    display: block;
    margin-bottom: 4px;
    font-size: .74rem;
    line-height: 1.15;
    letter-spacing: .02em;
}
.space-summary .stat strong {
    font-size: clamp(1rem, 2.4vw, 1.28rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}
.space-summary .stat-identity,
.space-summary .stat-season {
    grid-column: span 2;
}
@media (max-width: 720px) {
    .space-summary {
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    }
    .space-summary .stat-identity,
    .space-summary .stat-season {
        grid-column: auto;
    }
}
@media (max-width: 420px) {
    .space-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .space-summary .stat {
        padding: 10px 11px;
    }
    .space-summary .stat strong {
        font-size: .98rem;
    }
}

/* V4.9.2 - Utilisateurs : formulaire compact pour changer le rôle sans sortir de la liste. */
.role-change-form {
    grid-template-columns: minmax(170px, 1fr) auto;
    max-width: 360px;
}
.role-change-form select {
    min-width: 0;
}
@media (max-width: 700px) {
    .role-change-form {
        display: grid;
        grid-template-columns: 1fr;
        max-width: none;
    }
}


/* V4.10 - Page de confirmation MachForm */
.post-machform-page .summary-list { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 8px 14px; margin: 0; }
.post-machform-page .summary-list dt { color: var(--muted); font-weight: 700; }
.post-machform-page .summary-list dd { margin: 0; font-weight: 700; word-break: break-word; }
.compact-list { margin: 6px 0; padding-left: 18px; }
.compact-list li { margin: 2px 0; }
.priority-actions-list { display: grid; gap: 10px; }
.priority-action-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: #fff; display: grid; gap: 3px; }
.priority-action-item strong { color: var(--tos-navy); }
.priority-action-item span { color: var(--text); }
.priority-action-item em { color: var(--muted); font-style: normal; font-size: .92rem; }
.log-details { max-height: 360px; overflow: auto; white-space: pre-wrap; font-size: .82rem; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
@media (max-width: 640px) {
    .post-machform-page .summary-list { grid-template-columns: 1fr; }
    .post-machform-page .summary-list dt { margin-top: 6px; }
}

/* V4.10.15.7 - Mise en avant du choix de poste dans l'espace adhérent. */
.post-choice-card h3 {
    margin-bottom: .55rem;
}
.post-choice-schedule {
    display: flex;
    align-items: baseline;
    gap: .65rem 1rem;
    flex-wrap: wrap;
    margin: .35rem 0 .25rem;
    color: var(--tos-navy);
}
.post-choice-date {
    font-size: 1.18rem;
    font-weight: 850;
}
.post-choice-hours {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--tos-blue);
}
.post-choice-context {
    margin: .25rem 0 .8rem;
}
.post-choice-description {
    margin: .7rem 0 1rem;
}
.post-choice-card details.choice-details {
    margin-top: 1rem;
    border-top: 0;
    padding-top: 0;
}
.post-choice-card details.choice-details > summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .75rem;
    width: 100%;
    box-sizing: border-box;
    padding: .85rem 1rem;
    border: 1px solid #b9d8f7;
    border-radius: 12px;
    background: #eef6ff;
    color: var(--tos-navy);
    text-align: left;
    list-style: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.post-choice-card details.choice-details > summary::-webkit-details-marker {
    display: none;
}
.post-choice-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--tos-blue);
    color: #fff;
    font-size: .95rem;
    font-weight: 900;
}
.post-choice-action-copy {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 0;
}
.post-choice-action-title {
    color: var(--tos-blue);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.15;
}
.post-choice-action-help {
    color: #5d6b7c;
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.25;
}
.post-choice-card details.choice-details > summary::after {
    content: '▾';
    margin-left: auto;
    color: var(--tos-blue);
    font-size: 1.15em;
    font-weight: 900;
    transition: transform .18s ease;
}
.post-choice-card details.choice-details[open] > summary::after {
    transform: rotate(180deg);
}
.post-choice-card details.choice-details > summary:hover,
.post-choice-card details.choice-details > summary:focus-visible {
    color: var(--tos-navy);
    background: #e2f0ff;
    border-color: #8fc2f3;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .09);
}
.post-choice-card details.choice-details[open] > summary {
    background: #e7f2ff;
    border-color: #9cc8f1;
}
.responsable-public.responsable-public-compact {
    margin: 1rem 0 0;
    padding: .65rem .8rem;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.45;
}
.responsable-public-compact .responsable-public-title {
    display: block;
    margin-bottom: .15rem;
    color: #475569;
    font-weight: 750;
}
.responsable-public-compact strong {
    font-weight: 750;
}
@media (max-width: 560px) {
    .post-choice-date { font-size: 1.08rem; }
    .post-choice-hours { font-size: 1.2rem; }
    .post-choice-card details.choice-details > summary { padding: .9rem 1rem; }
}
