/* ================================================================
   formation-course.css — CyberShield Academy (Cisco NetAcad Style)
   Palette: #003087 (Trust Blue) | #009cde (Tech Blue) | White & Light Slate
   Layout: Centered 1240px Container, Two Columns (280px / 1fr), Zero Overflow
   ================================================================ */

/* ── Container & Global Centering ────────────────────────────── */
html, body {
    max-width: 100vw;
    overflow-x: clip;
}

main.container {
    max-width: 1240px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* ── Course Breadcrumb ───────────────────────────────────────── */
.course-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}
.course-breadcrumb a {
    color: #003087;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.course-breadcrumb a:hover {
    color: #009cde;
    text-decoration: underline;
}
.course-breadcrumb .sep {
    color: #cbd5e1;
}
.course-breadcrumb .current {
    color: #475569;
    font-weight: 600;
}

/* ── Sticky / Embedded Progress Bar ──────────────────────────── */
.course-progress-bar-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 48, 135, 0.04);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.course-progress-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    width: 100%;
    box-sizing: border-box;
}
.course-progress-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #003087;
    white-space: nowrap;
    min-width: 130px;
}
.course-progress-track {
    flex: 1;
    min-width: 0;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.course-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #003087, #009cde);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}
.course-progress-pct {
    font-size: 0.82rem;
    font-weight: 800;
    color: #009cde;
    min-width: 38px;
    text-align: right;
}

/* ── Reader 2-Column Grid (Centered & Bounded) ───────────────── */
.course-reader {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 150px);
    box-sizing: border-box;
    margin: 0 0 60px;
    align-items: start;
}

/* ── Left Sidebar (Table of Contents) ────────────────────────── */
.course-sidebar {
    width: 280px;
    max-width: 280px;
    min-width: 0;
    box-sizing: border-box;
    position: sticky;
    top: 85px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 48, 135, 0.04);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.course-sidebar::-webkit-scrollbar { width: 4px; }
.course-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.sidebar-course-title {
    padding: 16px 18px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8faff;
    box-sizing: border-box;
}
.sidebar-course-title h3 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #003087;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}
.sidebar-course-title p {
    font-size: 0.74rem;
    color: #64748b;
    margin: 4px 0 0;
}

.sidebar-chapters-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
    box-sizing: border-box;
}
.sidebar-chapter-item {
    display: block;
    padding: 0;
    box-sizing: border-box;
}
.sidebar-chapter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #334155;
    box-sizing: border-box;
}
.sidebar-chapter-btn:hover {
    background: #f0f7ff;
    border-left-color: #009cde;
    color: #003087;
}
.sidebar-chapter-btn.active {
    background: #eff6ff;
    border-left-color: #003087;
    color: #003087;
}
.sidebar-chapter-btn.completed .chapter-icon {
    color: #16a34a;
}
.sidebar-chapter-btn.locked {
    color: #94a3b8;
}

.chapter-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    flex-shrink: 0;
    transition: all 0.2s;
}
.sidebar-chapter-btn.active .chapter-num {
    background: #003087;
    color: #fff;
}
.sidebar-chapter-btn.completed .chapter-num {
    background: #dcfce7;
    color: #16a34a;
}
.sidebar-chapter-btn.locked .chapter-num {
    background: #f1f5f9;
    color: #94a3b8;
}

.chapter-info {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}
.chapter-info-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
    display: block;
    white-space: normal;
    word-break: break-word;
}
.chapter-info-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 2px;
    display: block;
}
.sidebar-chapter-btn.active .chapter-info-meta { color: #93c5fd; }

.chapter-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #94a3b8;
}
.sidebar-chapter-btn.active .chapter-icon { color: #003087; }

/* ── Content Area (Right Column — ZERO OVERFLOW) ─────────────── */
.course-content-area {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.course-content-area * {
    box-sizing: border-box;
    max-width: 100%;
}

/* Chapter Header */
.chapter-header {
    background: linear-gradient(135deg, #003087 0%, #0056b3 50%, #009cde 100%);
    border-radius: 14px;
    padding: 28px 30px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 48, 135, 0.08);
}
.chapter-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}
.chapter-header-label {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
    display: block;
    word-break: break-word;
}
.chapter-header h1 {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.35;
    margin: 0 0 14px;
    color: #fff;
    word-break: break-word;
    overflow-wrap: break-word;
}
.chapter-header-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.chapter-header-meta span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Section Cards ───────────────────────────────────────────── */
.section-card {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.section-card-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-card-body {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 22px;
    font-size: 0.93rem;
    color: #334155;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
    word-wrap: break-word;
}

/* Objectives */
.section-objectives .section-card-header {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-bottom: 1px solid #bfdbfe;
}
.section-objectives .section-card-header i { color: #1d4ed8; font-size: 1.1rem; }
.section-objectives .section-card-header h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0;
    word-break: break-word;
}
.objectives-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.objectives-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.91rem;
    color: #334155;
    line-height: 1.5;
    word-break: break-word;
}
.objectives-list li::before {
    content: '';
    min-width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23003087'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Theory */
.section-theory .section-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.section-theory .section-card-header i { color: #003087; font-size: 1.1rem; }
.section-theory .section-card-header h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    word-break: break-word;
}
.section-theory .section-card-body h4 {
    font-size: 1.02rem;
    font-weight: 800;
    color: #003087;
    margin: 20px 0 10px;
    word-break: break-word;
}
.section-theory .section-card-body h4:first-child { margin-top: 0; }
.section-theory .section-card-body p { margin-bottom: 14px; word-break: break-word; }
.section-theory .section-card-body ul, .section-theory .section-card-body ol {
    padding-left: 20px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.section-theory .section-card-body li { word-break: break-word; }

/* Responsive Tables Inside Content */
.section-card-body table,
.course-content-area table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0 !important;
    box-sizing: border-box;
}
.section-card-body table th,
.section-card-body table td {
    word-break: break-word;
    min-width: 110px;
    box-sizing: border-box;
}

/* Callout Boxes */
.info-box, .warning-box, .danger-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}
.info-box {
    background: #f0f7ff;
    border-left: 4px solid #009cde;
    color: #1e3a8a;
}
.info-box strong { display: block; margin-bottom: 4px; color: #003087; }
.warning-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}
.danger-box {
    background: #fff1f2;
    border-left: 4px solid #e11d48;
    color: #9f1239;
}

/* Monospace text blocks */
.section-theory .section-card-body div {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Inline Code */
code {
    background: #f1f5f9;
    color: #0284c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85em;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Code Blocks */
.section-code pre,
pre,
pre code,
#lab-code-content,
#lab-code-content code {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    word-wrap: break-word !important;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.84rem;
    line-height: 1.65;
}
.section-code pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 18px;
    margin: 0;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* ── Quiz Section (Interactive NetAcad Style) ─────────────────── */
.section-quiz .section-card-header {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 1px solid #86efac;
    padding: 16px 20px;
}
.section-quiz .section-card-header i { color: #16a34a; font-size: 1.1rem; }
.section-quiz .section-card-header h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #14532d;
    margin: 0;
}
.section-quiz .section-card-header .quiz-badge {
    margin-left: auto;
    background: #16a34a;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
}

.quiz-question-block {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed #e2e8f0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.quiz-question-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.quiz-q-num {
    font-size: 0.72rem;
    font-weight: 800;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.quiz-question-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.quiz-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    padding: 11px 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
    color: #334155;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}
.quiz-option-btn:hover:not(:disabled) {
    border-color: #009cde;
    background: #f0f9ff;
    color: #003087;
}
.quiz-option-btn.correct {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}
.quiz-option-btn.wrong {
    border-color: #dc2626;
    background: #fff1f2;
    color: #991b1b;
}
.quiz-option-btn:disabled { cursor: default; }
.quiz-option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 800;
    color: #64748b;
    flex-shrink: 0;
}
.quiz-option-btn.correct .quiz-option-letter { background: #16a34a; color: #fff; }
.quiz-option-btn.wrong .quiz-option-letter { background: #dc2626; color: #fff; }
.quiz-option-btn:hover:not(:disabled) .quiz-option-letter { background: #003087; color: #fff; }
.quiz-option-btn span:last-child {
    min-width: 0;
    flex: 1;
    word-break: break-word;
}

.quiz-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.5;
    display: none;
    word-break: break-word;
    box-sizing: border-box;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct-fb { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.quiz-feedback.wrong-fb { background: #fff1f2; border: 1px solid #fecaca; color: #991b1b; }
.quiz-feedback i { margin-right: 6px; }

/* ── Summary Section ─────────────────────────────────────────── */
.section-summary .section-card-header {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-bottom: 1px solid #c4b5fd;
    padding: 16px 20px;
}
.section-summary .section-card-header i { color: #7c3aed; font-size: 1.1rem; }
.section-summary .section-card-header h3 { font-size: 0.98rem; font-weight: 800; color: #4c1d95; margin: 0; }
.summary-points-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.summary-points-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.91rem;
    color: #334155;
    line-height: 1.5;
    word-break: break-word;
}
.summary-points-list li::before {
    content: '▸';
    color: #7c3aed;
    font-weight: 900;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ── Chapter Complete Button ─────────────────────────────────── */
.chapter-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #003087;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(0, 48, 135, 0.2);
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
}
.chapter-complete-btn:hover { background: #0056b3; transform: translateY(-1px); }
.chapter-complete-btn.done { background: #16a34a; box-shadow: 0 4px 14px rgba(22, 163, 74, 0.2); }

/* ── Chapter Navigation Footer ───────────────────────────────── */
.chapter-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.chapter-nav-prev, .chapter-nav-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid #003087;
    color: #003087;
    background: #fff;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    text-align: center;
}
.chapter-nav-prev:hover, .chapter-nav-next:hover {
    background: #003087;
    color: #fff;
}
.chapter-nav-next {
    background: #003087;
    color: #fff;
}
.chapter-nav-next:hover { background: #0056b3; border-color: #0056b3; }

/* ── Paywall Overlay (Inside Content Area) ───────────────────── */
.chapter-paywall {
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid #003087;
    padding: 38px 28px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 48, 135, 0.08);
    width: 100%;
    max-width: 640px;
    margin: 30px auto;
    box-sizing: border-box;
    overflow: hidden;
}
.paywall-lock-icon {
    width: 68px;
    height: 68px;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.paywall-lock-icon i { font-size: 1.8rem; color: #003087; }
.chapter-paywall h2 { font-size: 1.5rem; font-weight: 900; color: #0f172a; margin-bottom: 12px; word-break: break-word; }
.chapter-paywall p { font-size: 0.93rem; color: #475569; line-height: 1.7; max-width: 500px; margin: 0 auto 22px; word-break: break-word; }
.paywall-features {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 22px;
    text-align: left;
    box-sizing: border-box;
}
.paywall-features ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.paywall-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #334155;
    word-break: break-word;
}
.paywall-features li i { color: #16a34a; width: 16px; flex-shrink: 0; }
.paywall-price-box { margin-bottom: 20px; }
.paywall-price-label { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.paywall-price-amount { font-size: 2.6rem; font-weight: 900; color: #0f172a; line-height: 1.1; margin: 6px 0; }
.paywall-price-old { font-size: 1.15rem; color: #94a3b8; text-decoration: line-through; font-weight: 600; }
.paywall-price-note { font-size: 0.82rem; color: #16a34a; font-weight: 700; }
.paywall-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.paywall-btn-login { background: #fff; color: #003087; border: 2px solid #003087; padding: 11px 22px; border-radius: 10px; font-weight: 800; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; box-sizing: border-box; }
.paywall-btn-login:hover { background: #003087; color: #fff; }
.paypal-container-wrap { max-width: 360px; margin: 0 auto; box-sizing: border-box; }

/* ── Responsive Breakpoints for Reader ───────────────────────── */
@media (max-width: 992px) {
    .course-reader {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .course-sidebar {
        width: 100%;
        max-width: 100%;
        position: relative;
        top: 0;
        max-height: 380px;
    }
}

@media (max-width: 640px) {
    main.container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .course-progress-inner {
        padding: 8px 10px;
        gap: 8px;
    }
    .course-progress-label {
        font-size: 0.72rem;
        min-width: 85px;
    }
    .course-progress-pct {
        font-size: 0.75rem;
        min-width: 30px;
    }
    .chapter-header {
        padding: 16px 14px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    .chapter-header h1 {
        font-size: 1.2rem;
    }
    .section-card {
        border-radius: 10px;
        margin-bottom: 14px;
    }
    .section-card-header {
        padding: 12px 14px;
    }
    .section-card-body {
        padding: 14px 12px;
        font-size: 0.88rem;
    }
    .quiz-option-btn {
        padding: 10px 10px;
        font-size: 0.82rem;
        gap: 8px;
    }
    .chapter-nav-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .chapter-nav-prev,
    .chapter-nav-next {
        width: 100%;
        justify-content: center;
    }
    .chapter-paywall {
        padding: 22px 14px;
        border-radius: 12px;
    }
    .paywall-price-amount {
        font-size: 2.1rem;
    }
}

/* ── Formations Catalogue Styling (formations.php) ───────────── */
.catalogue-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 60%, #e0f2fe 100%);
    border-radius: 20px;
    padding: 42px 36px;
    border: 1px solid #bae6fd;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(0, 48, 135, 0.05);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.catalogue-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.catalogue-hero h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 16px;
    word-break: break-word;
}
.catalogue-hero p {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.75;
    max-width: 840px;
    margin-bottom: 24px;
}
.catalogue-hero-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.catalogue-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.catalogue-hero-pill i {
    color: #16a34a;
}

/* Trust Stats Bar */
.catalogue-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 35px;
    box-sizing: border-box;
}
.catalogue-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.catalogue-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #eff6ff;
    color: #003087;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.catalogue-stat-num {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}
.catalogue-stat-label {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
}

/* Course Cards in Catalogue */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 28px;
    margin-bottom: 60px;
    box-sizing: border-box;
}
.course-card-premium {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 48, 135, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
}
.course-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(0, 48, 135, 0.09);
    border-color: #93c5fd;
}
.course-card-image-wrap {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: #0f172a;
}
.course-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.course-card-premium:hover .course-card-image-wrap img {
    transform: scale(1.04);
}
.course-card-badge-top-left {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.course-card-badge-top-right {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #ef4444;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.course-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}
.course-card-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 12px;
}
.course-card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}
.course-card-title a:hover {
    color: #003087;
}
.course-card-meta-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.course-card-meta-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.course-card-desc {
    font-size: 0.90rem;
    color: #475569;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 8px;
}

.course-card-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}
.course-card-free-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}
.course-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.course-card-price-label {
    font-size: 0.74rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}
.course-card-price-val {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
}
.course-card-price-old {
    font-size: 1.05rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 600;
    margin-right: 6px;
}

.course-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    background: #003087;
    color: #ffffff;
    border-radius: 10px;
    font-size: 0.94rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(0, 48, 135, 0.2);
    box-sizing: border-box;
}
.course-card-cta:hover {
    background: #0056b3;
    color: #ffffff;
    transform: translateY(-1px);
}

/* ── Methodology Section ─────────────────────────────────────── */
.methodology-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 40px 32px;
    margin-bottom: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    box-sizing: border-box;
}
.methodology-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 36px;
}
.methodology-header h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    margin: 10px 0;
}
.methodology-header p {
    font-size: 0.96rem;
    color: #64748b;
    line-height: 1.6;
}
.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.methodology-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    transition: all 0.2s;
    box-sizing: border-box;
}
.methodology-card:hover {
    border-color: #009cde;
    background: #f0f7ff;
}
.methodology-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #003087;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 14px;
}
.methodology-card h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
}
.methodology-card p {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* ── FAQ Section ─────────────────────────────────────────────── */
.catalogue-faq-section {
    max-width: 900px;
    margin: 0 auto 60px;
    box-sizing: border-box;
}
.catalogue-faq-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 26px;
}
.faq-accordion-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    box-sizing: border-box;
}
.faq-accordion-item h4 {
    font-size: 0.96rem;
    font-weight: 800;
    color: #003087;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.faq-accordion-item p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

/* ── Mobile Sidebar Toggle Button ────────────────────────────── */
.course-mobile-toc-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    color: #003087;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.course-mobile-toc-toggle-btn:hover,
.course-mobile-toc-toggle-btn.active {
    background: #003087;
    color: #ffffff;
    border-color: #003087;
}

/* ── RESPONSIVE MOBILE : TABLETTES & MOBILES (max-width: 991px) ── */
@media (max-width: 991px) {
    /* 1. Passer le reader en 1 seule colonne propre */
    .course-reader {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        margin-bottom: 40px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. Bouton toggle mobile visible dans la barre de progression */
    .course-mobile-toc-toggle-btn,
    #toggle-sidebar-btn {
        display: inline-flex !important;
    }

    /* 3. Sidebar mobile sous forme d'accordéon / tiroir dépliable */
    .course-sidebar {
        display: none;
        width: 100% !important;
        max-width: 100% !important;
        position: static !important;
        top: auto !important;
        max-height: 480px !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 8px 24px rgba(0, 48, 135, 0.12) !important;
        border: 2px solid #38bdf8 !important;
        animation: slideDownMobileDrawer 0.25s ease-out;
    }

    .course-sidebar.mobile-open {
        display: block !important;
    }

    @keyframes slideDownMobileDrawer {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .sidebar-chapter-btn {
        padding: 13px 16px !important;
        min-height: 48px !important;
    }

    .course-content-pane {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ── RESPONSIVE SMARTPHONES (max-width: 768px) ─────────────────── */
@media (max-width: 768px) {
    main.container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Barre supérieure fil d'ariane & partage */
    .course-top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }

    .course-breadcrumb {
        font-size: 0.78rem !important;
        margin-bottom: 0 !important;
    }

    .course-share-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }

    /* Barre de progression sticky compacte */
    .course-progress-bar-wrap {
        margin-bottom: 16px !important;
        border-radius: 10px !important;
    }

    .course-progress-inner {
        padding: 10px 12px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .course-progress-label {
        font-size: 0.74rem !important;
        min-width: auto !important;
    }

    .course-progress-track {
        min-width: 60px !important;
    }

    .course-progress-pct {
        font-size: 0.76rem !important;
        min-width: auto !important;
    }

    /* Conteneur principal de lecture */
    .course-content-pane {
        padding: 16px 12px !important;
        border-radius: 12px !important;
    }

    /* En-tête de module */
    .module-hero-banner {
        padding: 18px 14px !important;
        border-radius: 10px !important;
        margin-bottom: 18px !important;
    }

    .module-hero-banner h1 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
        margin: 6px 0 10px !important;
    }

    .module-hero-banner p {
        font-size: 0.85rem !important;
    }

    .module-goal-box {
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
        border-radius: 8px !important;
    }

    /* Cartes de sections */
    .section-card {
        border-radius: 10px !important;
        margin-bottom: 16px !important;
    }

    .section-card-header {
        padding: 12px 14px !important;
    }

    .section-card-header h3 {
        font-size: 0.95rem !important;
    }

    .section-card-body {
        padding: 14px 12px !important;
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    .section-card-body h4 {
        font-size: 0.92rem !important;
        margin: 10px 0 6px !important;
    }

    .section-card-body p,
    .section-card-body li {
        font-size: 0.9rem !important;
    }

    /* Commandes Bash et blocs de code */
    .bash-command,
    pre {
        padding: 10px 12px !important;
        font-size: 0.78rem !important;
        margin: 10px 0 !important;
        border-radius: 8px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Tableaux responsives */
    .table, table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        font-size: 0.82rem !important;
    }

    /* Alertes et travaux pratiques */
    .alert {
        padding: 12px 12px !important;
        margin: 10px 0 !important;
        font-size: 0.84rem !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

    .lab-exercise {
        padding: 14px 12px !important;
        margin: 12px 0 !important;
        border-radius: 8px !important;
    }

    .lab-exercise h4 {
        font-size: 0.92rem !important;
    }

    /* Quiz interactif */
    .quiz-card {
        padding: 16px 12px !important;
        border-radius: 10px !important;
    }

    .quiz-question {
        font-size: 0.92rem !important;
        margin-bottom: 12px !important;
    }

    .quiz-option {
        padding: 12px 14px !important;
        min-height: 48px !important;
        font-size: 0.86rem !important;
        border-radius: 8px !important;
    }

    /* Boutons de validation et navigation footer */
    .chapter-nav-footer {
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 24px !important;
    }

    .chapter-nav-prev,
    .chapter-nav-next {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 16px !important;
        min-height: 48px !important;
        box-sizing: border-box !important;
        font-size: 0.88rem !important;
    }

    /* Paywall responsive */
    .chapter-paywall {
        padding: 24px 16px !important;
        border-radius: 12px !important;
    }

    .chapter-paywall h2 {
        font-size: 1.25rem !important;
    }

    .paywall-features li {
        font-size: 0.85rem !important;
    }

    .paywall-price-box {
        padding: 16px 12px !important;
    }

    .paywall-price-amount {
        font-size: 1.65rem !important;
    }

    .paywall-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .paywall-actions a,
    .paywall-actions button {
        width: 100% !important;
        justify-content: center !important;
    }
}
