/* =====================================================================
   Cérémonie de remise des diplômes - POLYTECH Montpellier
   Charte du nouveau site (Joomla 6) : Poppins, #003366 / #007DB4
   Couleurs assorties aux visuels de la cérémonie : bleu nuit #001331, or #B59154
   ===================================================================== */

/* ---------- Police Poppins hébergée localement (pas d'appel à Google) ---------- */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }

/* ---------- Couleurs et mesures ---------- */
:root {
    --nuit:         #001331;   /* fond des visuels d'en-tête et de pied de page */
    --or:           #B59154;   /* or des confettis (décor uniquement, pas pour du texte) */
    --or-clair:     #E9DCC3;
    --marine:       #003366;   /* bleu principal Polytech */
    --bleu:         #007DB4;   /* bleu secondaire / liens */
    --bleu-clair:   #E6F2F8;
    --fond:         #F3F6F9;
    --texte:        #1E2B38;
    --texte-doux:   #556677;
    --bordure:      #C9D4DF;
    --rouge:        #B3261E;
    --rouge-fond:   #FCEEEE;
    --vert:         #1F7A3A;
    --vert-fond:    #EAF6EE;
    --jaune:        #D9A400;   /* messages de confirmation de l'admin */
    --jaune-fond:   #FFF6D6;
    --rouge-pastel: #FBE3E1;   /* tableaux "en attente / à remettre" */
    --vert-pastel:  #E2F3E7;   /* tableaux "traitées / remises" */
    --orange:       #9A4A00;
    --orange-fond:  #FFF4E5;
    --rayon:        6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
    margin: 0;
    font-family: "Poppins", Arial, Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--texte);
    background-color: var(--nuit);
}

a       { color: var(--bleu); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--marine); }

:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

h2 { font-size: 1.4rem;  font-weight: 600; color: var(--marine); margin: 0 0 1rem; line-height: 1.3; }
h3 { font-size: 1.1rem;  font-weight: 600; color: var(--marine); margin: 1.5rem 0 .5rem; }

/* ---------- Lien d'évitement (accessibilité clavier) ---------- */
.lien-evitement {
    position: absolute; left: -9999px; top: 0;
    background: var(--marine); color: #FFFFFF; padding: .5rem 1rem; z-index: 10;
}
.lien-evitement:focus { left: 1rem; top: 1rem; }

/* ---------- Gabarit ---------- */
.conteneur        { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 1.25rem; }
.conteneur-large  { max-width: 1280px; }

/* Texte réservé aux lecteurs d'écran (le titre est déjà dans le visuel) */
.visuellement-cache {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* En-tête : visuel de la cérémonie sur le bleu nuit de l'image */
.entete { background: var(--nuit); text-align: center; line-height: 0; }
.entete-lien { display: inline-block; max-width: 100%; }
.entete-visuel { display: block; width: 600px; max-width: 100%; height: auto; margin: 0 auto; }
.admin .entete-visuel { width: 400px; }
/* Sur grand écran, les bords du visuel se fondent dans le fond bleu nuit */
@media (min-width: 601px) {
    .entete-visuel, .pied-visuel {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
                mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
    }
}
@media (min-width: 401px) {
    .admin .entete-visuel {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
                mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
    }
}

/* Zone de contenu : carte blanche posée sous le visuel */
main.conteneur {
    background: #FFFFFF;
    margin: 0 auto 2.5rem;
    padding: 0 2.5rem 2.25rem;
    border-radius: 0 0 var(--rayon) var(--rayon);
    border-top: 4px solid var(--or);
}
.admin main.conteneur { margin-top: 0; }
main > *:last-child { margin-bottom: 0; }

/* Date et lieu, en tête de la carte */
.infos-evenement {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 2.5rem;
    margin: 0 -2.5rem 2rem; padding: 1rem 2.5rem;
    background: #F7F3EA; border-bottom: 1px solid var(--or-clair);
    color: var(--nuit); text-align: center;
}
.infos-date { font-weight: 600; }
.admin .infos-evenement { margin-bottom: 1.5rem; padding-top: .6rem; padding-bottom: .6rem; font-size: .9rem; }

/* Pied de page : visuel puis coordonnées, sur le même bleu nuit */
.pied { background: var(--nuit); color: #FFFFFF; font-size: .9rem; text-align: center; }
.pied-visuel { display: block; width: 600px; max-width: 100%; height: auto; margin: 0 auto; }
.pied-interieur { padding-top: 1rem; padding-bottom: 1.25rem; text-align: center; }
.pied-interieur p { margin: 0; }
.pied a { color: #FFFFFF; }
.pied-copyright { margin: 0; padding: .9rem 1.25rem; text-align: center; background: #000B1F; font-size: .8rem; color: #C9D2E0; }

/* ---------- Textes ---------- */
.intro     { font-size: 1.05rem; }
.aide      { font-size: .875rem; color: var(--texte-doux); margin: .25rem 0 0; }
.important { font-weight: 600; color: var(--marine); }
.obligatoire { color: var(--rouge); }
.mention-obligatoire { font-size: .875rem; color: var(--texte-doux); }

/* Encadré d'information (règles du cocktail, retrait des invitations...) */
.encadre {
    background: var(--bleu-clair);
    border-left: 4px solid var(--bleu);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--rayon) var(--rayon) 0;
    margin: 0 0 1.25rem;
}
.encadre p { margin: 0 0 .5rem; }
.encadre p:last-child { margin-bottom: 0; }

/* ---------- Messages ---------- */
.message { padding: .9rem 1.25rem; border-radius: var(--rayon); margin: 0 0 1.5rem; border-left: 4px solid; }
.message p  { margin: 0; }
.message ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.message-erreur { background: var(--rouge-fond);  border-color: var(--rouge);  color: #5C130F; }
.message-succes { background: var(--vert-fond);   border-color: var(--vert);   color: #124522; }
.message-alerte { background: var(--orange-fond); border-color: var(--orange); color: #5A2B00; }
/* noms utilisés par l'administration */
.erreur { background: var(--rouge-fond);  border-left: 4px solid var(--rouge);  padding: .9rem 1.25rem; border-radius: var(--rayon); margin: 0 0 1.5rem; }
.succes { background: var(--jaune-fond);  border-left: 4px solid var(--jaune);  padding: .9rem 1.25rem; border-radius: var(--rayon); margin: 0 0 1.5rem; color: #4D3B00; }
.alerte { background: var(--orange-fond); border-left: 4px solid var(--orange); padding: .9rem 1.25rem; border-radius: var(--rayon); margin: 0 0 1.5rem; }

/* ---------- Formulaires ---------- */
form { margin: 0; }

.section-form {
    border: 0; border-top: 1px solid var(--or-clair);
    margin: 2rem 0 0; padding: 1.5rem 0 0;
}
.section-form > legend {
    padding: 0; font-size: 1.15rem; font-weight: 600; color: var(--marine);
}
.etape {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: var(--or); color: var(--nuit); font-weight: 700; font-size: .95rem; margin-right: .5rem;
}

.champ { margin: 0 0 1.25rem; }
.champ > label, .question {
    display: block; font-weight: 500; margin: 0 0 .35rem;
}
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
    font: inherit;
    color: var(--texte);
    width: 100%;
    max-width: 100%;
    padding: .6rem .75rem;
    border: 1px solid #8FA1B3;
    border-radius: var(--rayon);
    background: #FFFFFF;
}
input[type="number"] { width: 7rem; }
.champ-court { max-width: 12rem; }
input:focus, select:focus, textarea:focus { border-color: var(--bleu); outline: 3px solid rgba(0,125,180,.35); outline-offset: 0; }

/* Groupes de boutons radio */
.choix { border: 0; margin: 0 0 1.25rem; padding: 0; }
.choix > legend { font-weight: 500; padding: 0; margin: 0 0 .5rem; }
.option {
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .65rem .9rem; margin: 0 0 .5rem;
    border: 1px solid var(--bordure); border-radius: var(--rayon); cursor: pointer;
}
.option:hover { border-color: var(--bleu); background: #FAFCFE; }
.option input { margin: .3rem 0 0; width: 1.1rem; height: 1.1rem; accent-color: var(--marine); flex-shrink: 0; }
.option:has(input:checked) { border-color: var(--marine); background: var(--bleu-clair); }

/* Boutons */
.actions { margin-top: 2rem; }
input[type="submit"], .bouton {
    font: inherit; font-weight: 600;
    display: inline-block;
    padding: .75rem 1.75rem;
    border: 0; border-radius: var(--rayon);
    background: var(--nuit); color: #FFFFFF;
    cursor: pointer; text-decoration: none;
}
input[type="submit"]:hover, .bouton:hover { background: var(--bleu); color: #FFFFFF; }
.bouton-secondaire { background: #FFFFFF; color: var(--marine); border: 1px solid var(--marine); }
.bouton-danger { background: var(--rouge); }

/* Champ piège anti-robot : invisible */
.hp { display: none; }

/* Récapitulatif (page merci) */
.recap { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.recap li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--bordure); }
.recap strong { color: var(--marine); font-size: 1.15rem; }

/* ---------- Administration ---------- */
.menu-admin { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.menu-admin a {
    display: block; padding: .45rem 1rem; border-radius: var(--rayon);
    background: var(--bleu-clair); color: var(--marine); text-decoration: none; font-weight: 500; font-size: .9rem;
}
.menu-admin a:hover, .menu-admin a[aria-current="page"] { background: var(--marine); color: #FFFFFF; }

.admin main table { border-collapse: collapse; }
.admin main td { vertical-align: top; }

.table-defilante { overflow-x: auto; margin: 0 0 1.5rem; }
.liste { border-collapse: collapse; width: 100%; font-size: .875rem; }
.liste th {
    background: var(--marine); color: #FFFFFF; font-weight: 500; text-align: left;
    padding: .55rem .6rem; border: 1px solid var(--marine);
}
.liste tr.vert th { background: var(--vert); border-color: var(--vert); }
.liste td { padding: .5rem .6rem; border: 1px solid var(--bordure); text-align: left; }
.liste tr:nth-child(even) td { background: #F8FAFC; }
.liste td.nb { text-align: center; white-space: nowrap; }

/* En-têtes de tableaux : rouge pastel = en attente / à remettre ; vert pastel = traitées / remises.
   Les lignes restent blanches. */
.liste-attente th { background: var(--rouge-pastel); color: #7A1C16; border-color: #E8C2BE; font-weight: 600; }
.liste-traitee th { background: var(--vert-pastel);  color: #15572A; border-color: #BCDDC6; font-weight: 600; }

.compteurs { border-collapse: collapse; width: 100%; max-width: 760px; }
.compteurs td { padding: .4rem .75rem; border-bottom: 1px solid var(--bordure); }
.compteurs td:last-child { text-align: right; white-space: nowrap; }

.jauge-ok { color: var(--vert); font-weight: 600; }
.jauge-ko { color: var(--rouge); font-weight: 600; }

.bouton-lien {
    background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; font-weight: 600;
    color: var(--bleu); text-decoration: underline; cursor: pointer;
}
.bouton-lien:hover { color: var(--marine); background: none; }
.admin input[type="submit"].bouton-lien { padding: 0; background: none; color: var(--bleu); }

.rouge { color: var(--rouge); }

/* ---------- Petits écrans ---------- */
@media (max-width: 640px) {
    .grille-2 { grid-template-columns: 1fr; }
    main.conteneur { padding: 0 1.25rem 1.5rem; border-radius: 0; margin-bottom: 0; }
    .infos-evenement { margin-left: -1.25rem; margin-right: -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Les grands tableaux de l'admin défilent horizontalement sur petit écran */
.admin main { overflow-x: auto; }
.admin main form > table td, .admin main > form > table td { padding: .35rem .5rem; }

/* ---------- Connexion à l'administration ---------- */
.form-connexion { max-width: 26rem; }
input[type="password"] {
    font: inherit; color: var(--texte); width: 100%;
    padding: .6rem .75rem; border: 1px solid #8FA1B3; border-radius: var(--rayon); background: #FFFFFF;
}
input[type="password"]:focus { border-color: var(--bleu); outline: 3px solid rgba(0,125,180,.35); outline-offset: 0; }
.barre-session { margin: -0.75rem 0 1.5rem; font-size: .875rem; color: var(--texte-doux); }
.liste-attente td, .liste-attente tr:nth-child(even) td,
.liste-traitee td, .liste-traitee tr:nth-child(even) td { background: #FFFFFF; }

/* En-têtes groupés (Cérémonie / Cocktail apéritif) dans les tableaux de demandes */
.liste th.groupe { text-align: center; }

/* Encadré de la règle des places, formulaire étudiant */
.encadre-regle { border-left-color: var(--or); background: #F7F3EA; margin-top: 1.5rem; }

/* Barre de recherche des pages de gestion */
.recherche { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1.5rem; }
.recherche label { width: 100%; font-weight: 500; }
.recherche input[type="text"] { flex: 1 1 20rem; width: auto; }
.recherche input[type="submit"] { padding: .6rem 1.25rem; }

/* Tableau de saisie des places (page Modifier) */
.tableau-places { width: auto; margin: 0 0 1rem; }
.tableau-places th[scope="row"] { background: #F7F3EA; color: var(--nuit); text-align: left; border: 1px solid var(--bordure); }
.tableau-places td { text-align: center; }
input.champ-nombre { width: 6rem; }
.admin textarea { width: 100%; }
