/*
 * Fenêtre de lecture des conditions générales et petits éléments du lot « liens légaux et relecture des CGU »
 * (09/11/2026). Feuille autonome : assets/css/tailwind.css est compilé et ne contient pas toutes les classes utiles.
 * Chargée par CguLectureHelper::lienCss() (une seule balise par page). Balisage : components/CguLecture.php.
 */

/* ---------- Fenêtre ---------- */
.cgu-lecture {
    position: fixed;
    inset: 0;
    z-index: 60000; /* au-dessus du bandeau cookies (z-[50000]) et des fenêtres légales (z-[9999]) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.6);
    font-family: 'Poppins', sans-serif;
}
.cgu-lecture[hidden] { display: none !important; }

.cgu-lecture__boite {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 56rem;
    max-height: 90vh;
    max-height: 90dvh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    color: #374151;
}

.cgu-lecture__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.cgu-lecture__titres { min-width: 0; flex: 1 1 16rem; }
.cgu-lecture__titre {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    color: #13303a;
}
.cgu-lecture__version {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    color: #4b5563;
}
.cgu-lecture__version:empty { display: none; }

.cgu-lecture__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cgu-lecture__bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}
.cgu-lecture__bouton:hover { background: #f9fafb; border-color: #9ca3af; }
.cgu-lecture__bouton:focus-visible,
.cgu-lecture__choix button:focus-visible,
.cgu-lecture__corps:focus-visible,
.cgu-bouton-lien:focus-visible,
.cgu-bouton-relire:focus-visible {
    outline: 2px solid #f59f1d;
    outline-offset: 2px;
}
.cgu-lecture__bouton[disabled] { opacity: 0.5; cursor: not-allowed; }
.cgu-lecture__bouton--principal { background: #f59f1d; border-color: #f59f1d; color: #fff; }
.cgu-lecture__bouton--principal:hover { background: #e08d0b; border-color: #e08d0b; }

.cgu-lecture__choix {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.875rem;
}
.cgu-lecture__choix[hidden] { display: none !important; }
.cgu-lecture__choix button {
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.cgu-lecture__choix button[aria-pressed="true"] {
    background: #13303a;
    border-color: #13303a;
    color: #fff;
}

.cgu-lecture__corps {
    flex: 1 1 auto;
    min-height: 8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.cgu-lecture__etat { margin: 0; color: #4b5563; }
.cgu-lecture__etat--erreur { color: #b91c1c; }

/* Texte des CGU (HTML nettoyé par HTMLSanitizer : p, listes, titres, tableaux, liens) */
.cgu-lecture__texte > * + * { margin-top: 0.75rem; }
.cgu-lecture__texte h1 { font-size: 1.25rem; font-weight: 700; color: #13303a; }
.cgu-lecture__texte h2 { font-size: 1.125rem; font-weight: 700; color: #13303a; }
.cgu-lecture__texte * + h2,
.cgu-lecture__texte * + h3 { margin-top: 1.25rem; }
.cgu-lecture__texte strong { font-weight: 600; }
.cgu-lecture__texte h3,
.cgu-lecture__texte h4,
.cgu-lecture__texte h5,
.cgu-lecture__texte h6 { font-size: 1rem; font-weight: 600; color: #13303a; }
.cgu-lecture__texte ul { list-style: disc; padding-left: 1.5rem; }
.cgu-lecture__texte ol { list-style: decimal; padding-left: 1.5rem; }
.cgu-lecture__texte li + li { margin-top: 0.25rem; }
.cgu-lecture__texte a { color: #b45309; text-decoration: underline; }
.cgu-lecture__texte table { border-collapse: collapse; width: 100%; }
.cgu-lecture__texte th,
.cgu-lecture__texte td { border: 1px solid #d1d5db; padding: 4px 8px; text-align: left; vertical-align: top; }
.cgu-lecture__texte blockquote { border-left: 3px solid #e5e7eb; padding-left: 0.75rem; color: #4b5563; }

@media (max-width: 640px) {
    .cgu-lecture { padding: 8px; align-items: stretch; }
    .cgu-lecture__boite { max-height: none; height: 100%; border-radius: 10px; }
    .cgu-lecture__entete { padding: 12px 14px; }
    .cgu-lecture__actions { width: 100%; }
    .cgu-lecture__actions .cgu-lecture__bouton { flex: 1 1 0; }
    .cgu-lecture__choix { padding: 8px 14px; }
    .cgu-lecture__corps { padding: 14px; }
}

/* ---------- Impression : seulement le texte de la fenêtre ---------- */
@media print {
    body.cgu-lecture-impression > *:not(#cguLectureModal) { display: none !important; }
    body.cgu-lecture-impression {
        overflow: visible !important;
        background: #fff !important;
        display: block !important;
        min-height: 0 !important;
        padding: 0 !important;
    }
    body.cgu-lecture-impression #cguLectureModal {
        position: static !important;
        display: block !important;
        padding: 0 !important;
        background: none !important;
    }
    body.cgu-lecture-impression .cgu-lecture__boite {
        display: block;
        max-width: none;
        max-height: none;
        height: auto;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }
    body.cgu-lecture-impression .cgu-lecture__entete { padding: 0 0 8px; }
    body.cgu-lecture-impression .cgu-lecture__actions,
    body.cgu-lecture-impression .cgu-lecture__choix { display: none !important; }
    body.cgu-lecture-impression .cgu-lecture__corps {
        overflow: visible;
        max-height: none;
        padding: 12px 0 0;
        font-size: 11pt;
    }
}

/* ---------- Étape 5 de l'inscription des relais ---------- */
.cgu-entete-encadre {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 1rem;
}
.cgu-entete-encadre h3 { margin: 0; }
.cgu-pastille {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.cgu-bouton-lien {
    margin-left: auto;
    padding: 4px 0;
    border: 0;
    background: none;
    color: #b45309;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.cgu-bouton-lien:hover { color: #92400e; text-decoration: underline; }
.cgu-lien-texte {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.cgu-lien-texte:hover { color: #92400e; }

/* ---------- Profil relais : bouton « Relire les CGU » ---------- */
.cgu-bouton-relire {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #f59f1d;
    background: #fff;
    color: #b45309;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.cgu-bouton-relire:hover { background: #fff7ed; }
