/* ==========================================================================
   Formations v2 — page carte interactive des centres
   Même structure/mécanique (grille, panneau coulissant, breakpoints) que
   formation.css ; seul l'habillage (couleurs, typo) change.
   ========================================================================== */

.fmv2-main {
    background: var(--v2-cream);
    overflow-x: hidden;
}

/* --- Animations de révélation (mêmes classes que le reste du site v2) ---- */

@keyframes fmv2-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fmv2-reveal,
.fmv2-reveal-left,
.fmv2-reveal-right {
    animation: fmv2-fade-up 0.8s var(--v2-ease-out) forwards;
    opacity: 0;
}

.fmv2-delay-1 { animation-delay: 0.1s; }
.fmv2-delay-2 { animation-delay: 0.2s; }
.fmv2-delay-3 { animation-delay: 0.3s; }
.fmv2-delay-4 { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
    .fmv2-reveal,
    .fmv2-reveal-left,
    .fmv2-reveal-right {
        animation: none;
        opacity: 1;
    }
}

/* --- HERO ------------------------------------------------------------------ */

.fmv2-hero {
    padding: var(--v2-gap-xl) var(--v2-pad-x) var(--v2-gap-lg);
    text-align: center;
}

.fmv2-hero-title {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-4xl);
    max-width: 900px;
    margin: 0 auto var(--v2-gap);
    color: var(--v2-ink);
}

.fmv2-hero-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    background: var(--v2-red);
    margin: 1rem auto 0;
    border-radius: var(--v2-radius-pill);
}

.fmv2-hero-subtitle {
    font-size: var(--v2-text-lg);
    color: var(--v2-ink-2);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Piliers --------------------------------------------------------------- */

.fmv2-pillars {
    max-width: var(--v2-container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--v2-gap-lg);
    padding: 0 var(--v2-pad-x) var(--v2-gap-xl);
    position: relative;
}

.fmv2-pillars::after {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--v2-border), transparent);
    transform: translateX(-50%);
}

.fmv2-pillar {
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform var(--v2-duration-base) var(--v2-ease-out),
                box-shadow var(--v2-duration-base) var(--v2-ease-out),
                background var(--v2-duration-base) var(--v2-ease-out);
    position: relative;
    border-radius: var(--v2-radius-lg);
}

.fmv2-pillar:hover {
    background: var(--v2-white);
    box-shadow: var(--v2-shadow-lift);
    transform: translateY(-8px);
    z-index: 5;
}

.fmv2-pillar-number {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: 4.5rem;
    opacity: 0.08;
    line-height: 1;
    margin-bottom: -1.75rem;
    color: var(--v2-blue);
    transition: opacity var(--v2-duration-base) var(--v2-ease-out),
                transform var(--v2-duration-base) var(--v2-ease-out);
}

.fmv2-pillar:hover .fmv2-pillar-number {
    opacity: 0.16;
    transform: scale(1.08);
}

.fmv2-pillar.tef .fmv2-pillar-number { color: var(--v2-red); }

.fmv2-pillar-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 8px 8px rgba(23, 33, 43, 0.08));
}

.fmv2-pillar-title {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-xl);
    margin-bottom: 0.75rem;
    color: var(--v2-blue);
}

.fmv2-pillar.tef .fmv2-pillar-title { color: var(--v2-red); }

.fmv2-pillar-desc {
    color: var(--v2-ink-2);
    margin-bottom: 1.5rem;
    font-size: var(--v2-text-sm);
    max-width: 380px;
}

.fmv2-pillar-features {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    max-width: 350px;
    text-align: left;
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: var(--v2-radius-sm);
    border: 1px solid transparent;
    transition: border-color var(--v2-duration-base) var(--v2-ease-out),
                background var(--v2-duration-base) var(--v2-ease-out);
}

.fmv2-pillar:hover .fmv2-pillar-features {
    border-color: var(--v2-border);
    background: var(--v2-white);
}

.fmv2-feat {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 500;
    font-size: var(--v2-text-sm);
    color: var(--v2-ink);
}

.fmv2-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--v2-blue);
}

.fmv2-pillar.tef .fmv2-dot { background: var(--v2-red); }

.fmv2-btn-pillar {
    margin-top: 1.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--v2-radius-pill);
    font-weight: 700;
    font-size: var(--v2-text-sm);
    text-decoration: none;
    transition: opacity var(--v2-duration-base) var(--v2-ease-out),
                transform var(--v2-duration-base) var(--v2-ease-out);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    transform: translateY(8px);
}

.fmv2-pillar:hover .fmv2-btn-pillar {
    opacity: 1;
    transform: translateY(0);
}

.fmv2-pillar.civique .fmv2-btn-pillar {
    background: var(--v2-blue);
    color: var(--v2-white);
}

.fmv2-pillar.tef .fmv2-btn-pillar {
    background: var(--v2-white);
    border: 2px solid var(--v2-red);
    color: var(--v2-red);
}

.fmv2-pillar.tef .fmv2-btn-pillar:hover {
    background: var(--v2-red);
    color: var(--v2-white);
}

/* --- CTA positionnement ------------------------------------------------------ */

.fmv2-cta {
    padding: var(--v2-gap-xl) var(--v2-pad-x);
    border-top: 1px solid var(--v2-border);
    border-bottom: 1px solid var(--v2-border);
    margin-bottom: var(--v2-gap-lg);
}

.fmv2-cta-container {
    max-width: var(--v2-container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--v2-gap-lg);
}

.fmv2-cta-text h3 {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-2xl);
    margin-bottom: 0.75rem;
    color: var(--v2-red);
}

.fmv2-cta-text p {
    font-size: var(--v2-text-base);
    color: var(--v2-ink-2);
    max-width: 600px;
    line-height: 1.65;
}

.fmv2-btn-pulse {
    background: var(--v2-blue);
    color: var(--v2-white);
    padding: 1rem 2rem;
    border-radius: var(--v2-radius-pill);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--v2-text-sm);
    transition: transform var(--v2-duration-base) var(--v2-ease-out),
                box-shadow var(--v2-duration-base) var(--v2-ease-out),
                background var(--v2-duration-base) var(--v2-ease-out);
    box-shadow: var(--v2-shadow-lift);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.fmv2-btn-pulse:hover {
    transform: translateY(-3px);
    background: var(--v2-red);
}

@media (max-width: 900px) {
    .fmv2-cta-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .fmv2-cta-text p { margin: 0 auto; }

    .fmv2-btn-pulse {
        width: 100%;
        justify-content: center;
    }
}

/* --- Séparateur ---------------------------------------------------------- */

.fmv2-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0 2rem;
}

.fmv2-scroll-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--v2-ink-3);
    font-size: var(--v2-text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fmv2-mouse {
    width: 22px;
    height: 34px;
    border: 2px solid var(--v2-border-soft);
    border-radius: 12px;
    position: relative;
}

.fmv2-mouse::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: var(--v2-blue);
    border-radius: 2px;
    animation: fmv2-scroll 1.5s infinite;
}

@keyframes fmv2-scroll {
    0% { top: 6px; opacity: 1; }
    100% { top: 18px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fmv2-mouse::after { animation: none; }
}

/* --- Locator ---------------------------------------------------------------- */

#locator { padding-bottom: var(--v2-gap-xl); }

.fmv2-locator-headline {
    text-align: center;
    margin-bottom: var(--v2-gap-lg);
}

.fmv2-locator-headline h2 {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-2xl);
    color: var(--v2-ink);
}

.fmv2-locator-wrapper {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: var(--v2-shadow-lift);
    border-radius: var(--v2-radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 420px 1fr;
    height: 750px;
    position: relative;
}

.fmv2-sidebar {
    background: var(--v2-white);
    border-right: 1px solid var(--v2-border);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    overflow-y: hidden;
}

.fmv2-sidebar-header {
    padding: var(--v2-gap);
    border-bottom: 1px solid var(--v2-border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.fmv2-sidebar-header h2 {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-xl);
    color: var(--v2-ink);
    margin-bottom: 0.875rem;
}

.fmv2-filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--v2-sand);
    border-radius: var(--v2-radius-sm);
    margin-bottom: 0.875rem;
}

.fmv2-filter-tab {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: var(--v2-text-xs);
    cursor: pointer;
    transition: background var(--v2-duration-fast) var(--v2-ease-out),
                color var(--v2-duration-fast) var(--v2-ease-out);
    text-align: center;
    color: var(--v2-ink-2);
}

.fmv2-filter-tab.active {
    background: var(--v2-white);
    color: var(--v2-ink);
    box-shadow: var(--v2-shadow);
}

.fmv2-search-box {
    display: flex;
    align-items: center;
    background: var(--v2-cream);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    padding: 0.625rem;
}

.fmv2-search-box span {
    font-size: 1.05rem;
    margin-right: 0.5rem;
    color: var(--v2-ink-3);
}

.fmv2-search-box input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: var(--v2-text-sm);
    color: var(--v2-ink);
    font-family: var(--v2-font-body);
}

.fmv2-centers-list {
    padding: var(--v2-gap);
    padding-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    overflow-y: auto;
    flex-grow: 1;
}

.fmv2-center-card {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: var(--v2-gap-sm);
    cursor: pointer;
    transition: border-color var(--v2-duration-base) var(--v2-ease-out),
                box-shadow var(--v2-duration-base) var(--v2-ease-out),
                transform var(--v2-duration-base) var(--v2-ease-out);
    box-shadow: var(--v2-shadow);
}

.fmv2-center-card:hover {
    border-color: var(--v2-blue);
    box-shadow: var(--v2-shadow-lift);
    transform: translateY(-3px);
}

.fmv2-center-card:active {
    transform: translateY(-1px);
}

.fmv2-center-name {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-base);
    margin-bottom: 0.375rem;
    display: block;
    color: var(--v2-ink);
}

.fmv2-center-address {
    color: var(--v2-ink-2);
    font-size: var(--v2-text-xs);
    margin-bottom: 0.875rem;
    display: block;
}

.fmv2-center-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fmv2-c-tag {
    font-size: var(--v2-text-xs);
    background: var(--v2-blue-tint);
    color: var(--v2-blue);
    padding: 0.25rem 0.5rem;
    border-radius: var(--v2-radius-sm);
    font-weight: 600;
}

.fmv2-c-tag--distance {
    background: var(--v2-success-tint);
    color: var(--v2-success);
}

.fmv2-btn-contact {
    margin-top: 0.875rem;
    width: 100%;
    padding: 0.625rem;
    border: none;
    background: var(--v2-blue);
    color: var(--v2-white);
    border-radius: var(--v2-radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: var(--v2-text-xs);
    transition: background var(--v2-duration-fast) var(--v2-ease-out),
                transform var(--v2-duration-fast) var(--v2-ease-out),
                box-shadow var(--v2-duration-fast) var(--v2-ease-out);
}

.fmv2-btn-contact:hover {
    background: var(--v2-blue-dark);
    transform: translateY(-1px);
}

.fmv2-btn-contact:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(23, 33, 43, 0.16);
}

.fmv2-btn-text-short { display: none; }
.fmv2-btn-text-full { display: inline; }

/* --- Carte ------------------------------------------------------------------ */

.fmv2-map-frame {
    background-color: var(--v2-sand);
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#map { width: 100%; height: 100%; }

/* --- Panneau de contact -------------------------------------------------- */

.fmv2-contact-panel {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 380px;
    background: var(--v2-white);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-lift);
    transform: translateX(calc(100% + 50px));
    transition: transform var(--v2-duration-slow) var(--v2-ease-out);
    z-index: 1200;
    padding: var(--v2-gap);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.fmv2-contact-panel.active { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
    .fmv2-contact-panel { transition: none; }
}

.fmv2-close-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: var(--v2-text-lg);
    cursor: pointer;
    background: var(--v2-cream);
    border: none;
    color: var(--v2-ink-2);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--v2-duration-fast) var(--v2-ease-out),
                color var(--v2-duration-fast) var(--v2-ease-out);
}

.fmv2-close-panel:hover {
    background: var(--v2-blue);
    color: var(--v2-white);
}

.fmv2-cp-header { margin-bottom: 0.875rem; }

.fmv2-cp-tag {
    font-size: var(--v2-text-xs);
    color: var(--v2-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 0.25rem;
}

.fmv2-cp-header h2 {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-lg);
    color: var(--v2-ink);
    margin-bottom: 0.2rem;
}

.fmv2-cp-address {
    color: var(--v2-ink-2);
    font-size: var(--v2-text-xs);
}

.fmv2-form-group { margin-bottom: 0.625rem; }

.fmv2-label {
    display: block;
    font-size: var(--v2-text-xs);
    font-weight: 700;
    color: var(--v2-ink);
    margin-bottom: 0.2rem;
}

.fmv2-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--v2-border-soft);
    border-radius: var(--v2-radius-sm);
    background: var(--v2-cream);
    font-family: var(--v2-font-body);
    font-size: var(--v2-text-sm);
    outline: none;
    color: var(--v2-ink);
    transition: border-color var(--v2-duration-fast) var(--v2-ease-out),
                background var(--v2-duration-fast) var(--v2-ease-out);
}

.fmv2-input:focus {
    background: var(--v2-white);
    border-color: var(--v2-blue);
}

select.fmv2-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230F3D63' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2.25rem;
    appearance: none;
}

.fmv2-input option {
    background-color: var(--v2-white);
    color: var(--v2-ink);
}

.fmv2-input optgroup {
    background-color: var(--v2-blue-tint);
    color: var(--v2-blue);
    font-weight: 700;
    font-size: var(--v2-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fmv2-input option:disabled {
    color: var(--v2-ink-3);
    font-style: italic;
}

.fmv2-btn-submit {
    width: 100%;
    padding: 0.625rem;
    background: var(--v2-blue);
    color: var(--v2-white);
    border: none;
    border-radius: var(--v2-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background var(--v2-duration-fast) var(--v2-ease-out),
                transform var(--v2-duration-fast) var(--v2-ease-out);
    font-size: var(--v2-text-sm);
}

.fmv2-btn-submit:hover {
    background: var(--v2-blue-dark);
    transform: translateY(-1px);
}

.fmv2-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.fmv2-info-box {
    background: var(--v2-blue-tint);
    padding: 0.625rem;
    border-radius: var(--v2-radius-sm);
    margin-bottom: 0.625rem;
    font-size: var(--v2-text-xs);
    color: var(--v2-ink);
    border: 1px solid rgba(var(--v2-blue-rgb), 0.15);
}

/* --- Pagination --------------------------------------------------------- */

.fmv2-pagination-container {
    padding: var(--v2-gap-sm);
    border-top: 1px solid var(--v2-border);
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--v2-white);
    margin-top: auto;
}

.fmv2-pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.fmv2-page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--v2-radius-sm);
    border: 1px solid var(--v2-border);
    background: var(--v2-white);
    cursor: pointer;
    transition: background var(--v2-duration-fast) var(--v2-ease-out),
                border-color var(--v2-duration-fast) var(--v2-ease-out);
    font-weight: 600;
    font-size: var(--v2-text-sm);
    color: var(--v2-ink);
}

.fmv2-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.fmv2-page-btn:not(:disabled):hover {
    background: var(--v2-cream);
    border-color: var(--v2-blue);
}

.fmv2-page-btn.active {
    background: var(--v2-blue);
    color: var(--v2-white);
    border-color: var(--v2-blue);
}

.fmv2-page-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }

/* --- Overlay (mobile uniquement) ------------------------------------------ */

.fmv2-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--v2-duration-base) var(--v2-ease-out);
}

.fmv2-overlay.active { display: none; opacity: 0; pointer-events: none; }

/* --- Responsive ------------------------------------------------------------- */

@media (max-width: 1024px) {
    .fmv2-locator-wrapper { grid-template-columns: 380px 1fr; }
    .fmv2-sidebar-header h2 { font-size: var(--v2-text-lg); }
}

@media (max-width: 768px) {
    .fmv2-hero { padding: 2.5rem var(--v2-pad-x) 2rem; }
    .fmv2-hero-title { font-size: var(--v2-text-3xl); }

    .fmv2-pillars {
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: var(--v2-gap-lg);
    }

    .fmv2-pillars::after { display: none; }

    .fmv2-pillar {
        padding: 1.75rem var(--v2-pad-x);
        border-bottom: 1px solid var(--v2-border);
        border-radius: 0;
    }

    .fmv2-locator-wrapper {
        border-radius: var(--v2-radius-lg);
        border: none;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        overflow-x: hidden;
        height: auto;
    }

    .fmv2-map-frame {
        height: 45vh;
        order: 1;
        overflow: visible !important;
    }

    .fmv2-filter-tabs {
        display: flex !important;
        margin-top: 0.875rem;
        margin-bottom: 0;
    }

    .fmv2-sidebar {
        border-right: none;
        border-top: 1px solid var(--v2-border);
        border-radius: var(--v2-radius-lg) var(--v2-radius-lg) 0 0;
        margin-top: -1.25rem;
        z-index: 20;
        box-shadow: 0 -10px 30px rgba(23, 33, 43, 0.06);
        min-height: 30vh;
        order: 2;
        overflow-y: visible;
    }

    .fmv2-sidebar-header {
        border-radius: var(--v2-radius-lg) var(--v2-radius-lg) 0 0;
    }

    .fmv2-overlay {
        display: block !important;
        z-index: 99998;
    }

    .fmv2-overlay.active {
        display: block !important;
        opacity: 1;
        pointer-events: all;
    }

    .fmv2-contact-panel {
        position: fixed;
        inset: auto 0 0 0;
        top: auto;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: var(--v2-radius-lg) var(--v2-radius-lg) 0 0;
        transform: translateY(100%);
        padding: var(--v2-gap) var(--v2-pad-x) 1.75rem;
        z-index: 99999;
        box-shadow: 0 -10px 40px rgba(23, 33, 43, 0.25);
    }

    .fmv2-contact-panel.active { transform: translateY(0); }

    .fmv2-close-panel {
        position: sticky;
        top: 0;
        float: right;
        width: 34px;
        height: 34px;
        z-index: 10;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .fmv2-hero-title { font-size: var(--v2-text-2xl); }
    .fmv2-map-frame { height: 40vh; }
    .fmv2-overlay { display: none !important; }
}
