/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  Cosmélyse V2 — cosmelyse_result_personal.css                         ║
   ║  Onglet "Pour vous" sur /result.php                                   ║
   ╚═══════════════════════════════════════════════════════════════════════╝

   ─── Périmètre ─────────────────────────────────────────────────────────

   Tout ce qui est strictement spécifique à l'onglet "Pour vous" sur
   /result.php (et plus tard /compare.php quand on étendra). Préfixe
   `.rp-*` (Result Personal) pour rester cohérent avec les conventions
   V2 (.program-*, .auth-*, .pwd-*, etc.).

   Réutilise massivement l'existant :
     - Variables CSS (--primary-pink, --primary-green, etc.)
     - .btn / .btn-primary
     - .gradient-text
     - .cosm-card / cosm-card__header / cosm-card__body (du wrapper Notation)

   ─── Onglets en CSS pur ────────────────────────────────────────────────

   Pattern radio + :checked + ~ frères. Ce fichier ne contient PAS la
   logique des onglets eux-mêmes (qui vit sous .rp-tabs-* dans la
   section 1) — celle-ci pilote l'affichage de .rp-tab via :checked
   sur des input radio cachés.
*/


/* ============================================
   1. SYSTÈME D'ONGLETS — radio + :checked
   ============================================ */

/*  Markup attendu :
    <div class="rp-tabs">
       <input type="radio" id="rp-tab-radio-general" class="rp-tabs__radio" checked>
       <input type="radio" id="rp-tab-radio-personal" class="rp-tabs__radio">

       <div class="rp-tabs__nav">
         <label for="rp-tab-radio-general" class="rp-tabs__btn">Note générale</label>
         <label for="rp-tab-radio-personal" class="rp-tabs__btn">Pour vous</label>
       </div>

       <div class="rp-tab" id="rp-tab-general">...</div>
       <div class="rp-tab" id="rp-tab-personal">...</div>
    </div>

    Les radios sont cachés visuellement mais conservés pour l'accessibilité
    (focus clavier OK, navigation Tab fonctionnelle). Les labels servent
    de boutons cliquables.

    L'affichage des panneaux est piloté par le sélecteur :checked +
    frère général. Un seul panneau visible à la fois, le plus simple
    possible côté CSS.                                                    */

/* ============================================
   1. SYSTÈME D'ONGLETS — switch segmenté (style C)
   ============================================ */

/*  Markup attendu :
    <div class="rp-tabs">
       <input type="radio" id="rp-tab-radio-general" class="rp-tabs__radio" checked>
       <input type="radio" id="rp-tab-radio-personal" class="rp-tabs__radio">

       <div class="rp-tabs__nav">
         <label for="rp-tab-radio-general" class="rp-tabs__btn">Note générale</label>
         <label for="rp-tab-radio-personal" class="rp-tabs__btn">Pour vous</label>
       </div>

       <div class="rp-tab" id="rp-tab-general">...</div>
       <div class="rp-tab" id="rp-tab-personal">...</div>
    </div>

    Pattern visuel : "switch segmenté" iOS Settings / Apple Mail.
    Container gris clair avec 2 segments. L'actif est blanc avec ombre
    relevée — l'œil comprend immédiatement qu'on peut basculer.       */

.rp-tabs {
    margin: 0 0 1.5rem 0;
}

/*  Radios cachés visuellement mais conservés pour l'accessibilité
    (focus clavier OK, navigation Tab fonctionnelle).                  */
.rp-tabs__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/*  Container du switch — fond gris clair, padding interne pour faire
    la "rail" autour des segments.                                     */
.rp-tabs__nav {
    display: inline-flex;       /* largeur = contenu, pas pleine largeur */
    gap: 4px;
    padding: 4px;
    background: #f0ece5;        /* gris-beige cohérent avec --cream */
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #e8e2d6;
}

/*  Sur mobile, on prend toute la largeur disponible pour rester
    tappable confortablement.                                          */
@media (max-width: 480px) {
    .rp-tabs__nav {
        display: flex;
        width: 100%;
    }
}

/*  Chaque segment — par défaut transparent, texte sombre lisible.
    Pas d'apparence "bouton" en mode inactif pour rester sobre, mais
    avec un hover clair qui dit "je suis cliquable".                   */
.rp-tabs__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    flex: 1;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;

    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #6b6b6b;
    background: transparent;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border: 1px solid transparent;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.rp-tabs__btn .bi {
    font-size: 1rem;
    line-height: 1;
}

/*  Hover sur inactif — fond blanc semi-transparent + texte sombre.
    Affordance "ce truc réagit, je peux cliquer".                     */
.rp-tabs__btn:hover {
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.55);
}

/*  Bouton ACTIF — fond blanc plein, texte rose Cosmélyse, bordure
    subtile + ombre relevée. Pattern iOS Segmented Control.
    L'œil identifie immédiatement "ce segment est sélectionné".       */
#rp-tab-radio-general:checked   ~ .rp-tabs__nav label[for="rp-tab-radio-general"],
#rp-tab-radio-personal:checked  ~ .rp-tabs__nav label[for="rp-tab-radio-personal"],
#syn-tab-radio-general:checked  ~ .rp-tabs__nav label[for="syn-tab-radio-general"],
#syn-tab-radio-personal:checked ~ .rp-tabs__nav label[for="syn-tab-radio-personal"] {
    color: var(--primary-pink);
    background: #ffffff;
    border-color: #e8e2d6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/*  Au hover sur l'actif on garde le même style (pas de changement),
    pour éviter le double-effet.                                       */
#rp-tab-radio-general:checked   ~ .rp-tabs__nav label[for="rp-tab-radio-general"]:hover,
#rp-tab-radio-personal:checked  ~ .rp-tabs__nav label[for="rp-tab-radio-personal"]:hover,
#syn-tab-radio-general:checked  ~ .rp-tabs__nav label[for="syn-tab-radio-general"]:hover,
#syn-tab-radio-personal:checked ~ .rp-tabs__nav label[for="syn-tab-radio-personal"]:hover {
    background: #ffffff;
    color: var(--primary-pink);
}

/*  Focus clavier visible — anneau rose subtil quand on tabule.        */
.rp-tabs__radio:focus-visible + * .rp-tabs__btn,
.rp-tabs__nav:focus-within {
    outline: 2px solid rgba(255, 107, 157, 0.35);
    outline-offset: 2px;
}

/*  Affichage des panneaux — un seul visible à la fois.                */
.rp-tab { display: none; }

#rp-tab-radio-general:checked   ~ #rp-tab-general,
#rp-tab-radio-personal:checked  ~ #rp-tab-personal,
#syn-tab-radio-general:checked  ~ #syn-tab-general,
#syn-tab-radio-personal:checked ~ #syn-tab-personal {
    display: block;
}

/* ============================================
   2. ENCART "Profil incomplet"
   ============================================ */

.rp-incomplete-hint {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background: rgba(93, 173, 226, 0.08);
    border-left: 3px solid var(--info-blue);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-dark);
    flex-wrap: wrap;
}

.rp-incomplete-hint i {
    color: var(--info-blue);
    flex-shrink: 0;
}

.rp-incomplete-hint > span {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-incomplete-hint__link {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--info-blue);
    background: #fff;
    border: 1px solid var(--info-blue);
    border-radius: 999px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.rp-incomplete-hint__link:hover {
    background: var(--info-blue);
    color: #fff;
}


/* ============================================
   3. SCORE COMPATIBILITÉ — bloc principal
   ============================================ */

/*  Carte "hero" qui sert de point d'ancrage visuel quand l'user arrive
    sur l'onglet. Couleur de fond = level, gros chiffre, label en
    dessous, plein largeur.

    Choix design : un dégradé doux de la couleur de level + texte blanc.
    Plus immersif qu'une carte blanche avec accent coloré, et ça
    distingue clairement le score perso des 4 score cards classiques.   */

.rp-score {
    border-radius: 16px;
    padding: 1.5rem 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.rp-score__heading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.rp-score__heading .bi {
    font-size: 0.9rem;
}

.rp-score__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.rp-score__value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    line-height: 1;
}

.rp-score__number {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    line-height: 1;
}

.rp-score__unit {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0.85;
}

.rp-score__label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

/*  Variantes par level. Choix de couleurs cohérent avec la palette
    Cosmélyse — on évite le noir / gris dépressif pour les niveaux bas
    (l'user reste sur une expérience produit, pas un constat médical).  */

.rp-score--excellent {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--darker-green) 100%);
}

.rp-score--good {
    background: linear-gradient(135deg, #6bb585 0%, var(--primary-green) 100%);
}

.rp-score--fair {
    background: linear-gradient(135deg, var(--info-blue) 0%, #3498db 100%);
}

.rp-score--poor {
    background: linear-gradient(135deg, var(--warn-orange) 0%, #c87f15 100%);
}

.rp-score--bad {
    background: linear-gradient(135deg, var(--danger-red) 0%, #b03a2e 100%);
}

/*  level 'unknown' (cas dégénéré, ne devrait pas arriver dans les
    parcours UI normaux) : style neutre. */
.rp-score--unknown {
    background: linear-gradient(135deg, #b0b0b0 0%, var(--text-muted) 100%);
}


/* ============================================
   4. ALERTES — accordions <details>
   ============================================ */

.rp-alerts {
    margin-bottom: 1.5rem;
}

.rp-alerts__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0 0 0.85rem 0;
}

.rp-alerts__title i {
    color: var(--warn-orange);
}

/*  Une alerte = un <details> stylé en card.                              */

.rp-alert {
    background: #fff;
    border: 1px solid var(--border-default);
    border-left-width: 4px;
    border-radius: 10px;
    margin-bottom: 0.65rem;
    overflow: hidden;            /* contient le radius pour le summary */
    transition: box-shadow 0.15s ease;
}

.rp-alert:last-child {
    margin-bottom: 0;
}

.rp-alert[open] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/*  Variantes par level : couleur du border-left + ton subtil de fond. */

.rp-alert--critical {
    border-left-color: var(--danger-red);
    background: linear-gradient(to right, rgba(231, 76, 60, 0.04), #fff 25%);
}

.rp-alert--warning {
    border-left-color: var(--warn-orange);
    background: linear-gradient(to right, rgba(243, 156, 18, 0.04), #fff 25%);
}

.rp-alert--info {
    border-left-color: var(--info-blue);
    background: linear-gradient(to right, rgba(93, 173, 226, 0.04), #fff 25%);
}


/*  Summary = tête cliquable. On supprime le marqueur natif (▶ par
    défaut sur certains navigateurs) pour mettre notre propre chevron. */

.rp-alert__summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 0.15s ease;
}

.rp-alert__summary::-webkit-details-marker { display: none; }
.rp-alert__summary::marker                 { display: none; content: ''; }

.rp-alert__summary:hover {
    background: rgba(0, 0, 0, 0.02);
}

.rp-alert__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.rp-alert--critical .rp-alert__icon {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger-red);
}

.rp-alert--warning .rp-alert__icon {
    background: rgba(243, 156, 18, 0.12);
    color: var(--warn-orange);
}

.rp-alert--info .rp-alert__icon {
    background: rgba(93, 173, 226, 0.12);
    color: var(--info-blue);
}

.rp-alert__title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.35;
}

.rp-alert__chevron {
    flex-shrink: 0;
    color: var(--text-hint);
    transition: transform 0.2s ease;
}

.rp-alert[open] .rp-alert__chevron {
    transform: rotate(180deg);
}

/*  Body = contenu déplié */

.rp-alert__body {
    padding: 0 1rem 0.95rem 1rem;
    border-top: 1px dashed #eee;
    padding-top: 0.85rem;
    margin-top: 0;
}

.rp-alert__message {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.rp-alert__ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rp-alert__ingredient {
    /* Item d'ingrédient en ligne */
}

.rp-alert__ingredient-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-soft);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.15s ease, color 0.15s ease;
}

.rp-alert__ingredient-link:hover {
    background: rgba(255, 107, 157, 0.06);
    color: var(--primary-pink);
}

.rp-alert__ingredient-link .bi {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-disabled);
    transition: color 0.15s ease;
}

.rp-alert__ingredient-link:hover .bi {
    color: var(--primary-pink);
}

.rp-alert__ingredient-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.rp-alert__ingredient-pos {
    font-size: 0.78rem;
    color: var(--text-hint);
    white-space: nowrap;
}


/* ============================================
   5. POSITIVES — encarts verts
   ============================================ */

.rp-positives {
    margin-bottom: 1.5rem;
}

.rp-positives__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0 0 0.85rem 0;
}

.rp-positives__title i {
    color: var(--primary-green);
}

.rp-positive {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(143, 181, 105, 0.06);
    border-left: 3px solid var(--primary-green);
    border-radius: 8px;
    margin-bottom: 0.6rem;
}

.rp-positive:last-child {
    margin-bottom: 0;
}

.rp-positive__icon {
    flex-shrink: 0;
    color: var(--primary-green);
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.rp-positive__body {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-positive__title {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: var(--darker-green);
    font-size: 0.93rem;
    line-height: 1.35;
}

.rp-positive__message {
    margin: 0;
    color: #555;
    font-size: 0.86rem;
    line-height: 1.5;
}


/* ============================================
   6. NEUTRAL — formule globalement neutre pour le profil
   ============================================ */

.rp-neutral {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.1rem;
    background: rgba(143, 181, 105, 0.06);
    border-left: 3px solid var(--primary-green);
    border-radius: 8px;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.rp-neutral i {
    color: var(--primary-green);
    flex-shrink: 0;
    font-size: 1.05rem;
}


/* ============================================
   7. TRANSPARENCY FOOTER
   ============================================ */

.rp-transparency {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--border-default);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.rp-transparency__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.5;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.rp-transparency__text i {
    color: var(--text-hint);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.rp-transparency__text strong {
    color: #555;
}

.rp-transparency__link {
    flex-shrink: 0;
    font-size: 0.83rem;
    color: var(--primary-pink);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.rp-transparency__link:hover {
    color: var(--dark-pink);
    text-decoration: underline;
}


/* ============================================
   8. CTA — guest + no_profile
   ============================================ */

.rp-cta {
    text-align: center;
    padding: 2rem 1.25rem;
}

.rp-cta__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(143, 181, 105, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-pink);
}

.rp-cta__title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0 0 0.85rem 0;
    line-height: 1.3;
}

.rp-cta__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.rp-cta__lead {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 auto 1.25rem auto;
    max-width: 480px;
}

.rp-cta__bullets {
    list-style: none;
    padding: 0;
    margin: 0 auto 1.5rem auto;
    max-width: 380px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.rp-cta__bullets li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.rp-cta__bullets li i {
    color: var(--primary-pink);
    flex-shrink: 0;
    font-size: 1rem;
}

.rp-cta__form {
    max-width: 360px;
    margin: 0 auto 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.rp-cta__field {
    text-align: left;
}

.rp-cta__label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.rp-cta__input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.rp-cta__input:focus {
    outline: none;
    border-color: var(--primary-pink);
}

.rp-cta__submit {
    margin-top: 0.25rem;
}

.rp-cta__submit--solo {
    /* Variante quand on n'a pas de form au-dessus (cas no_profile) */
    max-width: 360px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rp-cta__alt {
    margin: 1rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.rp-cta__alt-link {
    color: var(--primary-pink);
    font-weight: 600;
    text-decoration: none;
}

.rp-cta__alt-link:hover {
    text-decoration: underline;
}


/* ============================================
   9. RESPONSIVE
   ============================================ */

@media (max-width: 480px) {

    .rp-tabs__btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }

    .rp-score {
        padding: 1.25rem 1rem 1.5rem;
    }

    .rp-score__number {
        font-size: 2.5rem;
    }

    .rp-score__label {
        font-size: 1rem;
    }

    .rp-cta {
        padding: 1.5rem 0.5rem;
    }

    .rp-cta__title {
        font-size: 1.2rem;
    }

    .rp-cta__icon {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }

    .rp-alert__summary {
        padding: 0.75rem 0.85rem;
    }

    .rp-alert__title {
        font-size: 0.9rem;
    }

    .rp-incomplete-hint {
        flex-direction: column;
        align-items: flex-start;
    }

    .rp-incomplete-hint__link {
        align-self: stretch;
        text-align: center;
        justify-content: center;
    }
}
/* ═══════════════════════════════════════════════════════════════════════
   10. COMPARE — verdict + layout 2 colonnes (salve 9.3b)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Verdict bandeau ───────────────────────────────────────────────── */

.rp-verdict {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    border-left: 4px solid #ccc;
    background: var(--bg-soft);
    color: var(--text-dark);
}

.rp-verdict__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: #fff;
}

.rp-verdict__body {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-verdict__message {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
}

.rp-verdict__detail {
    display: inline-block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── Variantes par mode ────────────────────────────────────────────── */

/* prefer_a / prefer_b : rose Cosmélyse (verdict tranché vers une formule) */
.rp-verdict--prefer_a,
.rp-verdict--prefer_b {
    border-left-color: var(--primary-pink);
    background: linear-gradient(to right, rgba(255, 107, 157, 0.08), #fff0f0 30%);
}
.rp-verdict--prefer_a .rp-verdict__icon,
.rp-verdict--prefer_b .rp-verdict__icon {
    color: var(--primary-pink);
    background: rgba(255, 107, 157, 0.1);
}

/* equivalent : bleu info (les 2 se valent) */
.rp-verdict--equivalent {
    border-left-color: var(--info-blue);
    background: linear-gradient(to right, rgba(93, 173, 226, 0.08), #fff 30%);
}
.rp-verdict--equivalent .rp-verdict__icon {
    color: var(--info-blue);
    background: rgba(93, 173, 226, 0.1);
}

/* both_excellent : vert (les 2 excellent) */
.rp-verdict--both_excellent {
    border-left-color: var(--primary-green);
    background: linear-gradient(to right, rgba(143, 181, 105, 0.08), #fff 30%);
}
.rp-verdict--both_excellent .rp-verdict__icon {
    color: var(--primary-green);
    background: rgba(143, 181, 105, 0.1);
}

/* both_bad : orange (les 2 mal adaptées) */
.rp-verdict--both_bad {
    border-left-color: var(--warn-orange);
    background: linear-gradient(to right, rgba(243, 156, 18, 0.08), #fff 30%);
}
.rp-verdict--both_bad .rp-verdict__icon {
    color: var(--warn-orange);
    background: rgba(243, 156, 18, 0.1);
}

/* inconclusive : gris (cas dégénéré, ne devrait pas arriver) */
.rp-verdict--inconclusive {
    border-left-color: var(--text-hint);
    background: var(--bg-soft);
}
.rp-verdict--inconclusive .rp-verdict__icon {
    color: var(--text-hint);
    background: #f0f0f0;
}


/* ── Layout 2 colonnes côte à côte ─────────────────────────────────── */

.rp-compare-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    /* Sur mobile : empilement vertical */
    .rp-compare-cols {
        grid-template-columns: 1fr;
    }
}

.rp-compare-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/*  Le score (cf. .rp-score--xxx) est appliqué en mode "compact" dans le
    contexte de compare : on garde le dégradé de couleur mais on réduit
    légèrement la taille pour qu'on puisse afficher 2 cards côte à côte
    sans que ça déborde.                                                  */

.rp-compare-col .rp-score {
    margin-bottom: 0;
    padding: 1.15rem 1rem 1.4rem;
}

.rp-compare-col .rp-score__number {
    font-size: 2.5rem;
}

.rp-compare-col .rp-score__label {
    font-size: 1rem;
}

.rp-compare-col .rp-score__heading {
    font-size: 0.7rem;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.7rem;
}


/* ── Tag A / B ─────────────────────────────────────────────────────── */

/*  Petit chip qui identifie la formule. Couleur distincte pour que
    l'œil distingue rapidement A et B. On reprend les conventions de
    compare.css existant si tu en as déjà : sinon on pose ces couleurs.   */

.rp-compare-col__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: #fff;
    align-self: flex-start;
}

.rp-compare-col__tag--a {
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
}

.rp-compare-col__tag--b {
    background: linear-gradient(135deg, #6bb5dd, #3498db);
}


/* ── Blocs d'alertes par formule ───────────────────────────────────── */

/*  Dans l'onglet Pour vous de compare, les alertes sont regroupées par
    formule (pas mélangées). On wrappe chaque liste d'alertes dans un
    .rp-compare-alerts-block qui affiche le tag A ou B au-dessus.          */

.rp-compare-alerts-block {
    margin-bottom: 1.25rem;
}

.rp-compare-alerts-block__tag {
    margin-bottom: 0.6rem;
}

/*  Note : on ne met PAS de bordure ou de fond particulier autour de
    chaque bloc — ça serait trop lourd visuellement. Le tag A/B en haut
    suffit à identifier à quelle formule appartiennent les alertes
    qui suivent.                                                            */

    /* ═══════════════════════════════════════════════════════════════════════
   11. INGREDIENT — encart "Pour vous" sur la fiche détail (salve 9.3c)
   ═══════════════════════════════════════════════════════════════════════ */

/*  Encart pleine largeur affiché EN HAUT de la page ingredient.php,
    avant la card "Scores Cosmélyse". Visuellement distinct des autres
    cards : pas de cosm-card classique, un design "bandeau" plus aéré
    avec border-left coloré selon la criticité.

    Pourquoi pas réutiliser .cosm-card ? Parce que ce bandeau veut
    "interpeller" l'user qui arrive sur la fiche, pas se fondre dans
    la liste des autres sections. C'est volontairement différencié.   */

.rp-ingredient-banner {
    background: #fff;
    border-radius: 16px;
    padding: 1.4rem 1.5rem 1.25rem;
    margin-bottom: 1.5rem;

    /* Border-left épais pour marquer la criticité. Sans wrapper
       supplémentaire, on profite du fond blanc + ombre subtile. */
    border-left: 6px solid #ccc;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

/* ── Variantes par level ───────────────────────────────────────────── */

.rp-ingredient-banner--critical {
    border-left-color: var(--danger-red);
    background: linear-gradient(to right, rgba(231, 76, 60, 0.05), #fff 30%);
}

.rp-ingredient-banner--warning {
    border-left-color: var(--warn-orange);
    background: linear-gradient(to right, rgba(243, 156, 18, 0.05), #fff 30%);
}

.rp-ingredient-banner--info {
    border-left-color: var(--info-blue);
}

/*  Mode "neutral" : aucune alerte pour le profil (rassurant).
    Utilisé via la classe combinée .rp-ingredient-banner--neutral
    qui peut s'ajouter à un --info pour un rendu plus apaisé. */
.rp-ingredient-banner--neutral {
    border-left-color: var(--primary-green);
    background: linear-gradient(to right, rgba(143, 181, 105, 0.06), #fff 30%);
}

/* ── Header (icône + titre) ────────────────────────────────────────── */

.rp-ingredient-banner__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.rp-ingredient-banner__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(143, 181, 105, 0.15));
    color: var(--primary-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.rp-ingredient-banner--neutral .rp-ingredient-banner__icon {
    background: rgba(143, 181, 105, 0.12);
    color: var(--primary-green);
}

.rp-ingredient-banner__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-ingredient-banner__title {
    margin: 0 0 0.15rem 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--text-dark);
}

.rp-ingredient-banner__sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* ── Override : .rp-alerts dans ce contexte n'a pas besoin de son propre
   titre de section "À surveiller" car le banner__title joue ce rôle.
   Le partial _personal_alerts.php affiche quand même le titre, qu'on
   pourrait masquer ici. Choix retenu : on le GARDE, ça structure
   visuellement les alertes dans le banner. Pas de modif CSS. ── */

/* Petits ajustements de spacing dans le contexte banner */
.rp-ingredient-banner .rp-alerts {
    margin-bottom: 1rem;
}

.rp-ingredient-banner .rp-incomplete-hint {
    margin-bottom: 1rem;
}

/* ── Indice futur (filtres facettes) — chip discret ────────────────── */

.rp-future-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem 0;
    padding: 0.45rem 0.85rem;
    background: rgba(212, 175, 55, 0.1);   /* gold-accent atténué */
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 999px;
    color: #806515;
    font-size: 0.82rem;
    font-style: italic;
}

/* Deux hints côte à côte (type + allergène, lot D) : respiration
   horizontale ; en wrap mobile, les marges verticales existantes
   suffisent. */
.rp-future-hint + .rp-future-hint {
    margin-left: 0.5rem;
}

.rp-future-hint i {
    color: var(--gold-accent);
    font-style: normal;  /* dans le cas où un parent passe en italic */
}


/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .rp-ingredient-banner {
        padding: 1.15rem 1rem 1rem;
    }

    .rp-ingredient-banner__icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .rp-ingredient-banner__title {
        font-size: 1rem;
    }

    .rp-ingredient-banner__header {
        gap: 0.65rem;
        margin-bottom: 0.85rem;
    }
}

/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  PATCH — assets/css/cosmelyse_result_personal.css                     ║
   ║  Salve filtres facettes — 1                                           ║
   ╚═══════════════════════════════════════════════════════════════════════╝

   Cible  : /assets/css/cosmelyse_result_personal.css
   Action : AJOUTER le bloc ci-dessous IMMÉDIATEMENT APRÈS la règle
            existante `.rp-future-hint i { … }` (vers la ligne 1166),
            AVANT le commentaire `── Responsive ──`.

   Pourquoi : le chip "rp-future-hint" était auparavant un <div> non-cliquable.
   Depuis la salve filtres facettes, c'est un <a href> qui pointe vers
   le catalogue. La variante --actionable rend ce statut cliquable visible
   (couleur de fond plus marquée, bordure pleine, hover, flèche animée).
*/


/* ── Variante actionable (lien vers /catalogue.php?exclude=...) ──────── */

a.rp-future-hint--actionable {
    /* Override de la base : on transforme le chip en CTA discret. */
    text-decoration: none;
    background: rgba(212, 175, 55, 0.14);
    border-style: solid;
    border-color: rgba(212, 175, 55, 0.55);
    color: #6f5710;
    font-style: normal;
    transition: background-color 0.15s ease,
                border-color 0.15s ease,
                transform 0.15s ease;
}

a.rp-future-hint--actionable:hover,
a.rp-future-hint--actionable:focus {
    background: rgba(212, 175, 55, 0.22);
    border-color: var(--gold-accent);
    color: #5a4509;
    transform: translateY(-1px);
}

.rp-future-hint__arrow {
    margin-left: auto;          /* pousse la flèche à droite */
    transition: transform 0.15s ease;
}

a.rp-future-hint--actionable:hover .rp-future-hint__arrow {
    transform: translateX(3px);
}

/* Sur mobile, le chip wrap proprement et la flèche reste alignée. */
@media (max-width: 480px) {
    a.rp-future-hint--actionable {
        display: flex;          /* override du inline-flex pour wrapper */
        gap: 0.5rem;
    }
}
/* ── Section ───────────────────────────────────────────────────────────── */
.rp-alt {
    margin-bottom: 1.5rem;
}

.rp-alt__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0 0 0.35rem 0;
}

.rp-alt__title i {
    color: var(--primary-pink);
}

.rp-alt__lead {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.rp-alt__list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* ── Carte (rangée) — calquée sur .rp-alert ────────────────────────────── */
.rp-alt-card {
    position: relative;                 /* pour le lien stretched */
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1px solid var(--border-default);
    border-left-width: 4px;
    border-left-color: var(--border-default);   /* surchargé par --{level} */
    border-radius: 10px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    width:100%;
}

.rp-alt-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Liseré par palier (les alternatives sont toujours fair/good/excellent
   en pratique ; on définit les 5 par sécurité, mêmes teintes que .rp-score). */
.rp-alt-card--excellent { border-left-color: var(--primary-green); }
.rp-alt-card--good      { border-left-color: #6bb585; }
.rp-alt-card--fair      { border-left-color: var(--info-blue); }
.rp-alt-card--poor      { border-left-color: var(--warn-orange); }
.rp-alt-card--bad       { border-left-color: var(--danger-red); }

/* ── Vignette ──────────────────────────────────────────────────────────── */
.rp-alt-card__media {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0ece5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-alt-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rp-alt-card__placeholder {
    color: var(--text-hint);
    font-size: 1.3rem;
}

/* ── Corps ─────────────────────────────────────────────────────────────── */
.rp-alt-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.rp-alt-card__brand {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
}

.rp-alt-card__name {
    margin: 0 0 0.3rem 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.3;
    color: var(--text-dark);
}

.rp-alt-card__link {
    color: inherit;
    text-decoration: none;
}

/* Lien stretched : son ::after couvre toute la carte. */
.rp-alt-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* ── Transition de palier "Peu adapté → Bien adapté" ───────────────────── */
.rp-alt-card__shift {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.rp-alt-card__shift i {
    font-size: 0.8rem;
    color: var(--text-hint);
}

.rp-alt-card__shift-to {
    font-weight: 700;
    color: var(--text-dark);
}

/* ── Badge score (au-dessus du lien stretched pour garder son tooltip) ──── */
.rp-alt-card__score {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* ── Chevron "navigable" ───────────────────────────────────────────────── */
.rp-alt-card__go {
    flex-shrink: 0;
    color: var(--text-hint);
    font-size: 0.9rem;
    transition: transform 0.15s ease;
}

.rp-alt-card:hover .rp-alt-card__go {
    transform: translateX(3px);
}

@media (max-width: 480px) {
    .rp-alt-card {
        flex-wrap: wrap;            /* autorise le badge à passer sous le texte */
        column-gap: 0.75rem;
        row-gap: 0.3rem;
        padding: 0.65rem 0.7rem;
    }

    .rp-alt-card__media {
        width: 48px;
        height: 48px;
    }

    /* Le chevron est redondant au toucher et volait de la largeur au nom. */
    .rp-alt-card__go {
        display: none;
    }

    /* Le corps occupe toute la largeur restante de la 1re ligne (à côté de
       la vignette) → le nom n'est plus écrasé par le badge. */
    .rp-alt-card__body {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Nom borné à 2 lignes : fini l'empilement "un mot par ligne". */
    .rp-alt-card__name {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Le badge bascule sur sa propre ligne, aligné à droite. */
    .rp-alt-card__score {
        flex-basis: 100%;
        display: flex;
        justify-content: flex-end;
    }
}
