/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --jaune: #fdc30e;
    --noir: #000000;
    --vert-fonce: #01462d;
    --vert-clair: #03d660;
    --blanc: #ffffff;
    --gris-fond: #f4f4f4;
    --gris-texte: #333333;
    --gris-border: #dddddd;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.10);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--vert-fonce);
    color: var(--gris-texte);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

ul {
    list-style: none;
}

/* =============================================
   LOGO BLOC
   ============================================= */
.logo-bloc {
    text-align: center;
    padding: 24px 16px 8px;
}

.logo-bloc img {
    max-width: 160px;
    width: 60%;
}

.sous-logo {
    font-size: 0.78rem;
    color: #777;
    margin-top: 6px;
}

.sous-logo a {
    color: var(--vert-fonce);
    text-decoration: underline;
}

/* =============================================
   PAGE LOGIN
   ============================================= */
.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.formation-titre {
    text-align: center;
    padding: 12px 20px 20px;
    background: var(--jaune);
}

.formation-titre h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--noir);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.formation-titre h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--noir);
    margin-top: 4px;
}

.champ-code {
    padding: 24px 24px 8px;
}

.champ-code label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gris-texte);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.champ-code input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    border: 2px solid var(--gris-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--gris-fond);
}

.champ-code input:focus {
    border-color: var(--jaune);
    background: var(--blanc);
}

.erreur {
    margin: 10px 24px 0;
    padding: 10px 14px;
    background: #fff0f0;
    border-left: 4px solid #e74c3c;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #c0392b;
}

.btn-connexion {
    display: block;
    width: calc(100% - 48px);
    margin: 16px 24px;
    padding: 14px;
    background: var(--jaune);
    color: var(--noir);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

.btn-connexion:active {
    transform: scale(0.98);
    background: #e6af00;
}

.contact-bloc {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--gris-border);
    text-align: center;
}

.contact-bloc p {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 10px;
}

/* =============================================
   BOUTONS WHATSAPP / EMAIL
   ============================================= */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #25d366;
    color: var(--blanc);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.btn-whatsapp svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-whatsapp:active { background: #1ebe5d; }

.btn-email {
    display: block;
    padding: 10px 20px;
    background: var(--gris-fond);
    color: var(--gris-texte);
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid var(--gris-border);
}

/* =============================================
   PAGE DASHBOARD
   ============================================= */
.page-dashboard {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
}

.dashboard-card {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
}

.bienvenue {
    padding: 16px 24px;
    background: var(--jaune);
    font-size: 1rem;
    text-align: center;
}

.fichier-pdf {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gris-border);
    text-align: center;
}

.fichier-pdf h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--vert-fonce);
}

.fichier-pdf p {
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 12px;
}

.btn-download {
    display: inline-block;
    padding: 10px 20px;
    background: var(--vert-fonce);
    color: var(--blanc);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-download:active { background: #022e1e; }

.statut-acces {
    padding: 20px 24px;
}

.heure-actuelle {
    font-size: 0.88rem;
    color: #777;
    text-align: center;
    margin-bottom: 16px;
}

.statut {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
    line-height: 1.7;
}

.statut p { margin-bottom: 4px; }

.statut-actif {
    background: #eafaf1;
    border-left: 4px solid var(--vert-clair);
}

.statut-attente {
    background: #fffbea;
    border-left: 4px solid var(--jaune);
}

.statut-termine {
    background: #f4f4f4;
    border-left: 4px solid #aaa;
}

.statut-planifier {
    background: #fff8e1;
    border-left: 4px solid var(--jaune);
}

.avertissement {
    color: #c0392b;
    font-size: 0.85rem;
    font-style: italic;
}

.conseils {
    margin-top: 16px;
    font-size: 0.88rem;
}

.conseils ul {
    margin-top: 8px;
    padding-left: 4px;
}

.conseils ul li {
    padding: 4px 0 4px 16px;
    position: relative;
}

.conseils ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--vert-clair);
    font-weight: 700;
}

.btn-videos {
    display: block;
    padding: 16px;
    background: var(--jaune);
    color: var(--noir);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
}

.btn-videos:active {
    transform: scale(0.98);
    background: #e6af00;
}

.deconnexion {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid var(--gris-border);
}

.deconnexion a {
    font-size: 0.85rem;
    color: #aaa;
    text-decoration: underline;
}

/* =============================================
   PAGE VIDEOS
   ============================================= */
.page-videos {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.videos-header {
    background: var(--noir);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.videos-header .logo-small {
    height: 36px;
    width: auto;
    pointer-events: none;
}

.rebours-header {
    color: var(--blanc);
    font-size: 0.85rem;
    text-align: right;
}

.rebours-header strong {
    color: var(--jaune);
    font-size: 1rem;
}

.videos-intro {
    background: var(--blanc);
    padding: 20px 16px;
    border-bottom: 2px solid var(--gris-border);
}

.qualite-choix p {
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
}

.qualite-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-qualite {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid var(--gris-border);
    border-radius: 8px;
    background: var(--gris-fond);
    font-size: 0.88rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.4;
}

.btn-qualite.actif {
    border-color: var(--jaune);
    background: #fffbea;
    font-weight: 700;
}

.btn-qualite small {
    display: block;
    font-size: 0.76rem;
    color: #777;
    font-weight: 400;
    margin-top: 4px;
}

.videos-infos p {
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 4px;
}

/* =============================================
   MODULES ACCORDION
   ============================================= */
.modules-liste {
    background: var(--gris-fond);
}

.module {
    border-bottom: 1px solid var(--gris-border);
    background: var(--blanc);
}

.module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.module-header:active {
    background: #f9f9f9;
}

.module-num {
    width: 28px;
    height: 28px;
    background: var(--vert-fonce);
    color: var(--blanc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.module-titre {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--noir);
}

.module-chevron {
    color: #aaa;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.module-body {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--gris-border);
}

.module-body.ouvert {
    display: block;
}

.module-desc {
    font-size: 0.88rem;
    color: #555;
    margin: 12px 0;
}

/* =============================================
   LECTEUR VIDEO
   ============================================= */
.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    display: block;
    max-height: 60vh;
    object-fit: contain;
}

/* =============================================
   OUTILS
   ============================================= */
.liste-outils {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.liste-outils li {
    font-size: 0.9rem;
    line-height: 1.6;
}

.liste-outils li small {
    color: #777;
    display: block;
    margin: 2px 0 8px;
}

/* =============================================
   RETOUR
   ============================================= */
.retour-dashboard {
    padding: 20px 16px;
    text-align: center;
}

.retour-dashboard a {
    font-size: 0.88rem;
    color: var(--blanc);
    text-decoration: underline;
    opacity: 0.7;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 480px) {
    .formation-titre h2 {
        font-size: 0.95rem;
    }

    .qualite-btns {
        flex-direction: column;
    }

    .videos-header {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .rebours-header {
        text-align: center;
    }
}