/* ==========================================================================
   CAPRICEO - CORE DESIGN SYSTEM 
   Identité : Tiers de Confiance / UI Premium (Apple, Mercedes)
   ========================================================================== */

/* --- 1. VARIABLES GLOBALES --- */
:root {
    /* Couleurs Claires (Mode Par Défaut - Fiches, Archives, Simulateurs) */
    --cap-dark: #1d1d1f;
    --cap-dark-alt: #111111;
    --cap-grey: #515154; /* Foncé pour meilleure lisibilité */
    --cap-bg: #fbfbfd;
    --cap-bg-alt: #f5f5f7;
    --cap-border: #e5e5ea;
    --cap-accent: #0071e3;
    
    /* Variables dynamiques (Surchargées en PHP selon l'univers) */
    --theme-color: var(--cap-accent);

    /* Typographie */
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, sans-serif;
    
    /* Ombres (Luxe) */
    --shadow-sm: 0 10px 20px rgba(0,0,0,0.02);
    --shadow-md: 0 20px 40px rgba(0,0,0,0.04);
    --shadow-lg: 0 30px 60px rgba(0,0,0,0.08);
}

/* --- 2. RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Par défaut : Mode Clair / Apple Clean */
body {
    background-color: var(--cap-bg);
    color: var(--cap-dark);
    font-family: var(--font-stack);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Surcharge : Mode Sombre Immersif (Uniquement sur les pages Univers) */
body.tax-cap_univers { 
    background-color: #000000 !important; 
    color: #f5f5f7; 
}

a { text-decoration: none; color: inherit; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }


/* ==========================================================================
   3. UTILITAIRES & LAYOUTS COMMUNS
   ========================================================================== */

/* Animations au Scroll */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-up.visible { opacity: 1; transform: translateY(0); }
@keyframes capPopIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Boutons Standards */
.btn-apple {
    display: inline-flex; justify-content: center; align-items: center;
    background: var(--cap-dark); color: #fff;
    padding: 18px 36px; border-radius: 99px;
    font-weight: 800; font-size: 1.1rem; border: none; cursor: pointer;
}
.btn-apple:hover { transform: scale(1.02); box-shadow: var(--shadow-md); background: var(--cap-dark-alt); }

/* Layouts */
.page-layout-split { display: grid; grid-template-columns: 1fr 380px; gap: 60px; max-width: 1300px; margin: 0 auto 100px; padding: 0 24px; align-items: start; }
@media (max-width: 1024px) { .page-layout-split { grid-template-columns: 1fr; gap: 40px; } }


/* ==========================================================================
   4. FORMULAIRES GLOBAUX & UI TACTILE (STYLE MERCEDES / FBI)
   ========================================================================== */

/* Labels */
label { display: block; margin-bottom: 12px; font-weight: 700; font-size: 1.1rem; color: inherit; letter-spacing: -0.3px; }
.help-text { display: block; font-size: 13px; color: var(--cap-grey); margin-top: 8px; font-weight: 500; }

/* Champs de saisie classiques */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], textarea, select, .cap-input {
    width: 100%; padding: 18px 20px;
    background-color: var(--cap-bg-alt);
    border: 2px solid transparent; border-radius: 16px;
    font-family: inherit; font-size: 1.1rem; font-weight: 600; color: var(--cap-dark);
    transition: 0.3s; outline: none; box-sizing: border-box;
    -webkit-appearance: none; appearance: none;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%231d1d1f" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat; background-position: right 16px center; padding-right: 45px;
}
input:focus, textarea:focus, select:focus, .cap-input:focus {
    background-color: #fff; border-color: var(--theme-color);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}

/* Grilles Tactiles (Remplacent les vieux selects) */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.opt-grid.col-3 { grid-template-columns: repeat(3, 1fr); }
.opt-grid.col-4 { grid-template-columns: repeat(4, 1fr); }
.opt-grid.col-1 { grid-template-columns: 1fr; }

.tactile-opt { cursor: pointer; display: block; margin: 0; }
.tactile-opt input { display: none; }
.tactile-box { 
    background: var(--cap-bg-alt); border: 2px solid transparent; border-radius: 16px; 
    padding: 20px 15px; text-align: center; font-weight: 800; font-size: 15px; color: #515154; 
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); height: 100%; display: flex; align-items: center; justify-content: center; line-height: 1.3; 
}
.tactile-opt input:checked + .tactile-box { 
    background: var(--theme-color); border-color: var(--theme-color); color: #fff; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); transform: translateY(-2px); 
}

@media (max-width: 768px) {
    .opt-grid.col-3, .opt-grid.col-4 { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   5. WIZARD / SIMULATEUR CONVERSATIONNEL
   ========================================================================== */
.cap-simulator { background: #fff; border-radius: 32px; box-shadow: var(--shadow-lg); border: 1px solid var(--cap-border); overflow: hidden; position: relative; }
.progress-bar { height: 6px; background: var(--cap-bg-alt); width: 100%; }
.progress-fill { height: 100%; background: var(--theme-color); width: 10%; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

.step-content { padding: 50px 60px; display: none; }
.step-content.active { display: block; animation: capPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.step-header { border-bottom: 2px solid var(--cap-border); padding-bottom: 20px; margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; }
.step-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.8px; margin: 0; color: var(--cap-dark); }
.step-counter { font-size: 1.2rem; font-weight: 800; color: var(--cap-grey); }

.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 50px; border-top: 1px solid var(--cap-border); padding-top: 30px; }
.btn-next { background: var(--cap-dark); color: #fff; border: none; padding: 18px 40px; border-radius: 99px; font-size: 1.1rem; font-weight: 900; cursor: pointer; transition: 0.3s; }
.btn-next:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.btn-next.disabled { opacity: 0.3; pointer-events: none; }
.btn-back { background: transparent; border: none; color: var(--cap-grey); cursor: pointer; font-size: 1.1rem; font-weight: 700; padding: 10px 0; transition: 0.2s; }
.btn-back:hover { color: var(--cap-dark); }

@media (max-width: 768px) {
    .cap-simulator { border-radius: 24px; }
    .step-content { padding: 30px 20px; }
    .form-actions { flex-direction: column; gap: 20px; align-items: stretch; }
    .btn-next { width: 100%; order: 1; }
    .btn-back { order: 2; width: 100%; text-align: center; }
}


/* ==========================================================================
   6. MEGA MENU (HEADER CLAIR / FROSTED GLASS)
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 9999; background: rgba(251, 251, 253, 0.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0,0,0,0.05); }
body.tax-cap_univers .site-header { background: rgba(0, 0, 0, 0.8); border-bottom-color: rgba(255,255,255,0.05); } /* Sombre sur univers */

.logo a { color: var(--cap-dark); font-weight: 900; font-size: 1.5rem; letter-spacing: -1px; }
body.tax-cap_univers .logo a { color: #fff; }

.nav-link { color: var(--cap-dark); font-weight: 600; padding: 10px 15px; }
body.tax-cap_univers .nav-link { color: #d2d2d7; }
.nav-link:hover { color: var(--cap-accent); }

.has-mega { position: static; }
.mega-menu {
    position: absolute; top: 100%; left: 0; width: 100%; padding: 40px 0;
    background: rgba(251, 251, 253, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05); box-shadow: 0 40px 100px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
body.tax-cap_univers .mega-menu { background: rgba(28, 28, 30, 0.9); border-bottom-color: rgba(255,255,255,0.08); box-shadow: 0 40px 100px rgba(0,0,0,0.5); }

.has-mega:hover .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }

.mega-container { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px; padding: 0 24px; }
.mega-label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--cap-grey); margin-bottom: 20px; letter-spacing: 1px; }
.mega-col a { display: block; padding: 8px 0; font-size: 15px; color: #515154; font-weight: 600; }
body.tax-cap_univers .mega-col a { color: #d2d2d7; }
.mega-col a.main-cat { font-size: 18px; font-weight: 800; color: var(--cap-dark); margin-bottom: 5px; }
body.tax-cap_univers .mega-col a.main-cat { color: #fff; }
.mega-col a:hover { color: var(--theme-color, var(--cap-accent)); transform: translateX(5px); }

/* 6.1. SOUS-MENUS STANDARDS (HARMONISATION) */
.menu-item-has-children {
    position: relative;
}

.sub-menu {
    /* Apparence & Position */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 40px 100px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    border-top: none;
    padding: 25px;
    border-radius: 0 0 24px 24px;
    z-index: 100;

    /* Animation d'entrée */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Liens dans le sous-menu */
.sub-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    color: #515154;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sub-menu li a:hover {
    color: var(--theme-color, var(--cap-accent));
    background: rgba(0,0,0,0.04);
    transform: translateX(5px);
}

/* Version sombre (pour pages univers) */
body.tax-cap_univers .sub-menu {
    background: rgba(28, 28, 30, 0.98);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

body.tax-cap_univers .sub-menu li a {
    color: #d2d2d7;
}

body.tax-cap_univers .sub-menu li a:hover {
    background: rgba(255,255,255,0.1);
}

/* ==========================================================================
   7. MAPPING & UNIVERS IMMERSIFS (PAGES TAXONOMIES SEULEMENT)
   ========================================================================== */
.theme-chauffage   { --t-bg: var(--chauf-black); --t-neon: var(--chauf-neon); }
.theme-solaire     { --t-bg: var(--sol-black);   --t-neon: var(--sol-neon); }
.theme-electricite { --t-bg: var(--elec-black);  --t-neon: var(--elec-neon); }
.theme-plomberie   { --t-bg: var(--plom-black);  --t-neon: var(--plom-neon); }
.theme-isolation   { --t-bg: var(--iso-black);   --t-neon: var(--iso-neon); }
.theme-toiture     { --t-bg: var(--toit-black);  --t-neon: var(--toit-neon); }
.theme-menuiserie  { --t-bg: var(--menu-black);  --t-neon: var(--menu-neon); }
.theme-structure   { --t-bg: var(--stru-black);  --t-neon: var(--stru-neon); }
.theme-expertise   { --t-bg: var(--exp-black);   --t-neon: var(--exp-neon); }

.univers-wrapper { min-height: 100vh; padding-top: 80px; position: relative; }
.ambient-glow { position: absolute; top: -20%; left: 50%; transform: translateX(-50%); width: 80vw; height: 80vh; background: radial-gradient(circle, var(--t-neon), transparent 70%); opacity: 0.15; filter: blur(120px); z-index: 0; pointer-events: none; }
.badge-univers { display: inline-block; padding: 6px 16px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; background: rgba(0,0,0,0.5); color: var(--t-neon); border: 1px solid var(--t-neon); box-shadow: 0 0 15px rgba(255,255,255,0.1); margin-bottom: 24px; position: relative; z-index: 2; }

/* Bento Grid Produits (Dark Mode) */
body.tax-cap_univers .bento-grid { max-width: 1300px; margin: 0 auto 100px; padding: 0 24px; position: relative; z-index: 2; }
body.tax-cap_univers .bento-card { background: rgba(28, 28, 30, 0.4); backdrop-filter: blur(20px); border-radius: 32px; padding: 40px; display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,0.08); transition: 0.3s; }
body.tax-cap_univers .bento-card:hover { transform: translateY(-5px); background: rgba(44, 44, 46, 0.8); border-color: var(--t-neon); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.card-icon { font-size: 40px; margin-bottom: 20px; display: block; filter: drop-shadow(0 0 15px var(--t-neon)); }
.card-price { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 8px; margin-bottom: 15px; }


/* ==========================================================================
   8. FOOTER COMPLEXE
   ========================================================================== */
.site-footer { background-color: var(--cap-dark-alt); color: #a1a1a6; padding: 80px 24px 40px; border-top: 1px solid #1c1c1e; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px 20px; max-width: 1400px; margin: 0 auto; }
.brand-col h3 { color: white; font-size: 18px; font-weight: 900; margin-bottom: 15px; letter-spacing: -0.5px; }
.brand-col p { line-height: 1.6; margin-bottom: 20px; max-width: 250px; }
.label-rge { border: 1px solid #333; padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 800; color: #fff; text-transform: uppercase; display: inline-block; }
.footer-col h4 { color: white; font-size: 12px; font-weight: 800; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #a1a1a6; transition: 0.2s; font-weight: 500; }
.footer-col a:hover { color: white; }
.footer-bottom { text-align: center; margin-top: 60px; padding-top: 30px; border-top: 1px solid #1c1c1e; color: #515154; font-weight: 600; font-size: 12px; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .brand-col { grid-column: 1 / -1; margin-bottom: 20px; border-bottom: 1px solid #1c1c1e; padding-bottom: 30px; }
}


/* ==========================================================================
   9. MOTIFS SVG PREMIUM (FILIGRANE DARK MODE)
   ========================================================================== */
body.term-solaire { background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='58' height='58' x='1' y='1' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03' rx='4'/%3E%3C/svg%3E"); }
body.term-chauffage { background-image: url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q10 0 20 10 T40 10' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3C/svg%3E"); }
body.term-isolation { background-image: url("data:image/svg+xml,%3Csvg width='28' height='49' viewBox='0 0 28 49' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zm0-9.25l13 7.5M1 15V0m26 15V0M13.99 49V34' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03' fill='none'/%3E%3C/svg%3E"); }
body.term-menuiserie { background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm10 10h20v20H10V10z' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3C/svg%3E"); }
body.term-plomberie { background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20c10 0 10-10 20-10s10 10 20 10' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3C/svg%3E"); }
body.term-toiture { background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0L40 20L20 40L0 20Z' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3C/svg%3E"); }
body.term-electricite { background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h15l5-15 10 30 5-15h25' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3Ccircle cx='15' cy='30' r='2' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E"); }
body.term-structure { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0z' fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.03'/%3E%3Cpath d='M0 0l20 20M20 0L0 20' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.02'/%3E%3C/svg%3E"); }
body.term-expertise { background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E"); }

/* CONTAINER GLOBAL */
#cap-live-notifications {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%); /* Centré pour l'équilibre visuel */
    z-index: 10000;
    pointer-events: none;
    width: auto;
    max-width: 90vw;
}

/* LA LIGNE FINE (MOBILE & DESKTOP) */
.cap-notif {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(15px);
    -webkit-backdrop-filter: saturate(180%) blur(15px);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 8px 16px;
    border-radius: 99px; /* Format pilule ultra-fin */
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: notifSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.5s ease;
    pointer-events: auto;
}

.cap-notif.fade-out {
    opacity: 0;
    transform: translate(0, 10px) scale(0.95);
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: #34C759; /* Vert Laser pour la vie */
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.notif-content {
    font-size: 12px;
    color: #1d1d1f;
    font-weight: 600;
    white-space: nowrap; /* Force la ligne unique */
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.notif-content strong { font-weight: 800; }
.notif-content span { color: #0071e3; } /* Ville en bleu */

@keyframes notifSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* DESKTOP : On peut le remettre en bas à gauche si tu préfères */
@media (min-width: 1024px) {
    #cap-live-notifications {
        left: 30px;
        transform: none;
    }
    .notif-content { font-size: 13px; }
}

/* ==========================================================================
   10. NAVIGATION TRANSVERSE (AUTRES UNIVERS)
   ========================================================================== */
.cap-footer-univers { padding: 60px 20px; background: transparent; border-top: 1px solid rgba(0,0,0,0.05); }
body.tax-cap_univers .cap-footer-univers { border-top: 1px solid rgba(255,255,255,0.05); }
.cfu-container { max-width: 1200px; margin: 0 auto; }
.cfu-title { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 30px; color: inherit; opacity: 0.8; }
.cfu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.cfu-card { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-radius: 16px; text-decoration: none; color: #fff !important; transition: all 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.cfu-card:hover { transform: translateY(-3px); filter: brightness(1.2); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.cfu-name { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.cfu-arrow { font-weight: 300; font-size: 18px; opacity: 0.7; transition: 0.2s; }
.cfu-card:hover .cfu-arrow { opacity: 1; transform: translateX(5px); }
@media (max-width: 1024px) { .cfu-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cfu-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   11. CORRECTIFS GLOBAUX (LISIBILITÉ & CLICS)
   ========================================================================== */
/* Sécurité des clics : on s'assure que les liens passent au-dessus des décors */
a, button, input, select, textarea { position: relative; z-index: 2; }

/* Lisibilité forcée sur fonds sombres accidentels */
body[style*="background-color: #000"] a, body[style*="background-color: #111"] a { color: inherit; }

/* Structure Z-Index Globale */
.site-header { z-index: 1000; }
.site-main { position: relative; z-index: 10; }
.site-footer { position: relative; z-index: 20; }

/* ==========================================================================
   12. FAQ FLIP CARDS (PLAQUES TOURNANTES)
   ========================================================================== */
.faq-flip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    perspective: 1000px;
    margin-top: 40px;
}

.faq-flip-card {
    background-color: transparent;
    width: 100%;
    height: 280px; /* Hauteur fixe pour l'effet plaque */
    cursor: pointer;
}

.faq-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.faq-flip-card.flipped .faq-flip-inner {
    transform: rotateY(180deg);
}

.faq-flip-front, .faq-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.faq-flip-front { background-color: #fff; color: #1d1d1f; border: 1px solid #e5e5ea; }
.faq-flip-front h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 15px 0; line-height: 1.4; }
.faq-flip-icon { font-size: 2rem; color: var(--theme-color, #0071e3); margin-top: 10px; transition: transform 0.3s; }
.faq-flip-card:hover .faq-flip-icon { transform: rotate(180deg); }

.faq-flip-back { background-color: #1d1d1f; color: #fff; transform: rotateY(180deg); border: 1px solid #1d1d1f; text-align: left; align-items: flex-start; justify-content: flex-start; overflow-y: auto; }
.faq-flip-back p { font-size: 1.05rem; line-height: 1.6; margin: 0; color: #d1d1d6; }

/* Scrollbar pour le dos */
.faq-flip-back::-webkit-scrollbar { width: 4px; }
.faq-flip-back::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); }
.faq-flip-back::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

/* Dark Mode Overrides */
body.cap-dark-mode .faq-flip-front, body.tax-cap_univers .faq-flip-front { background-color: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: #fff; }
body.cap-dark-mode .faq-flip-back, body.tax-cap_univers .faq-flip-back { background-color: #fff; color: #1d1d1f; border-color: #fff; }
body.cap-dark-mode .faq-flip-back p, body.tax-cap_univers .faq-flip-back p { color: #424245; }

/* ==========================================================================
   13. RANDOM ARTICLES (PRE-FOOTER)
   ========================================================================== */
.random-articles-section {
    padding: 80px 24px;
    background: #f5f5f7;
    border-top: 1px solid #e5e5ea;
    border-bottom: 1px solid #e5e5ea;
}
body.tax-cap_univers .random-articles-section {
    background: #111;
    border-top-color: rgba(255,255,255,0.1);
}

.random-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.random-article-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid #e5e5ea;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
}
body.tax-cap_univers .random-article-card {
    background: #1d1d1f;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.random-article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
body.tax-cap_univers .random-article-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.rac-thumb {
    height: 200px;
    background: #f5f5f7;
}

.rac-content { padding: 25px 30px; }
.rac-title, .rac-title div { font-size: 1.3rem; font-weight: 800; color: #1d1d1f; line-height: 1.3; margin: 0 0 15px; letter-spacing: -0.5px; }
body.tax-cap_univers .rac-title { color: #fff; }
.rac-link { font-size: 14px; font-weight: 700; color: #0071e3; }
body.tax-cap_univers .rac-link { color: var(--theme-color, #0071e3); }