/* ============================================
   REVITAL QUIZ - Compatible Astra + Spectra
   ============================================ */

.rvq-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    margin: 40px 0;
    max-width: 720px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

h2.rvq-badge {
    display: inline-block;
    background: #E8F0FF;
    color: #0046EC;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 20px;
    margin: 0 0 12px 0;
}

h3.rvq-title {
    color: #1e293b;
    font-size: 1.35em;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px 0;
}

.rvq-subtitle {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 24px;
}

/* Progress bar */
.rvq-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.rvq-dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e2e8f0;
    transition: background 0.4s ease;
}

.rvq-dot--active {
    background: #0046EC;
}

/* Steps - hidden by default, active shown */
.rvq-step {
    display: none;
}

.rvq-step--active {
    display: block;
}

.rvq-step-label {
    font-size: 0.78em;
    color: #0046EC;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rvq-question {
    font-weight: 600;
    font-size: 1.1em;
    color: #1e293b;
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Option buttons (div, not button - Astra proof) */
.rvq-opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rvq-opt {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 0.95em;
    text-align: left;
    cursor: pointer;
    line-height: 1.5;
    color: #334155;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.rvq-opt:hover {
    border-color: #0046EC;
    background: #f8faff;
}

.rvq-opt--correct {
    background: #f0fdf4 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
    font-weight: 600;
    cursor: default;
}

.rvq-opt--wrong {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
    cursor: default;
}

.rvq-opt--dim {
    opacity: 0.4;
    cursor: default;
}

.rvq-opt--disabled {
    pointer-events: none;
}

/* Explanation */
.rvq-explain {
    display: none;
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.92em;
    line-height: 1.6;
    color: #334155;
}

.rvq-explain--ok {
    display: block;
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
}

.rvq-explain--ko {
    display: block;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
}

/* Result */
.rvq-result {
    display: none;
}

.rvq-result--show {
    display: block;
    text-align: center;
    padding: 20px 0;
}

.rvq-result-card {
    padding: 30px;
    border-radius: 12px;
}

.rvq-result-card h3 {
    margin: 0 0 10px;
    font-size: 1.35em;
}

.rvq-result-card p {
    font-size: 1em;
    margin-bottom: 24px;
    line-height: 1.6;
    color: #475569;
}

.rvq-cta {
    display: inline-block;
    padding: 14px 36px;
    background: #0046EC;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1em;
    transition: background 0.2s;
}

.rvq-cta:hover {
    background: #0038BE;
}

/* ============================================
   REVITAL BOXES - Encadrés colorés
   ============================================ */

.rvb-box {
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
    line-height: 1.6;
    font-size: 0.95em;
}

.rvb-box--summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0046EC;
}

.rvb-box--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
}

.rvb-box--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
}

.rvb-box--tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
}

/* Intro du box (ex: "L'essentiel à retenir :") — uniquement en enfant DIRECT, pas les <strong> nichés dans <li> */
.rvb-box > strong:first-child {
    display: block;
    margin-bottom: 4px;
    font-size: 1.05em;
}

/* Masque les <p> vides injectés par wpautop (contournement CSS robuste) */
.rvb-box p:empty,
.rvc-block p:empty,
.rvc-contact p:empty {
    display: none !important;
}

/* Sous-sections inline dans les cas pratiques (La situation. / Le sinistre. / L'issue.) */
.rvb-box--info p > strong:first-child {
    color: #1e40af;
    display: inline-block;
    margin-right: 6px;
    font-weight: 700;
}

.rvb-box--info p {
    margin: 0 0 10px 0;
}

.rvb-box--info p:last-child {
    margin-bottom: 0;
}

/* ============================================
   REVITAL CTA - Bloc d'appel à l'action
   ============================================ */

.rvc-block {
    background: linear-gradient(135deg, #E8F0FF 0%, #D8E6FF 100%);
    border: 1px solid #0046EC;
    border-radius: 12px;
    padding: 28px 32px;
    margin: 40px 0;
    text-align: center;
}

.rvc-title {
    color: #1e293b;
    font-size: 1.3em;
    font-weight: 700;
    margin: 0 0 12px;
}

.rvc-text {
    font-size: 1em;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 20px;
}

.rvc-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #0046EC;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05em;
    transition: background 0.2s;
}

.rvc-btn:hover {
    background: #0038BE;
}

/* ============================================
   REVITAL CONTACT CTA
   ============================================ */

.rvc-contact {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0046EC;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.rvc-contact-text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: #334155;
    flex: 1;
    min-width: 200px;
}

.rvc-contact-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #0046EC;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
    transition: background 0.2s;
}

.rvc-contact-btn:hover {
    background: #0038BE;
}

/* ── Hide "Inline Related Posts" blocks adjacent to CTA / box / quiz / contact / FAQ ── */
.rvc-block + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .rvc-block,
.rvb-box + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .rvb-box,
.rvq-wrap + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .rvq-wrap,
.rvc-contact + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .rvc-contact,
.wp-block-rank-math-faq-block + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .wp-block-rank-math-faq-block,
.rank-math-faq-item + div[style*="clear:both"],
div[style*="clear:both"]:has(.ctaText) + .rank-math-faq-item {
    display: none !important;
}

/* ============================================
   FAQ RÉTRACTABLE (accordion)
   Réponses masquées par défaut, affichées au clic sur la question.
   Tap zone généreuse + a11y clavier + animation max-height.
   ============================================ */

.rank-math-faq-item {
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    padding: 0;
}

.rank-math-faq-item:first-child {
    border-top: 1px solid #e2e8f0;
}

.rank-math-question {
    position: relative;
    cursor: pointer;
    /* Tap zone confortable desktop + mobile (mobile override ci-dessous) */
    padding: 18px 52px 18px 16px;
    min-height: 56px;
    margin: 0;
    font-size: 1.05em;
    line-height: 1.45;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: rgba(42, 82, 152, 0.08);
}

.rank-math-question:hover {
    color: #2a5298;
}

.rank-math-question:focus-visible {
    outline: 2px solid #2a5298;
    outline-offset: -2px;
    background-color: rgba(42, 82, 152, 0.04);
}

.rank-math-question::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.75em;
    font-weight: 300;
    color: #2a5298;
    transition: transform 0.25s ease;
    line-height: 1;
    pointer-events: none;
}

.rank-math-faq-item.rvf-open .rank-math-question::after {
    content: "−";
    transform: translateY(-50%) rotate(180deg);
}

/* Animation via max-height : 3000px couvre largement une FAQ (≈50 lignes
   de texte). On évite grid-template-rows car il casse si la réponse
   contient plusieurs paragraphes frères (chaque <p> devient une ligne
   implicite non animée). */
.rank-math-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.rank-math-faq-item.rvf-open .rank-math-answer {
    max-height: 3000px;
    padding: 0 16px 18px 16px;
}

/* Mobile : tap zone encore plus généreuse + marge extérieure pour éviter
   les mistaps contre le bord de l'écran. */
@media (max-width: 600px) {
    .rank-math-question {
        padding: 20px 52px 20px 14px;
        min-height: 60px;
        font-size: 1em;
    }
    .rank-math-question::after {
        right: 14px;
        font-size: 1.65em;
    }
    .rank-math-faq-item.rvf-open .rank-math-answer {
        padding: 0 14px 18px 14px;
    }
}

/* Second bouton d'un bloc CTA, pose sous le premier.
   Meme forme, poids visuel moindre : l'action principale doit rester celle
   qu'on lit en premier. Le `!important` sur la couleur est necessaire, la
   regle de base de .rvc-btn en porte un. */
.rvc-btn--sec {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 12px auto 0;
    background: #fff;
    color: #0046EC !important;
    box-shadow: inset 0 0 0 1px #0046EC;
}

.rvc-btn--sec:hover {
    background: #E8F0FF;
}
