/* Charte graphique Téléthon */
@font-face {
    font-family: "Fredoka";
    src: url("/fonts/Fredoka.ttf") format("truetype");
    font-weight: 300 700;
    font-stretch: 75% 125%;
    font-display: swap;
}

:root {
    --t-rouge: #E2001A;
    --t-rouge-fonce: #B00014;
    --t-bleu: #0B3D91;
    --t-bleu-nuit: #061E4A;
    --t-jaune: #FFD200;
    --t-blanc: #FFFFFF;
    --t-gris: #F2F4F8;
    --t-vert: #1DB954;
    --t-or: #FFC93C;
    --t-argent: #C9D1DC;
    --t-bronze: #D9895B;
    --t-rayon: 16px;
    --t-ombre: 0 6px 18px rgba(6, 30, 74, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Fredoka", system-ui, sans-serif;
    color: var(--t-bleu-nuit);
    background: var(--t-gris);
}

body { overflow-x: hidden; }

/* Pages bénévole / admin */
.t-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--t-blanc) 0%, var(--t-gris) 100%);
}

.t-bandeau {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--t-rouge);
    color: var(--t-blanc);
}

.t-liseret { height: 5px; background: var(--t-jaune); }

.t-bandeau-marque { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.t-coeur { width: 30px; height: 28px; flex: none; }
.t-bandeau-titre { font-size: 1.25rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-logo { height: 32px; width: auto; border-radius: 6px; background: var(--t-blanc); padding: 2px; }
.t-bandeau-utilisateur { display: flex; align-items: center; gap: .6rem; margin: 0; }
.t-prenom { font-weight: 500; }

.t-bouton-discret {
    font: inherit;
    color: var(--t-blanc);
    background: transparent;
    border: 2px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    padding: .3rem .8rem;
    cursor: pointer;
}

.t-contenu { padding: 1rem; max-width: 960px; margin: 0 auto; }

/* Cartes et formulaires */
.t-carte {
    background: var(--t-blanc);
    border-radius: var(--t-rayon);
    box-shadow: var(--t-ombre);
    padding: 1.25rem;
}

.t-carte-centree { max-width: 440px; margin: 1.5rem auto; text-align: center; }
.t-grand-titre { font-size: 2rem; color: var(--t-rouge); margin: 0 0 1rem; }
.t-erreur { color: var(--t-rouge-fonce); font-weight: 600; }

.t-formulaire { display: flex; flex-direction: column; gap: .5rem; text-align: left; }
.t-formulaire label { font-weight: 500; }
.t-formulaire input {
    font: inherit;
    font-size: 1.25rem;
    min-height: 56px;
    padding: .5rem .9rem;
    border: 2px solid var(--t-argent);
    border-radius: var(--t-rayon);
    width: 100%;
}
.t-formulaire input:focus { outline: 3px solid var(--t-jaune); border-color: var(--t-bleu); }
.t-formulaire .t-bouton { margin-top: .75rem; }

/* Boutons */
.t-bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    min-height: 56px;
    padding: .6rem 1.5rem;
    color: var(--t-blanc);
    background: var(--t-rouge);
    border: 0;
    border-radius: var(--t-rayon);
    box-shadow: var(--t-ombre);
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease;
}
.t-bouton:hover { background: var(--t-rouge-fonce); }
.t-bouton:active { transform: scale(.97); }
.t-bouton:disabled { opacity: .5; cursor: not-allowed; }
.t-bouton-secondaire { background: var(--t-bleu); }
.t-bouton-secondaire:hover { background: var(--t-bleu-nuit); }
.t-bouton-danger { background: var(--t-rouge-fonce); }

/* Toasts */
.t-toasts {
    position: fixed;
    top: .75rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    z-index: 2000;
    pointer-events: none;
}
.t-toast {
    padding: .8rem 1rem;
    border-radius: var(--t-rayon);
    color: var(--t-blanc);
    font-weight: 500;
    box-shadow: var(--t-ombre);
    animation: t-entree .25s ease-out;
}
.t-toast-succes { background: var(--t-vert); }
.t-toast-erreur { background: var(--t-rouge); }
.t-toast-info { background: var(--t-bleu); }

/* Modale de confirmation */
.t-modale-fond {
    position: fixed;
    inset: 0;
    background: rgba(6, 30, 74, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1500;
}
.t-modale {
    background: var(--t-blanc);
    border-radius: var(--t-rayon);
    box-shadow: var(--t-ombre);
    padding: 1.25rem;
    width: min(100%, 420px);
}
.t-modale h2 { margin-top: 0; color: var(--t-rouge); }
.t-modale-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }

/* Écran d'affichage TV */
.t-affichage {
    min-height: 100vh;
    background: var(--t-bleu-nuit);
    color: var(--t-blanc);
    overflow: hidden;
}

@keyframes t-entree {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .t-bandeau-titre { font-size: 1.05rem; }
    .t-prenom { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Administration (T10) */
.ad { max-width: 1100px; margin: 0 auto; }
.ad-onglets { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; }
.ad-onglet { font: inherit; font-weight: 600; padding: .6rem 1rem; border: 0; border-radius: var(--t-rayon) var(--t-rayon) 0 0; background: var(--t-argent); color: var(--t-bleu-nuit); cursor: pointer; white-space: nowrap; }
.ad-onglet.actif { background: var(--t-rouge); color: var(--t-blanc); }
.ad-corps h2 { margin-top: 0; color: var(--t-rouge); }
.ad-barre { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0; }
.ad-barre input, .ad-barre select, .ad-table input, .ad-table select, .ad-raz { font: inherit; padding: .4rem .6rem; border: 2px solid var(--t-argent); border-radius: 10px; min-width: 0; }
.ad-barre input { flex: 1 1 10rem; }
.ad-btn { font: inherit; font-weight: 600; padding: .45rem .9rem; color: var(--t-blanc); background: var(--t-rouge); border: 0; border-radius: 10px; cursor: pointer; }
.ad-btn:disabled { opacity: .5; cursor: not-allowed; }
.ad-sec { background: var(--t-bleu); }
.ad-danger { background: var(--t-rouge-fonce); }
.ad-defile { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table th, .ad-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--t-gris); }
.ad-table th { color: var(--t-bleu); }
.ad-actions { white-space: nowrap; display: flex; gap: .4rem; }
.ad-resume { font-weight: 600; color: var(--t-bleu); }
.ad-note { color: var(--t-bleu); font-style: italic; }
.ad-pagination { justify-content: center; }

/* T11 – écran TV : le bandeau d'erreur Blazor reste masqué tant que Blazor ne l'affiche pas. */
.t-affichage ~ #blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    padding: .6rem 1.25rem;
    font-size: 20px;
    color: var(--t-bleu-nuit);
    background: var(--t-jaune);
}
