/* ============================================================
   modal-cgu.css — Modale Conditions générales
   Source unique : chargé par template/modal-cgu.php
   ============================================================ */

.cgu-modal {
    --cgu-brand: var(--brand, #ff385c);
    --cgu-brand-dark: var(--brand-dark, #e11d48);
    --cgu-brand-soft: var(--brand-soft, #ffe4ea);
    --cgu-surface: var(--surface, #ffffff);
    --cgu-text: var(--text, #1f2430);
    --cgu-text-soft: var(--text-soft, #717171);
    --cgu-text-muted: var(--text-muted, #9ca3af);
    --cgu-border: var(--border, #ececf0);
    --cgu-r-md: var(--r-md, 14px);
    --cgu-r-lg: var(--r-lg, 18px);
    --cgu-shadow: var(--shadow-lg, 0 24px 48px rgba(16, 24, 40, 0.18));
    font-family: var(--font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* ---------- Overlay ---------- */
.cgu-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cgu-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cgu-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ---------- Panneau ---------- */
.cgu-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 600px);
    max-height: min(88dvh, 820px);
    display: flex;
    flex-direction: column;
    background: var(--cgu-surface);
    border-radius: var(--cgu-r-lg);
    border: 1px solid var(--cgu-border);
    box-shadow: var(--cgu-shadow);
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.cgu-modal.active .cgu-modal__panel {
    transform: translateY(0) scale(1);
}

/* ---------- En-tête ---------- */
.cgu-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 18px;
    background: linear-gradient(165deg, var(--cgu-brand-soft) 0%, var(--cgu-surface) 60%);
    border-bottom: 1px solid var(--cgu-border);
    flex-shrink: 0;
}

.cgu-modal__header-main {
    min-width: 0;
    flex: 1;
}

.cgu-modal__eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cgu-brand);
    margin-bottom: 4px;
}

.cgu-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cgu-text);
    line-height: 1.3;
}

.cgu-modal__subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--cgu-text-soft);
    line-height: 1.4;
}

.cgu-modal__close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--cgu-border);
    border-radius: 50%;
    background: var(--cgu-surface);
    color: var(--cgu-text-soft);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cgu-modal__close:hover {
    background: var(--cgu-brand-soft);
    border-color: var(--cgu-brand);
    color: var(--cgu-brand);
    transform: scale(1.05);
}

/* ---------- Corps scrollable ---------- */
.cgu-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px 22px 24px;
    color: var(--cgu-text-soft);
    font-size: 0.9rem;
    line-height: 1.65;
}

.cgu-modal__body h2 {
    color: var(--cgu-text);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.8rem 0 0.6rem;
    padding-top: 0.2rem;
}

.cgu-modal__body h2:first-child {
    margin-top: 0;
}

.cgu-modal__body h3,
.cgu-modal__body h4 {
    color: var(--cgu-brand-dark);
    font-size: 0.88rem;
    font-weight: 600;
    margin: 1.1rem 0 0.45rem;
}

.cgu-modal__body p,
.cgu-modal__body ul,
.cgu-modal__body li {
    font-size: 0.88rem;
    color: var(--cgu-text-soft);
    margin: 0 0 0.65rem;
}

.cgu-modal__body ul {
    margin: 0 0 1rem 1.2rem;
    padding: 0;
}

.cgu-modal__body b,
.cgu-modal__body strong {
    color: var(--cgu-text);
    font-weight: 600;
}

.cgu-modal__body .definition {
    display: block;
    margin-left: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--cgu-brand);
    font-weight: 500;
    font-size: 0.88rem;
}

.cgu-modal__body a {
    color: var(--cgu-brand);
    text-decoration: underline;
    word-break: break-word;
}

.cgu-modal__body a:hover {
    color: var(--cgu-brand-dark);
}

.cgu-modal__body .article-separator {
    border: none;
    border-top: 1px solid var(--cgu-border);
    margin: 1.8rem 0;
}

.cgu-modal__body .email {
    color: var(--cgu-brand);
    font-weight: 500;
    word-break: break-all;
}

/* Bouton d'ouverture (inscription, etc.) */
.btn-open-cgu {
    background: var(--cgu-text);
    color: #fff;
    border: none;
    border-radius: var(--cgu-r-md);
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-open-cgu:hover {
    background: var(--cgu-brand);
    transform: translateY(-1px);
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .cgu-modal {
        padding: 0;
        align-items: flex-end;
    }

    .cgu-modal__panel {
        width: 100%;
        max-height: 92dvh;
        border-radius: var(--cgu-r-lg) var(--cgu-r-lg) 0 0;
        transform: translateY(100%);
    }

    .cgu-modal.active .cgu-modal__panel {
        transform: translateY(0);
    }

    .cgu-modal__header {
        padding: 18px 16px 14px;
    }

    .cgu-modal__title {
        font-size: 1.05rem;
    }

    .cgu-modal__body {
        padding: 16px 16px 20px;
    }
}
