/* Paywall Préparation Armée — modal deux colonnes (sombre + clair) */

.ca-paywall-dialog {
    position: relative;
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: min(920px, calc(100vw - 24px));
    width: 100%;
    /* Filet de sécurité hauteur : le popup ne dépasse JAMAIS l'écran. Si même
       après compaction (cf. @media max-height plus bas) le contenu reste trop
       haut, c'est la GRILLE qui défile à l'intérieur des coins arrondis — pas
       une scrollbar de fenêtre. dvh pour tenir compte de la barre mobile. */
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    background: transparent;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.ca-paywall-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.ca-paywall-dialog__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
    /* Conteneur de défilement du filet de sécurité : les deux colonnes
       défilent ENSEMBLE (jamais l'une sans l'autre). overflow-x masqué pour
       garder les coins arrondis ; overflow-y auto = barre seulement si besoin. */
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
    overflow-x: hidden;
    overflow-y: auto;
}

@media (max-width: 720px) {
    .ca-paywall-dialog__grid {
        grid-template-columns: 1fr;
    }
}

.ca-paywall-dialog__left {
    background: #121212;
    color: #f5f5f5;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.ca-paywall-dialog__left::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 140%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(200, 162, 76, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.ca-paywall-dialog__kicker {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d7b566;
    margin: 0 0 12px;
    font-weight: 600;
}

.ca-paywall-dialog__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.35rem, 3.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #fff;
}

.ca-paywall-dialog__lead {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.ca-paywall-dialog__bottom {
    position: relative;
    z-index: 1;
}

.ca-paywall-dialog__price-block {
    margin-top: 28px;
    position: relative;
    z-index: 1;
}

/* Preuve sociale (livrable 6C, reformée) — carte façon Mur d'avis vitrine,
   centrée verticalement entre le lead et le prix. Masquée tant que vide. */
.ca-paywall-dialog__social[hidden],
.ca-paywall-dialog__rating[hidden],
.ca-paywall-dialog__reviews[hidden],
.ca-paywall-dialog__review[hidden],
.ca-paywall-dialog__nav[hidden],
.ca-paywall-dialog__dots[hidden] {
    display: none !important;
}

/* flex:1 + center → le bloc occupe et centre l'espace libre entre le lead
   (haut) et le bloc prix (bas). Masqué (display:none) si aucun avis → la
   colonne retombe sur sa répartition d'origine (cf. repli silencieux). */
.ca-paywall-dialog__social {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    margin: 22px 0;
    position: relative;
    z-index: 1;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.ca-paywall-dialog__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
}

.ca-paywall-dialog__stars {
    color: #c8a24c;
    font-size: 1rem;
    letter-spacing: 2px;
    line-height: 1;
}

.ca-paywall-dialog__rating-num {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.ca-paywall-dialog__rating-sep {
    color: rgba(255, 255, 255, 0.3);
}

.ca-paywall-dialog__rating-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.ca-paywall-dialog__reviews {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ca-paywall-dialog__carousel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ca-paywall-dialog__nav {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ca-paywall-dialog__nav:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.ca-paywall-dialog__nav svg {
    display: block;
}

/* La carte d'avis (= #ca-paywall-review). */
.ca-paywall-dialog__review {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1c20;
    animation: caPaywallReviewIn 0.28s ease;
}

/* Fondu + glissement horizontal dans le sens du clic (rejoué via JS) :
   « suivant » (droite) entre par la droite, « précédent » par la gauche.
   --ca-review-dx est posé par paint() ; 0 (points / 1er affichage) = simple fondu. */
@keyframes caPaywallReviewIn {
    from { opacity: 0; transform: translateX(var(--ca-review-dx, 0)); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ca-paywall-dialog__review {
        animation: none;
    }
}

.ca-paywall-dialog__review-stars {
    color: #c8a24c;
    font-size: 0.9rem;
    letter-spacing: 2px;
    line-height: 1;
}

.ca-paywall-dialog__review-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* hauteur réservée = 3 lignes → pas de saut en changeant d'avis. */
    min-height: calc(0.85rem * 1.5 * 3);
}

.ca-paywall-dialog__review-foot {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-paywall-dialog__review-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(200, 162, 76, 0.14);
    color: #d7b566;
}

.ca-paywall-dialog__review-id {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.ca-paywall-dialog__review-author {
    font-weight: 600;
    font-size: 0.82rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ca-paywall-dialog__review-role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ca-paywall-dialog__review-badge {
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #d7b566;
}

.ca-paywall-dialog__review-badge svg {
    flex: 0 0 auto;
}

.ca-paywall-dialog__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.ca-paywall-dialog__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.ca-paywall-dialog__dot:hover {
    background: rgba(255, 255, 255, 0.45);
}

.ca-paywall-dialog__dot.is-active {
    background: #c8a24c;
    transform: scale(1.15);
}

.ca-paywall-dialog__reviews-link {
    align-self: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.3);
}

.ca-paywall-dialog__reviews-link:hover {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.ca-paywall-dialog__price-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 6px;
    font-family: system-ui, sans-serif;
}

.ca-paywall-dialog__price {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.5rem, 6vw, 3.25rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1;
}

.ca-paywall-dialog__guarantee {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: system-ui, sans-serif;
}

.ca-paywall-dialog__guarantee svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.ca-paywall-dialog__right {
    background: #fff;
    color: #111;
    padding: 26px 24px 22px;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.ca-paywall-dialog__features {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    flex: 1;
}

.ca-paywall-dialog__feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 14px;
    padding: 12px 0;
    border-bottom: 1px solid #ececec;
}

.ca-paywall-dialog__feature:first-child {
    padding-top: 0;
}

.ca-paywall-dialog__feature-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: #b0b0b0;
    line-height: 1.35;
}

.ca-paywall-dialog__feature-body {
    min-width: 0;
}

.ca-paywall-dialog__feature-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 4px;
    color: #111;
}

.ca-paywall-dialog__feature-desc {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #555;
}

.ca-paywall-dialog__plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.ca-paywall-plan {
    display: block;
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid #e4e4e4;
    padding: 10px 12px;
    transition: border-color 0.15s, background 0.15s;
}

.ca-paywall-plan:hover {
    border-color: #cfcfcf;
}

.ca-paywall-plan input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ca-paywall-plan__inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.ca-paywall-plan__label {
    font-weight: 700;
    font-size: 0.88rem;
}

.ca-paywall-plan__meta {
    font-size: 0.8rem;
    color: #666;
}

.ca-paywall-plan__price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111;
    white-space: nowrap;
}

.ca-paywall-plan--selected {
    border-color: #c8a24c;
    background: rgba(200, 162, 76, 0.08);
}

.ca-paywall-dialog__cta {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    color: #1a1404;
    background: #c8a24c;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.ca-paywall-dialog__cta:hover {
    background: #b08a38;
}

.ca-paywall-dialog__cta:active {
    transform: scale(0.99);
}

.ca-paywall-dialog__cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ca-paywall-dialog__secondary {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 0.82rem;
    color: #555;
}

.ca-paywall-dialog__secondary a {
    color: #333;
    font-weight: 500;
}

/* Deux liens secondaires empilés (présentation + CGV) : gap resserré
   entre eux pour qu'ils se lisent comme un groupe sous le CTA. */
.ca-paywall-dialog__secondary + .ca-paywall-dialog__secondary {
    margin-top: 8px;
}

.ca-paywall-dialog__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    /* Posé sur la colonne BLANCHE de droite (desktop) → croix sombre. */
    background: rgba(0, 0, 0, 0.06);
    color: #111;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ca-paywall-dialog__close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.ca-paywall-dialog__right-wrap {
    position: relative;
}

@media (max-width: 720px) {
    /* En 1 colonne le bouton est sur la colonne SOMBRE (en haut) → croix claire. */
    .ca-paywall-dialog__close {
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Adaptation à la HAUTEUR de l'écran (point 3 : « parfois trop haut → scroll »).
   Sur écran court le popup RÉTRÉCIT pour tenir (≤ 860px) : on resserre les
   espacements et on raccourcit l'extrait d'avis à 2 lignes. Les avis restent
   TOUJOURS visibles. Sur écran très court, en dernier recours, le filet de
   scroll interne (cf. .ca-paywall-dialog__grid) prend la main : le contenu
   défile DANS le popup, jamais de scrollbar fenêtre.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-height: 860px) {
    .ca-paywall-dialog__grid {
        min-height: 0;
    }
    .ca-paywall-dialog__left {
        padding: 18px 22px;
    }
    .ca-paywall-dialog__right {
        padding: 18px 22px 16px;
    }
    .ca-paywall-dialog__title {
        font-size: clamp(1.25rem, 3vw, 1.6rem);
        margin-bottom: 10px;
    }
    .ca-paywall-dialog__lead {
        font-size: 0.9rem;
        line-height: 1.45;
    }
    .ca-paywall-dialog__social {
        margin: 12px 0;
        gap: 10px;
    }
    .ca-paywall-dialog__review {
        padding: 12px 14px;
        gap: 8px;
    }
    /* Extrait d'avis : 3 → 2 lignes (et hauteur réservée alignée). */
    .ca-paywall-dialog__review-text {
        -webkit-line-clamp: 2;
        min-height: calc(0.85rem * 1.5 * 2);
    }
    .ca-paywall-dialog__price-block {
        margin-top: 14px;
    }
    .ca-paywall-dialog__price {
        font-size: clamp(2rem, 5vw, 2.6rem);
    }
    .ca-paywall-dialog__guarantee {
        margin-top: 10px;
    }
    .ca-paywall-dialog__features {
        margin-bottom: 12px;
    }
    .ca-paywall-dialog__feature {
        padding: 8px 0;
    }
    .ca-paywall-dialog__plans {
        gap: 8px;
        margin-bottom: 10px;
    }
    .ca-paywall-plan {
        padding: 8px 12px;
    }
    .ca-paywall-dialog__cta {
        padding: 12px 18px;
    }
    .ca-paywall-dialog__secondary {
        margin-top: 10px;
    }
}
