/* ==========================================================================
   Nouvelle Saison Formation — refonte 2026
   Couche de design commune, chargée après site.css sur toutes les pages.
   Même charte : vert sauge, bleu canard, beige, rose poudré, corail,
   Cormorant Garamond pour les titres, Montserrat pour le texte.
   ========================================================================== */

:root {
    --teal-900: #1C4350;
    --teal-800: #234F5D;
    --sage-50: #F2F6EF;
    --sage-100: #E3EBDC;
    --line: rgba(44, 95, 111, 0.12);
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 28px;
    --shadow-xs: 0 1px 2px rgba(28, 67, 80, 0.06);
    --shadow-sm: 0 4px 14px rgba(28, 67, 80, 0.07);
    --shadow: 0 14px 40px -12px rgba(28, 67, 80, 0.18);
    --shadow-lg: 0 30px 70px -20px rgba(28, 67, 80, 0.30);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --nav-h: 76px;
}

/* ---------- Base ---------- */
/* Chiffres alignés (Cormorant affiche sinon « 100 » comme « IOO ») */
.nsf-stat-number, .stat-number, .num, .rating-score, .stat-item .stat-number, h1, h2, h3 { font-variant-numeric: lining-nums; }
body {
    background: var(--cream);
    color: var(--dark-text);
    font-feature-settings: "kern", "liga";
}
h1, h2, h3, h4 { letter-spacing: -0.01em; line-height: 1.2; }
.hero h1, .nsf-hero h1 { letter-spacing: -0.015em !important; }
html { scroll-padding-top: calc(var(--nav-h) + 12px); }

/* ---------- Barre de progression de lecture ---------- */
.nsf-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 100%;
    transform-origin: 0 50%; transform: scaleX(0);
    background: linear-gradient(90deg, var(--sage-green), var(--deep-teal) 60%, var(--accent-coral));
    z-index: 1100; pointer-events: none;
}

/* ---------- Navigation ---------- */
.nav {
    padding-top: 1.1rem !important; padding-bottom: 1.1rem !important;
    background: rgba(250, 247, 242, 0.78) !important;
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid transparent !important;
    gap: 1.5rem;
}
.nav.nav--scrolled {
    background: rgba(250, 247, 242, 0.92) !important;
    border-bottom-color: var(--line) !important;
    box-shadow: 0 8px 30px -18px rgba(28, 67, 80, 0.35);
}
@media (min-width: 961px) {
    .nav.nav--scrolled { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
}
.nav .logo {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: 1.75rem !important; letter-spacing: 0.06em !important;
    color: var(--deep-teal) !important; white-space: nowrap;
}
.nav .logo::before {
    content: ""; width: 34px; height: 34px; flex: none;
    background: url(../images/logo-mark.png) center / contain no-repeat;
}
.nav-links { align-items: center; margin: 0 0 0 auto; padding: 0; }
.nav-links a {
    position: relative; padding: 0.4rem 0 !important;
    font-size: 0.9rem !important; font-weight: 500 !important;
    color: var(--dark-text) !important; border-bottom: 0 !important;
}
.nav-links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--sage-green); border-radius: 2px;
    transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links a[aria-current="page"] { color: var(--deep-teal) !important; font-weight: 600 !important; }
.nav-links a .nsf-new-badge::after { display: none; }

.nav-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.25rem; border-radius: 999px;
    background: var(--deep-teal); color: #fff !important; text-decoration: none;
    font-size: 0.88rem; font-weight: 600; white-space: nowrap;
    box-shadow: 0 8px 20px -8px rgba(44, 95, 111, 0.6);
    transition: background 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.nav-cta:hover { background: var(--teal-900); transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(44, 95, 111, 0.7); }
.nav-cta svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.nav-cta:hover svg { transform: translateX(3px); }
@media (max-width: 1150px) { .nav-cta { display: none; } }

/* Menu mobile */
.hamburger span { height: 2px !important; width: 24px !important; margin: 3.5px 0 !important; }
.hamburger.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg) !important; }
.hamburger.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg) !important; }
.mobile-menu {
    width: min(86vw, 380px) !important; max-width: none !important;
    background: var(--cream) !important;
    padding: calc(var(--nav-h) + 1rem) 1.5rem 2rem !important;
    box-shadow: -30px 0 60px -20px rgba(28, 67, 80, 0.35) !important;
    transition: right 0.5s var(--ease) !important;
    display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-menu ul li { border-bottom: 1px solid var(--line) !important; }
.mobile-menu ul li a {
    padding: 1.1rem 0.25rem !important; font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem !important; font-weight: 600 !important; color: var(--deep-teal) !important;
    display: flex !important; align-items: center; justify-content: space-between;
}
.mobile-menu ul li a::after { content: "→"; font-family: 'Montserrat', sans-serif; font-size: 1rem; opacity: 0.4; transition: transform 0.3s var(--ease), opacity 0.3s; }
.mobile-menu ul li a:hover { background: transparent !important; padding-left: 0.25rem !important; }
.mobile-menu ul li a:hover::after { transform: translateX(4px); opacity: 1; }
.mobile-menu .nav-cta { display: flex; justify-content: center; margin-top: 1.75rem; padding: 1rem; font-size: 1rem; }
.mobile-menu-contact { margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted-text); text-align: center; line-height: 1.8; }
.mobile-menu-contact a { color: var(--deep-teal); font-weight: 600; text-decoration: none; }
.menu-overlay { background: rgba(28, 67, 80, 0.35) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ---------- Héros des pages intérieures ---------- */
.hero, .nsf-hero { isolation: isolate; }
.hero::after, .nsf-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(60% 80% at 85% 10%, rgba(244, 232, 232, 0.22), transparent 60%),
        radial-gradient(50% 70% at 10% 100%, rgba(156, 175, 136, 0.35), transparent 60%);
}
.hero-content, .nsf-hero-content { position: relative; z-index: 2; }
.hero h1, .nsf-hero h1 {
    font-size: clamp(2.3rem, 5vw, 4rem) !important; line-height: 1.08 !important; font-weight: 600 !important;
}
.hero-content > *, .nsf-hero-content > * { animation: nsfRise 0.9s var(--ease) both; }
.hero-content > *:nth-child(2), .nsf-hero-content > *:nth-child(2) { animation-delay: 0.08s; }
.hero-content > *:nth-child(3), .nsf-hero-content > *:nth-child(3) { animation-delay: 0.16s; }
.hero-content > *:nth-child(4), .nsf-hero-content > *:nth-child(4) { animation-delay: 0.24s; }
.hero-content > *:nth-child(n+5), .nsf-hero-content > *:nth-child(n+5) { animation-delay: 0.32s; }
@keyframes nsfRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Fiches formation : bandeau en dégradé, on ajoute de la matière */
.hero:not(:has(.hero-bg)) {
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10) 0 1px, transparent 1.5px) 0 0 / 22px 22px,
        linear-gradient(135deg, var(--teal-900) 0%, var(--deep-teal) 45%, #5A8A94 75%, var(--sage-green) 120%) !important;
    min-height: min(62vh, 620px); height: auto !important; padding: 6rem 5% 5rem;
}
.hero-meta { gap: 0.75rem !important; margin-top: 1.5rem; }
.hero-meta .meta-item {
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.95rem !important;
}
.hero .breadcrumb a, .breadcrumb a { text-decoration: none; }
.hero .breadcrumb { letter-spacing: 0.04em; }

/* ---------- Boutons ---------- */
.btn, .nsf-btn, .formation-cta, .submit-btn, .btn-submit, .btn-primary, .btn-secondary, .cta-band a {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: 999px !important;
    transition: transform 0.35s var(--ease), box-shadow 0.35s ease, background-color 0.3s ease, color 0.3s ease !important;
}
.btn::before, .nsf-btn::before, .formation-cta::before, .submit-btn::before, .btn-primary::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform 0.8s var(--ease);
}
.btn:hover::before, .nsf-btn:hover::before, .formation-cta:hover::before, .submit-btn:hover::before, .btn-primary:hover::before { transform: translateX(120%); }
.btn:hover, .nsf-btn:hover, .formation-cta:hover, .submit-btn:hover, .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 16px 30px -12px rgba(28, 67, 80, 0.45) !important;
}
.btn-primary:hover { background: var(--teal-900) !important; color: #fff !important; }
.btn:active, .nsf-btn:active { transform: translateY(0) scale(0.98) !important; }

/* ---------- Cartes ---------- */
.card, .nsf-card, .formation-card, .info-card, .feature-card, .value-card, .cert-card,
.cta-card, .review-card, .stat-item, .nsf-stat, .highlight-box, .form-container, .contact-info {
    border-radius: var(--radius) !important;
}
.card, .nsf-card, .formation-card, .feature-card, .value-card, .cert-card, .info-card, .nsf-stat, .stat-item {
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--line);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s ease !important;
}
.card:hover, .nsf-card:hover, .formation-card:hover, .feature-card:hover, .value-card:hover, .cert-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: var(--shadow) !important;
    border-color: rgba(156, 175, 136, 0.55);
}
.nsf-card { border-top: 1px solid var(--line) !important; position: relative; overflow: hidden; }
.nsf-card::before {
    content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
    background: linear-gradient(90deg, var(--sage-green), var(--deep-teal));
    transform: scaleX(0.25); transform-origin: left; transition: transform 0.6s var(--ease);
}
.nsf-card:hover::before { transform: scaleX(1); }
.nsf-card--pink::before { background: linear-gradient(90deg, var(--accent-coral), var(--deep-teal)); }

/* Halo qui suit la souris (ajouté par site.js) */
.nsf-glow { --mx: 50%; --my: 50%; }
.nsf-glow::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(156, 175, 136, 0.16), transparent 45%);
    opacity: 0; transition: opacity 0.4s ease;
}
.nsf-glow:hover::after { opacity: 1; }
.formation-card, .feature-card, .value-card, .cert-card, .card { position: relative; }

/* Cartes « vedette » de la page Formations : la bordure bleue doit rester visible */
.formation-card.formation-card--featured { border: 2px solid var(--deep-teal); }

/* Grille dont la dernière ligne, incomplète, reste centrée (7 tuiles sur 4 colonnes) */
.nsf-grid--center { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.nsf-grid--center > * { flex: 0 0 calc(25% - 1.125rem); }
@media (max-width: 1100px) { .nsf-grid--center > * { flex-basis: calc(50% - 0.75rem); } }
@media (max-width: 768px) { .nsf-grid--center > * { flex-basis: 100%; } }

/* ---------- Titres de section ---------- */
.section-header h2, .nsf-head h2, .nsf-h2, .section-title, .category-title, .about-text h2 {
    font-size: clamp(2rem, 3.6vw, 3rem) !important; line-height: 1.12 !important; font-weight: 600 !important;
}
.nsf-kicker {
    display: inline-flex !important; align-items: center; gap: 0.6rem;
    font-size: 0.78rem !important; letter-spacing: 0.18em !important;
    padding: 0.4rem 0.9rem; border-radius: 999px;
    background: var(--sage-50); border: 1px solid var(--sage-100);
}
.nsf-kicker::after { display: none !important; }
.nsf-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage-green); }
.nsf-hero .nsf-kicker { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
.nsf-hero .nsf-kicker::before { background: #fff; }

/* ---------- Apparitions au défilement ---------- */
/* Animation (et non transition) : le survol des cartes garde sa propre vitesse */
.fade-in:not(.visible) { opacity: 0; }
.fade-in.visible { animation: nsfReveal 0.9s var(--ease) var(--d, 0s) backwards; }
@keyframes nsfReveal {
    from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}

/* Fiches formation : « Informations pratiques » */
.info-card .info-item { gap: 1rem; }
.info-card .info-value { text-align: right; }

/* ---------- Formulaires ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea {
    border-radius: var(--radius-sm) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus, select:focus, textarea:focus {
    outline: none !important; border-color: var(--deep-teal) !important;
    box-shadow: 0 0 0 4px rgba(44, 95, 111, 0.12) !important; background: #fff !important;
}

/* ---------- FAQ ---------- */
.nsf-faq details { border: 1px solid var(--line); transition: box-shadow 0.3s ease; }
.nsf-faq details[open] { box-shadow: var(--shadow); }
.nsf-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.nsf-faq summary::-webkit-details-marker { display: none; }
.nsf-faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; transition: transform 0.35s var(--ease); }
.nsf-faq details[open] summary::after { transform: rotate(45deg); }

/* ---------- Bandeau d'appel à l'action ---------- */
.nsf-cta, .cta-section {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(135deg, var(--teal-900) 0%, var(--deep-teal) 55%, #4E8090 100%) !important;
}
.nsf-cta::before, .cta-section::before {
    content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; border-radius: 50%;
    right: -160px; top: -220px; background: radial-gradient(circle, rgba(156,175,136,0.45), transparent 65%);
}
.nsf-cta::after, .cta-section::after {
    content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%;
    left: -140px; bottom: -220px; background: radial-gradient(circle, rgba(232,153,141,0.35), transparent 65%);
}
.nsf-cta h2 { font-size: clamp(2rem, 4vw, 3.2rem) !important; line-height: 1.1; }

/* ---------- Pied de page ---------- */
footer {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--teal-900) !important; margin-top: 0 !important;
    padding: 5rem 5% 2.5rem !important;
}
footer::before {
    content: ""; position: absolute; z-index: -1; inset: 0;
    background:
        radial-gradient(40% 60% at 100% 0%, rgba(156, 175, 136, 0.22), transparent 70%),
        radial-gradient(30% 50% at 0% 100%, rgba(232, 153, 141, 0.14), transparent 70%);
}
footer h3 {
    font-family: 'Montserrat', sans-serif !important; font-size: 0.78rem !important;
    letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
    color: var(--sage-green) !important; margin-bottom: 1.2rem !important;
}
footer a { transition: opacity 0.25s ease, color 0.25s ease; }
footer a:hover { color: #fff !important; }
footer ul li a { display: inline-block; transition: transform 0.3s var(--ease), opacity 0.25s ease !important; }
footer ul li a:hover { transform: translateX(4px); text-decoration: none !important; }
footer p, footer li { font-size: 0.93rem; }
.footer-brand {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
    max-width: 1200px; margin: 0 auto 3rem; padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-brand-name { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 600; color: #fff; line-height: 1.1; }
.footer-brand-name span { display: block; font-family: 'Montserrat', sans-serif; font-size: 0.85rem; font-weight: 400; opacity: 0.75; margin-top: 0.4rem; }
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22); color: #fff !important; opacity: 1 !important;
    transition: background 0.3s ease, transform 0.3s var(--ease), border-color 0.3s ease !important;
}
.footer-social a:hover { background: var(--sage-green); border-color: var(--sage-green); transform: translateY(-3px); text-decoration: none !important; }
.footer-social svg { width: 18px; height: 18px; }

/* ---------- Retour en haut ---------- */
.nsf-totop {
    position: fixed; right: 20px; bottom: 20px; z-index: 980;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    display: grid; place-items: center;
    background: #fff; color: var(--deep-teal);
    box-shadow: var(--shadow); border: 1px solid var(--line);
    opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s var(--ease), background 0.3s ease, color 0.3s ease;
}
.nsf-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.nsf-totop:hover { background: var(--deep-teal); color: #fff; }
.nsf-totop svg { width: 20px; height: 20px; }

/* Encart nouveautés : un peu plus discret */
.nsf-news { border-top: 0 !important; border: 1px solid var(--line); box-shadow: var(--shadow-lg) !important; }
.nsf-news::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--accent-coral), var(--sage-green));
}

/* ---------- Pages légales (mise en page simple) ---------- */
.container { line-height: 1.8; }
.container h1 { font-family: 'Cormorant Garamond', serif; color: var(--deep-teal); font-size: clamp(2.2rem, 4.5vw, 3.2rem) !important; line-height: 1.1; }
.container h2 { font-family: 'Cormorant Garamond', serif; color: var(--deep-teal); }

/* ---------- Mouvements réduits ---------- */
@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1 !important; animation: none !important; }
    .hero-content > *, .nsf-hero-content > * { animation: none !important; }
    .nsf-progress { display: none; }
}

@media (max-width: 960px) {
    :root { --nav-h: 68px; }
    .nav .logo { font-size: 1.45rem !important; }
    .nav .logo::before { width: 28px; height: 28px; }
}
@media (max-width: 600px) {
    .nsf-totop { right: 16px; bottom: 16px; width: 44px; height: 44px; }
    footer { padding-top: 3.5rem !important; }
    /* Encart nouveautés : laisse la place au bouton « haut de page » */
    .nsf-news { max-width: calc(100vw - 92px) !important; padding: 0.9rem 1rem 0.6rem !important; }
    .nsf-news a span { display: none; }
    /* Liens légaux : séparateurs « | » masqués quand ils passent à la ligne */
    footer span[style*="opacity: 0.5"] { display: none; }
    footer div[style*="flex-wrap: wrap"] { gap: 0.6rem 1.4rem !important; }
}
