/* ===================================================================
   FORMATION DETAIL — Shared Styles
   Used by: haccp, duerp, decoupe, vigne, permis-exploitation
   
   Each page sets these custom properties in a tiny <style> block:
     --f-primary, --f-bg, --f-gradient
   =================================================================== */

/* ===== PAGE HERO ===== */
.page-hero {
    background: var(--f-gradient);
    padding: 160px 0 80px;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: var(--white);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    opacity: 0.7;
}

/* ===== HERO CONTENT ===== */
.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--white);
    margin-bottom: 16px;
}

.page-hero-subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    opacity: 1;
    max-width: 700px;
    margin: 0 auto 24px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 400;
    line-height: 1.6;
}

.page-hero-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.page-hero-badge i {
    color: var(--gold-400);
}

/* ===== FORMATION DETAIL GRID ===== */
.formation-detail {
    padding: 80px 0;
}

.formation-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

/* ===== FORMATION CONTENT ===== */
.formation-content h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.formation-content h3 {
    font-size: 1.35rem;
    margin: 32px 0 16px;
    color: var(--gray-800);
}

.formation-content p {
    line-height: 1.8;
    margin-bottom: 16px;
}

.formation-content ul {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.formation-content ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.formation-content ul li:last-child {
    border-bottom: none;
}

.formation-content ul li i {
    color: var(--f-primary);
    font-size: 1rem;
    margin-top: 4px;
}

/* ===== SIDEBAR ===== */
.formation-sidebar {
    position: sticky;
    top: 120px;
}

.formation-info-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.formation-price-tag {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-100);
}

.formation-price-value {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--f-primary);
    line-height: 1;
}

.formation-price-value span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-500);
}

.formation-price-note {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 8px;
}

.formation-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.formation-info-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.formation-info-list li:last-child {
    border-bottom: none;
}

.formation-info-list i {
    width: 40px;
    height: 40px;
    background: var(--f-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--f-primary);
}

.formation-info-list strong {
    display: block;
    color: var(--gray-900);
}

.formation-info-list span {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ===== CTA CARD ===== */
.cta-card {
    background: var(--f-gradient);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    color: var(--white);
}

.cta-card h4 {
    color: var(--white);
    margin-bottom: 12px;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.cta-card .btn {
    width: 100%;
    justify-content: center;
}

/* ===== PROGRAMME ACCORDION ===== */
.programme-accordion {
    margin-top: 32px;
}

.accordion-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 20px 24px;
    background: var(--white);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: left;
    transition: all var(--transition-base);
}

.accordion-header:hover {
    background: var(--f-bg);
}

.accordion-header.active {
    background: var(--f-bg);
    color: var(--f-primary);
}

.accordion-header i {
    transition: transform var(--transition-base);
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content-inner {
    padding: 0 24px 24px;
}

.accordion-content-inner ul {
    margin: 0;
}

/* ===== PROGRAMME DAYS GRID ===== */
.programme-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.programme-day {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--f-primary);
}

.programme-day h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--f-primary);
    font-size: 1.1rem;
}

.programme-day h4 i {
    font-size: 1.5rem;
}

.programme-day ul {
    margin: 0;
    padding-left: 0;
}

.programme-day li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.95rem;
}

.programme-day li:last-child {
    border-bottom: none;
}

/* ===== ALERT BOX ===== */
.alert-box {
    background: var(--f-bg);
    border-left: 4px solid var(--f-primary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.alert-box p {
    margin: 0;
    font-weight: 500;
    color: var(--gray-800);
}

.alert-box i {
    color: var(--f-primary);
    margin-right: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .formation-detail-grid {
        grid-template-columns: 1fr;
    }

    .formation-sidebar {
        position: static;
    }

    .programme-days {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 120px 0 60px;
    }

    .page-hero h1 {
        font-size: 1.75rem;
    }

    .page-hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .formation-info-card {
        padding: 24px;
    }
}

/* ─── Per-formation colour mapping ─── */
body.page-permis  { --f-primary: var(--permis-primary);  --f-bg: var(--permis-bg);  --f-gradient: var(--permis-gradient);  }
body.page-haccp   { --f-primary: var(--haccp-primary);   --f-bg: var(--haccp-bg);   --f-gradient: var(--haccp-gradient);   }
body.page-vigne   { --f-primary: var(--vigne-primary);   --f-bg: var(--vigne-bg);   --f-gradient: var(--vigne-gradient);   }
body.page-duerp   { --f-primary: var(--duerp-primary);   --f-bg: var(--duerp-bg);   --f-gradient: var(--duerp-gradient);   }
body.page-decoupe { --f-primary: var(--decoupe-primary); --f-bg: var(--decoupe-bg); --f-gradient: var(--decoupe-gradient); }
