/* Thème « verre dépoli » du hub. Les couleurs de l'école (--couleur, --sur-couleur, --couleur-texte, --secondaire,
   --secondaire-texte) sont écrites dans la page par App\Support\Theme, contraste vérifié. */
:root {
    --texte: #1f1a17; --texte-doux: rgba(31, 26, 23, .66);
    --verre: rgba(255, 255, 255, .52); --verre-fort: rgba(255, 255, 255, .74); --bord-verre: rgba(255, 255, 255, .7);
    --bord: rgba(31, 26, 23, .12); --ombre: 0 10px 40px rgba(60, 40, 20, .14);
    --fond-1: #eef0f4; --fond-2: #e3e6ec; --fond-3: #f8f9fb;
    --erreur: #a3261b; --ok: #17663a; --voile-photo: rgba(255, 255, 255, .35);
}
/* Sombre : choisi dans Mon compte, ou « auto » quand l'ordinateur est en mode sombre. Les deux blocs doivent rester identiques. */
:root[data-apparence="sombre"] {
    --texte: #f3eee9; --texte-doux: rgba(243, 238, 233, .68);
    --verre: rgba(32, 30, 34, .58); --verre-fort: rgba(42, 40, 46, .78); --bord-verre: rgba(255, 255, 255, .12);
    --bord: rgba(255, 255, 255, .14); --ombre: 0 10px 40px rgba(0, 0, 0, .45);
    --fond-1: #1a1c20; --fond-2: #212329; --fond-3: #0f1013;
    --erreur: #ff8a80; --ok: #7bd99b; --voile-photo: rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
    :root[data-apparence="auto"] {
        --texte: #f3eee9; --texte-doux: rgba(243, 238, 233, .68);
        --verre: rgba(32, 30, 34, .58); --verre-fort: rgba(42, 40, 46, .78); --bord-verre: rgba(255, 255, 255, .12);
        --bord: rgba(255, 255, 255, .14); --ombre: 0 10px 40px rgba(0, 0, 0, .45);
        --fond-1: #1a1c20; --fond-2: #212329; --fond-3: #0f1013;
        --erreur: #ff8a80; --ok: #7bd99b; --voile-photo: rgba(0, 0, 0, .45);
    }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: system-ui, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.5; color: var(--texte); background: var(--fond-3); }

/* Fond : dégradé aux couleurs de l'école, ou sa photo floutée sous un voile. */
.fond { position: fixed; inset: 0; z-index: -1; overflow: hidden;
    background: radial-gradient(60% 60% at 15% 20%, color-mix(in srgb, var(--couleur) 28%, transparent), transparent 70%),
                radial-gradient(70% 60% at 80% 90%, color-mix(in srgb, var(--secondaire) 24%, transparent), transparent 70%),
                linear-gradient(160deg, var(--fond-1), var(--fond-3)); }
.fond.photo { background-size: cover; background-position: center; }
.fond.photo::before { content: ""; position: absolute; inset: -30px; background: inherit; filter: blur(16px) saturate(1.1); }
.fond.photo::after { content: ""; position: absolute; inset: 0; background: var(--voile-photo); }

.verre { background: var(--verre); border: 1px solid var(--bord-verre); border-radius: 26px; box-shadow: var(--ombre);
    backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); }
svg.icone { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Pages sans menu (connexion…) : une carte en verre au centre. */
body.simple { display: grid; place-items: center; }
body.simple main { width: 100%; max-width: 460px; padding: 16px; }
body.simple main.large { max-width: 1100px; }
body.simple .page { padding: 32px; }
nav.simple { display: flex; justify-content: flex-end; margin-bottom: 12px; }
nav.simple button { margin: 0; width: auto; padding: 8px 16px; }
.logo img { display: block; max-height: 64px; max-width: 220px; margin-bottom: 14px; }

/* Barre du haut */
.haut { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 12px; margin: 16px 16px 0; border-radius: 999px; }
.haut .logo img { max-height: 38px; max-width: 120px; margin: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); flex: none; }
.haut .bonjour { font-weight: 600; line-height: 1.2; }
.haut .espace { font-size: .85rem; color: var(--texte-doux); }
.haut .droite { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.rond { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--verre-fort); border: 1px solid var(--bord-verre); position: relative; color: var(--texte); text-decoration: none; cursor: pointer; }
.rond[aria-current] { background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); }
.pastille { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

/* Rail du menu (ordinateur) */
.cadre { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 18px; padding: 18px 16px 32px; }
.rail { position: sticky; top: 18px; z-index: 20; align-self: start; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 22px; max-height: calc(100vh - 36px); overflow-y: auto; }
.rail a, .rail button { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 7px 10px; border: 1px solid transparent; border-radius: 12px; color: var(--texte-doux); background: transparent; font: inherit; font-size: .9rem; line-height: 1.25; text-align: left; text-decoration: none; cursor: pointer; }
.rail a svg, .rail button svg { flex: none; width: 18px; height: 18px; }
.rail a:hover, .rail button:hover { background: var(--verre-fort); color: var(--texte); }
.rail a[aria-current] { background: var(--verre-fort); color: var(--texte); font-weight: 600; border-color: var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.rail summary { padding: 9px 10px 4px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--secondaire-texte); cursor: pointer; border-radius: 10px; }
.rail summary:hover { color: var(--texte); }
.rail details[open] { margin-bottom: 4px; }
.rail form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--bord); }
@media (max-width: 1100px) { .cadre { grid-template-columns: 200px minmax(0, 1fr); } }

.page { padding: 28px; min-width: 0; }
.page > h1, .titre-page h1 { font-size: 1.8rem; font-weight: 650; letter-spacing: -.02em; margin: 0 0 18px; }
.sous { margin: -12px 0 20px; color: var(--texte-doux); }

/* Barre du bas et tiroir (téléphone) */
.pilule, .tiroir { display: none; }
@media (max-width: 800px) {
    .cadre { grid-template-columns: 1fr; padding: 12px 12px 110px; }
    .rail { display: none; }
    .haut { margin: 12px 12px 0; }
    .haut .espace { display: none; }
    .page { padding: 20px; }
    .page > h1, .titre-page h1 { font-size: 1.45rem; }
    .pilule { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; justify-content: space-around; padding: 6px; border-radius: 999px; }
    .pilule a, .pilule label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 999px; font-size: .7rem; font-weight: 500; color: var(--texte-doux); text-decoration: none; cursor: pointer; min-width: 0; }
    .pilule a[aria-current] { background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); }
    #menu-ouvert:checked ~ .tiroir { display: block; position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 30; padding: 12px; max-height: 70vh; overflow-y: auto; }
    .tiroir h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--secondaire-texte); margin: 10px 12px 4px; }
    .tiroir a, .tiroir button { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 12px; border: 0; border-radius: 16px; background: transparent; color: var(--texte); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
    .tiroir a[aria-current] { background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); }
    .tiroir form { margin: 0; }
}
#menu-ouvert:focus-visible ~ .pilule label[for=menu-ouvert] { outline: 3px solid var(--couleur); }

/* Cartes, textes, formulaires */
.carte { padding: 22px; background: var(--verre-fort); border: 1px solid var(--bord-verre); border-radius: 22px; }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.cartes h2 { margin-top: 0; }
.cartes ul { margin: 0; padding-left: 18px; }
.etiquette { font-size: .82rem; color: var(--texte-doux); margin: 0 0 6px; }
.grand { font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.ecole { margin: 0 0 20px; color: var(--texte-doux); }
.aide { font-size: .9rem; color: var(--texte-doux); }
a { color: inherit; }
.page p a, .liens a, .cartes li a { color: var(--texte); font-weight: 600; }
.liens { margin-top: 16px; font-size: .95rem; }
.erreur { color: var(--erreur); } .ok { color: var(--ok); }
.message { padding: 12px 16px; border-radius: 16px; border: 1px solid currentColor; margin-bottom: 14px; background: var(--verre-fort); }
label { display: block; font-weight: 600; margin: 14px 0 4px; }
.case { display: flex; gap: 8px; align-items: center; font-weight: normal; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=tel], input[type=url], input[type=time], input:not([type]), select, textarea { width: 100%; padding: 11px 16px; font: inherit; font-size: 1rem; color: var(--texte); background: var(--verre-fort); border: 1px solid var(--bord); border-radius: 14px; }
input[type=color] { width: 80px; height: 44px; padding: 3px; border: 1px solid var(--bord); border-radius: 14px; background: var(--verre-fort); }
input[type=file] { font: inherit; font-size: .9rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--couleur); width: 18px; height: 18px; }
button { margin-top: 18px; width: 100%; padding: 12px 20px; font: inherit; font-size: 1rem; font-weight: 600; border: 0; border-radius: 999px; background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); cursor: pointer; }
button.discret { background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); }
a.bouton { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 11px 20px; border-radius: 999px; background: var(--verre-fort); color: var(--texte); border: 1px solid var(--bord); box-shadow: 0 2px 10px rgba(0,0,0,.08); backdrop-filter: blur(12px); font-weight: 600; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .actions button, .actions a.bouton { width: auto; margin-top: 0; }
:focus-visible { outline: 3px solid var(--couleur); outline-offset: 2px; }

/* Tableaux */
.defilant { overflow-x: auto; max-width: 100%; border-radius: 18px; background: var(--verre-fort); border: 1px solid var(--bord-verre); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--bord); padding: 10px 12px; text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th.vertical { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 600; padding: 10px 4px; }
td.case-droit { text-align: center; }

/* Éléments particuliers */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lien-copie { word-break: break-all; font-family: ui-monospace, monospace; font-size: .85rem; padding: 10px; border: 1px dashed var(--bord); border-radius: 14px; background: var(--verre-fort); }
code, .codes { font-family: ui-monospace, monospace; }
.codes { columns: 2; padding-left: 18px; }
.qr svg { background: #fff; padding: 10px; border-radius: 16px; max-width: 100%; height: auto; }
details { margin-top: 24px; } summary { cursor: pointer; font-weight: 600; }
.deux-colonnes { display: flex; flex-wrap: wrap; gap: 0 32px; }
.logo-actuel img { max-height: 64px; max-width: 220px; padding: 8px; border: 1px solid var(--bord); border-radius: 14px; }
.logo-actuel.clair img { background: #fff; } .logo-actuel.fonce img { background: #1f232a; }
.logo-actuel.fond img { max-height: 120px; max-width: 320px; padding: 0; }
.voyants { list-style: none; padding: 0; }
.notification { padding: 14px 0; border-bottom: 1px solid var(--bord); }
.notification.nouvelle { border-left: 4px solid var(--couleur); padding-left: 14px; }
fieldset.interrupteur { border: 0; margin: 0; padding: 0; display: flex; gap: 4px 14px; flex-wrap: wrap; }
details.modules { margin-top: 0; } details.modules .case { margin: 6px 0; white-space: nowrap; }
fieldset.bloc { border: 0; padding: 0; margin: 0; min-width: 0; } td input, td select { margin: 0; }
.filtres { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: end; margin-bottom: 8px; } .filtres > div { flex: 1 1 180px; } .filtres button { width: auto; } .confidentiel { border: 1px dashed var(--bord); border-radius: 16px; padding: 4px 16px 16px; margin-top: 18px; }
.semaine { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.jour { background: var(--verre); border: 1px solid var(--bord); border-radius: 18px; padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.jour.aujourdhui { border-color: var(--texte-doux); }
.jour h3 { margin: 0; font-size: .9rem; text-transform: capitalize; }
.seance { display: block; padding: 8px 10px; border-radius: 12px; background: var(--verre-fort); border: 1px solid var(--bord); font-size: .85rem; line-height: 1.35; text-decoration: none; color: var(--texte); }
.seance.brouillon { border-style: dashed; opacity: .85; }
.jour .ajout { margin-top: auto; align-self: center; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--bord); color: var(--texte-doux); }
a.bouton.discret { background: transparent; box-shadow: none; color: var(--texte-doux); }
.qr-bloc { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 12px 0 20px; }
.qr { background: #fff; padding: 12px; border-radius: 18px; line-height: 0; }
.qr svg { width: min(320px, 80vw); height: auto; }
table.fiche th { text-align: left; width: 180px; }
@media print {
    .fond, .haut, .rail, .pilule, .tiroir, .sans-impression, nav { display: none !important; }
    body { background: #fff; color: #000; }
    .cadre { display: block; }
    .page, .verre { background: #fff !important; box-shadow: none !important; border: 0 !important; backdrop-filter: none !important; color: #000; }
}
