/* ============================================================
   GéoClic Collectivités — Fondation commune (Lot A)
   Chargé en DERNIER sur toutes les pages intérieures :
   1. Palette V14 unifiée (remappe les variables des anciennes pages)
   2. Classes scroll-reveal partagées (pour les pages sans style.css)
   3. Hover cartes + accordéons FAQ
   ============================================================ */

/* ---------- 1. Palette V14 — source de vérité ---------- */
:root {
    --gc-blue: #0b63ce;
    --gc-blue-dark: #0757bd;
    --gc-navy: #08285a;
    --gc-green: #16a34a;
    --gc-orange: #f59e0b;
    --gc-orange-deep: #f97316;
    --gc-soft: #f4f8ff;
    --gc-border: rgba(12, 44, 89, .12);

    /* Remap des variables héritées (Gen A: #1565C0/#FF6F00, Gen C: #2563eb)
       — ce fichier étant chargé après les <style> inline, ces valeurs gagnent. */
    --primary: var(--gc-blue);
    --primary-dark: var(--gc-navy);
    --primary-light: #3b82f6;
    --accent: var(--gc-orange);
    --accent-soft: #fbbf24;
    --success: var(--gc-green);
}

/* ---------- 2. Scroll reveal (copie de style.css pour les pages qui ne le chargent pas) ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.reveal-left.visible,
.reveal-right.visible { transform: translateX(0); }

.reveal-scale { transform: scale(0.95); }
.reveal-scale.visible { transform: scale(1); }

.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.stagger.visible > *:nth-child(6) { transition-delay: 400ms; }

.stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 3. Hover discret sur les cartes (élévation + ombre) ---------- */
.grid > .card,
.module-card,
.price-card,
.tutorial-card,
.next-step-card,
.faq-item {
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.grid > .card:hover,
.module-card:hover,
.price-card:hover,
.tutorial-card:hover,
.next-step-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 60px rgba(7, 27, 58, .11);
}

/* ---------- 4. Accordéons FAQ (details/summary avec chevron animé) ---------- */
.faq details,
.faq-list details,
details.faq-item {
    background: #fff;
    border: 1px solid var(--gc-border);
    border-radius: 14px;
    padding: 0;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 250ms ease;
}

.faq details[open],
.faq-list details[open],
details.faq-item[open] {
    box-shadow: 0 14px 38px rgba(7, 27, 58, .08);
}

.faq summary,
.faq-list summary,
details.faq-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    font-weight: 700;
    color: var(--gc-navy);
}

.faq summary::-webkit-details-marker,
.faq-list summary::-webkit-details-marker,
details.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq summary::after,
.faq-list summary::after,
details.faq-item summary::after {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--gc-blue);
    border-bottom: 2px solid var(--gc-blue);
    transform: rotate(45deg);
    transition: transform 250ms ease;
}

.faq details[open] > summary::after,
.faq-list details[open] > summary::after,
details.faq-item[open] > summary::after {
    transform: rotate(-135deg);
}

.faq details > p,
.faq-list details > p,
details.faq-item > p {
    padding: 0 20px 16px;
    margin: 0;
    color: #475569;
}

/* ---------- 5. Habillage des pages piliers (Lot B) ---------- */
.pillar-illustration {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--gc-border);
}

.product-shot {
    margin: 30px auto;
    text-align: center;
}

.product-shot img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid var(--gc-border);
    box-shadow: 0 18px 50px rgba(7, 27, 58, .12);
}

.product-shot figcaption {
    margin-top: 12px;
    color: #64748b;
    font-size: .88rem;
}

.product-duo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    align-items: start;
    margin: 30px 0;
}

.product-duo .product-shot {
    margin: 0;
}

.product-shot--phone img {
    max-height: 460px;
    width: auto;
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: #e8f2ff;
    font-size: 1.35rem;
    margin-bottom: 12px;
}

/* Sommaire d'ancres (mentions légales) */
.toc-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 30px;
    padding: 16px;
    background: var(--gc-soft);
    border: 1px solid var(--gc-border);
    border-radius: 14px;
}

.toc-anchors a {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--gc-border);
    border-radius: 999px;
    color: var(--gc-blue);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 700;
    transition: background 200ms ease, color 200ms ease;
}

.toc-anchors a:hover {
    background: var(--gc-blue);
    color: #fff;
}

.toc-anchors ~ h2[id],
h2[id] {
    scroll-margin-top: 90px;
}

/* Carte tarifaire recommandée (tarifs.html) — doit gagner sur la couche
   polish de style.css (!important) et sur le transform du stagger */
.pricing-card.recommended,
body:not(.home-modern) .pricing-card.recommended {
    border: 2px solid var(--gc-orange) !important;
    transform: scale(1.04) !important;
    box-shadow: 0 16px 44px rgba(245, 158, 11, 0.2) !important;
}

.pricing-card.recommended:hover,
body:not(.home-modern) .pricing-card.recommended:hover {
    transform: scale(1.04) translateY(-3px) !important;
    box-shadow: 0 20px 52px rgba(245, 158, 11, 0.28) !important;
}

/* Highlight box plus contrastée (anciennes pages SEO) */
.highlight-box {
    background: linear-gradient(135deg, #e8f2ff, #dbeafe) !important;
    border-left: 5px solid var(--gc-blue) !important;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(7, 27, 58, .08);
}

/* Bulles de chat — démo Q/R de l'assistant IA (hero-card) */
.hero-card .search-demo {
    display: block;
    width: fit-content;
    max-width: 88%;
    margin: 16px 0 14px auto;
    background: linear-gradient(135deg, var(--gc-blue), var(--gc-blue-dark));
    color: #fff;
    border: none;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 8px 22px rgba(11, 99, 206, .25);
    font-weight: 600;
}

.hero-card .answer {
    display: block;
    width: fit-content;
    max-width: 92%;
    margin-right: auto;
    background: #fff;
    border: 1px solid var(--gc-border);
    border-left: 1px solid var(--gc-border);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 8px 22px rgba(7, 27, 58, .08);
    color: #17365f;
}

.hero-card .answer strong {
    color: var(--gc-blue);
}

/* ---------- 6. Respect des préférences utilisateur ---------- */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .grid > .card,
    .module-card,
    .price-card,
    .tutorial-card,
    .next-step-card {
        transition: none;
    }
}
