/* Hiver Solidaire : feuille de style de l'appli, chargée après Bootstrap 5.3.3. */
:root {
    --bg: #f1f4f9; --card: #fff; --ink: #1c2a3a; --muted: #626c7a;
    --line: #e1e6ee; --accent: #1f3a6e; --accent-d: #162a52; --accent-bg: #e8edf6;
    --ok: #15803d; --warn: #b45309; --danger: #c81e1e;
    --ok-bg: #e3f5e8; --warn-bg: #fdf0d5; --danger-bg: #fde8e6;
    --ok-line: #bfe6cb; --danger-line: #f7c6c1;
    --titre: ui-serif, "New York", Georgia, "Times New Roman", serif;
    --vitrail: linear-gradient(90deg, #e2572b 0 20%, #f2b632 20% 40%, #2a9d8f 40% 60%, #1f3a6e 60% 80%, #c2274b 80%);
    --ombre: 0 1px 2px rgba(28,42,58,.05), 0 6px 18px rgba(28,42,58,.05);
}
* { box-sizing: border-box; }
body {
    margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--ink); line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { color: var(--ink); }
.page-title { font-family: var(--titre); font-size: 1.75rem; font-weight: 600; margin: .4rem 0 .15rem; }
.page-intro { color: var(--muted); margin: 0 0 1.1rem; }
.card-title { font-family: var(--titre); font-size: 1.15rem; font-weight: 600; margin: 0 0 .75rem; }

/* En-tête */
header.top {
    background: var(--card); padding: .6rem 1.25rem; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: sticky; top: 0; z-index: 10;
}
header.top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--vitrail); }
header.top .brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-family: var(--titre); font-weight: 600; font-size: 1.15rem; line-height: 1.15; }
header.top .brand img { height: 42px; width: auto; }
header.top .brand small { display: block; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 400; font-size: .74rem; color: var(--muted); }
header.top .mainnav { display: flex; align-items: center; gap: .15rem; }
.nav-link-hs {
    display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 9px;
    color: var(--muted); font-size: .93rem; font-weight: 500; background: none; border: 0; cursor: pointer;
}
.nav-link-hs:hover { background: var(--bg); color: var(--ink); }
.nav-link-hs.is-active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav-toggle { display: none; background: transparent; border: 0; color: var(--ink); font-size: 1.35rem; line-height: 1; cursor: pointer; padding: .3rem .45rem; }

/* Gabarit */
.container { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--ombre); }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
.flash, .errors { padding: .65rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.errors { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.muted { color: var(--muted); font-size: .85rem; }
footer.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 1.5rem 1rem 2rem; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: var(--accent); color: #fff; border: 0;
    padding: .6rem 1.05rem; border-radius: 10px; font-size: .95rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--accent-d); color: #fff; }
.btn.secondary { background: var(--accent-bg); color: var(--accent); }
.btn.secondary:hover { background: #dbe3f1; color: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a51818; }
.btn.small { padding: .32rem .65rem; font-size: .83rem; }
.btn-icone {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem;
}
.btn-icone:hover { background: var(--bg); color: var(--ink); }
.btn-icone.danger:hover { background: var(--danger-bg); color: var(--danger); }
.actions { display: flex; gap: .1rem; flex-shrink: 0; }

/* Formulaires */
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: .25rem; font-weight: 500; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=search], input[type=number], select, textarea {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 9px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field { margin-bottom: .85rem; }
.form-ligne { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.form-ligne .field { flex: 1; min-width: 150px; margin-bottom: 0; }

/* Interrupteur : jamais de case native colorée */
.checks { display: flex; flex-direction: column; margin: .1rem 0 .9rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.check { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0; padding: .65rem .8rem; font-size: .95rem; color: var(--ink); cursor: pointer; font-weight: 400; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check small { display: block; color: var(--muted); font-size: .78rem; }
.check input {
    appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 44px; height: 26px; margin: 0; border-radius: 999px;
    background: #cdd4df; position: relative; cursor: pointer; transition: background .15s;
}
.check input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.check input:checked { background: var(--accent); }
.check input:checked::after { transform: translateX(18px); }

.check-sous { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .8rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.check-sous label { margin: 0; color: var(--ink); font-size: .9rem; font-weight: 400; }
.check-sous input { width: 76px; padding: .35rem .5rem; text-align: center; font-size: 1rem; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.neutre { background: var(--bg); color: var(--muted); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }

/* Listes */
.liste-ligne { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.liste-corps { display: flex; align-items: center; gap: .65rem; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); cursor: pointer; }
.liste-corps strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.liste-corps .muted { display: block; }
.recherche { position: relative; margin-bottom: .6rem; }
.recherche i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.recherche input { padding-left: 2.2rem; }
details.repli > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: flex; align-items: center; gap: .5rem; }
details.repli > summary::-webkit-details-marker { display: none; }
details.repli[open] > summary { margin-bottom: .8rem; }
.semaine { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .6rem; margin: 0 -.6rem; border-bottom: 1px solid var(--line); border-radius: 8px; }
.semaine:last-child { border-bottom: 0; }
.semaine.en-cours { background: var(--accent-bg); border-bottom-color: transparent; }
.semaine strong { font-weight: 600; }
.semaine.terminee { background: var(--bg); border-bottom-color: #fff; }
.semaine.terminee strong { color: #9aa4b2; font-weight: 500; }
.semaine.terminee select { color: #9aa4b2; background: var(--bg); }
.semaine select { min-width: 190px; max-width: 220px; padding: .42rem .5rem; font-size: .9rem; }

.semaine.passee { color: var(--muted); font-size: .9rem; flex-direction: row; align-items: center; }
.semaine.passee span:last-child { text-align: right; }
.historique-titre { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: .9rem 0 .25rem; }

/* Connexion */
.login-card { max-width: 400px; margin: 2.5rem auto 1rem; padding: 2rem 1.6rem 1.6rem; text-align: center; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--vitrail); }
.login-card img { height: 150px; width: auto; display: block; margin: 0 auto .6rem; }
.login-card h1 { font-family: var(--titre); font-weight: 600; font-size: 1.7rem; margin: 0; }
.login-card p { color: var(--muted); margin: .1rem 0 1.3rem; }
.login-card form { text-align: left; }
.login-card .btn { width: 100%; }

/* Calendrier */
.cal-card { padding: 1rem 1.1rem; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.cal-nav h1 { font-family: var(--titre); font-weight: 600; font-size: 1.6rem; margin: 0; flex: 1; }
.cal-nav h1::first-letter { text-transform: uppercase; }
.car-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.car-btn:hover { background: var(--bg); }
.car-btn:disabled { color: #c3cad5; cursor: default; background: #fff; }
.carousel-track { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.month-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; padding: 4px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { margin-bottom: 2px; padding: 0 4px; }
.cal-head div { text-align: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
.cal-cell { min-height: 84px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: .4rem .45rem; display: flex; flex-direction: column; justify-content: space-between; gap: .25rem; color: var(--ink); }
a.cal-cell:hover { color: var(--ink); outline: 2px solid var(--accent); }
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.out { background: transparent; border-style: dashed; color: #b6bfcc; }
.cal-cell.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.cal-cell.warn { background: var(--warn-bg); border-color: #f6dca6; }
.cal-cell.danger { background: var(--danger-bg); border-color: var(--danger-line); }
.cal-cell.is-past { opacity: .5; }
.cal-cell.is-today { box-shadow: 0 0 0 3px #e2572b; border-color: #e2572b; opacity: 1; }
.cal-cell.out.is-today { background: #fff; border-style: solid; color: var(--ink); }
.cal-num { font-size: 1.05rem; font-weight: 700; line-height: 1.1; display: flex; align-items: center; gap: .25rem; }
.cal-num .fa-flag { font-size: .62rem; color: var(--warn); margin-left: auto; }
.today-badge { font-size: .56rem; font-weight: 700; color: #fff; background: #e2572b; border-radius: 4px; padding: .05rem .22rem; }
.cal-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.cal-slot { display: inline-flex; align-items: center; justify-content: center; gap: .15rem; font-size: .66rem; font-weight: 700; padding: .12rem 0; border-radius: 5px; color: var(--ok); background: rgba(255,255,255,.65); }
.cal-slot.manque { color: #fff; background: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; font-size: .78rem; color: var(--muted); margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.legend .dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; vertical-align: -1px; margin-right: .25rem; }
.legend i { width: 1.1em; text-align: center; }

/* Infobulle du calendrier (que des nombres, jamais de noms) */
.cal-tip { position: fixed; z-index: 9999; pointer-events: none; display: none; opacity: 0; transition: opacity .12s; background: var(--ink); color: #fff; border-radius: 9px; padding: .5rem .6rem; font-size: .72rem; line-height: 1.5; min-width: 178px; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.cal-tip.show { opacity: 1; }
.cal-tip .tip-h { font-weight: 700; text-transform: capitalize; margin-bottom: .3rem; padding-bottom: .22rem; border-bottom: 1px solid rgba(255,255,255,.18); }
.cal-tip .tip-row { display: flex; justify-content: space-between; gap: 1rem; }
.cal-tip .tip-tot { margin-top: .28rem; padding-top: .22rem; border-top: 1px solid rgba(255,255,255,.18); color: #cbd5e1; }
.cal-tip .v-ok { color: #4ade80; } .cal-tip .v-warn { color: #fbbf24; } .cal-tip .v-danger { color: #f87171; }

/* Page d'un jour */
.jour-page { max-width: 680px; margin: 0 auto; }
.retour { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .88rem; margin-bottom: .35rem; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.daynav h1 { font-family: var(--titre); font-weight: 600; font-size: 1.6rem; margin: 0; }
.daynav h1::first-letter { text-transform: uppercase; }
.daynav .fleches { display: flex; gap: .3rem; flex-shrink: 0; }
.fleche { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.fleche.vide { visibility: hidden; }
.resp-card { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; padding: .7rem .9rem; }
.resp-card .resp-corps { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.resp-card .resp-label { color: var(--muted); font-size: .76rem; }
.resp-card strong { display: block; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: .7rem; }
.contact { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: .75rem .85rem; margin-bottom: 0; }
.contact-label { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .76rem; }
.contact-label i { color: var(--accent); }
.contact strong { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.contact-ligne { display: flex; align-items: center; justify-content: space-between; gap: .3rem; width: 100%; }
.contact .btn-icone { width: 30px; height: 30px; font-size: .8rem; }
.contact .btn.small { max-width: 100%; white-space: nowrap; }
.slot-card { padding: .85rem 1rem; margin-bottom: .7rem; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.slot-titre { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.slot-icone { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.slot-card.manque .slot-icone { background: var(--danger-bg); color: var(--danger); }
.slot-head h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.2; }
.slot-head .heure { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.person { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .6rem 0 .45rem; border-top: 1px solid var(--line); margin-top: .6rem; }
.person + .person { margin-top: 0; }
.person-corps { display: flex; gap: .6rem; min-width: 0; }
.person .pname { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.person .pmeta { font-size: .82rem; color: var(--muted); }
.person .pmeta a { color: var(--muted); }
.empty-slot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.slot-card.manque .empty-slot { color: var(--danger); font-weight: 500; }
.inscrire-bar { position: sticky; bottom: .8rem; z-index: 5; display: flex; justify-content: center; margin: 1rem 0 .4rem; }
.inscrire-bar .btn { padding: .75rem 1.5rem; font-size: 1rem; box-shadow: 0 6px 16px rgba(31,58,110,.3); }
.lecture-seule { display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); padding: .6rem .8rem; margin-bottom: .8rem; font-size: .9rem; }

/* Fenêtres Bootstrap */
.modal-content { border: 0; border-radius: 16px; }
.modal-title { font-family: var(--titre); font-weight: 600; }
.modal-title::first-letter { text-transform: uppercase; }
/* Le <form> s'intercale entre le contenu et le corps : sans ça, le corps ne défile pas et les boutons sortent de l'écran. */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-body { min-height: 0; }

/* Texte légal */
.legal { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.legal h1 { font-family: var(--titre); font-weight: 600; font-size: 1.6rem; }
.legal h2 { font-family: var(--titre); font-weight: 600; font-size: 1.12rem; margin: 1.4rem 0 .4rem; }
.legal p, .legal li { font-size: .95rem; }
.legal ul { padding-left: 1.2rem; }

@media (max-width: 760px) {
    .cols { grid-template-columns: minmax(0, 1fr); }
    .page-title { font-size: 1.5rem; }
    header.top { padding: .55rem .9rem; }
    header.top .brand small { display: none; }
    header.top .brand img { height: 36px; }
    .nav-toggle { display: block; }
    header.top .mainnav {
        display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: .15rem;
        background: var(--card); border-bottom: 1px solid var(--line); padding: .5rem .9rem .8rem; box-shadow: 0 10px 18px rgba(28,42,58,.12);
    }
    header.top .mainnav.open { display: flex; }
    header.top .mainnav form { width: 100%; }
    .nav-link-hs { width: 100%; padding: .65rem .75rem; }
    .container { padding: .9rem .75rem; }
    .cal-card { padding: .75rem .4rem; }
    .month-slide { padding: 4px 3px; }
    .cal-head { padding: 0 3px; }
    .cal-nav { padding: 0 .2rem; }
    .cal-nav h1 { font-size: 1.2rem; white-space: nowrap; }
    .cal-head, .cal-grid { gap: 3px; }
    .cal-cell { min-height: 64px; padding: .22rem; border-radius: 8px; }
    .cal-num { font-size: .86rem; }
    .today-badge { display: none; }
    .cal-slots { grid-template-columns: repeat(2, 1fr); }
    .cal-slot { font-size: .56rem; padding: .08rem 0; }
    .cal-slot b { display: none; }
    .legend { padding-left: .2rem; }
    .daynav h1 { font-size: 1.4rem; }
    .semaine { flex-direction: column; align-items: stretch; gap: .3rem; }
    .semaine select { max-width: none; width: 100%; }
}

/* Très petits téléphones : la barre du mois doit tenir sur une ligne. */
@media (max-width: 360px) {
    .cal-nav { gap: .25rem; }
    .cal-nav h1 { font-size: 1rem; }
    .cal-nav .car-btn { width: 34px; height: 34px; }
    .cal-nav .btn.small { padding: .3rem .45rem; font-size: .76rem; }
}
