/* ===== HERO INNER ===== */
.hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: .5rem !important;
}
.subject-icon-wrap {
    box-shadow: 0 6px 20px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.5);
    transition: transform .2s ease, box-shadow .2s ease;
}
.subject-icon-wrap:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.5);
}
.stats-pill {
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.stats-pill:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.28);
    box-shadow: 0 3px 12px rgba(0,0,0,.1);
}
.stats-pill {
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.stats-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,.1);
}
.stats-pill {
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.stats-pill:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.28);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.stats-pill {
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.stats-pill:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.28);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.stats-pill i {
    opacity: .9;
}

/* ===== TABS SECTION ===== */
.tabs-section .container {
    padding-inline: 1rem;
}
.tabs-nav {
    padding: .7rem;
    background: linear-gradient(145deg, #ffffff 0%, #fff8f5 50%, #fff3ee 100%);
    box-shadow: 0 4px 20px rgba(255,107,53,.08), 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid rgba(255,107,53,.15);
    border-radius: var(--radius-lg, 20px);
}
.tab-btn {
    padding: .85rem 1.4rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid rgba(0,0,0,.05);
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn:focus-visible {
    outline: 2px solid var(--clr-accent);
    outline-offset: 2px;
}
.tab-btn:hover {
    border-color: rgba(255,107,53,.2);
}
.tab-btn.active {
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255,107,53,.35);
    transform: scale(1.02);
}
.tab-btn:active {
    transform: scale(0.98);
}

/* ================================================
   TOKENS
================================================ */
:root {
    --clr-primary:   #FF6B35;
    --clr-secondary: #2E5EAA;
    --clr-accent:    #FF6B35;
    --clr-accent-2:  #FF8C5A;
    --clr-orange:    #ea580c;
    --clr-pink:      #fb923c;
    --clr-rose:      #f97316;
    --clr-slate:    #0f172a;
    --clr-muted:    #64748b;

    --grad-hero:    linear-gradient(135deg, #FF6B35 0%, #f97316 35%, #ea580c 65%, #FF8C42 100%);
    --grad-accent:  linear-gradient(135deg, #FF6B35 0%, #f97316 50%, #ea580c 100%);
    --grad-pink:    linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-glass:   linear-gradient(135deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 100%);
    --grad-shine:   linear-gradient(105deg, transparent 40%, rgba(255,255,255,.15) 50%, transparent 60%);

    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 4px 20px rgba(255,107,53,.08);
    --shadow-md: 0 12px 40px rgba(255,107,53,.12);
    --shadow-lg: 0 24px 60px rgba(255,107,53,.15);
    --shadow-glow: 0 0 40px rgba(255,107,53,.2);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --radius-pill: 9999px;

    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================================================
   RESET / BASE
================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* ================================================
   HERO
================================================ */
.subject-hero {
    position: relative;
    min-height: clamp(280px, 40vw, 420px);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--grad-hero);
    z-index: 0;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,.2) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.12) 0%, transparent 45%),
        radial-gradient(circle at 8% 90%, rgba(255,255,255,.1) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,.06) 0%, transparent 35%);
}
.hero-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 0%, transparent 75%);
}
.hero-pattern::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.2) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 95% 80% at 50% 45%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 45%, black 0%, transparent 70%);
    opacity: .85;
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding-block: 2.5rem 3rem;
    width: 100%;
    animation: heroFadeIn 0.6s ease-out;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero content */
.hero-content {
    position: relative;
    padding: 1.25rem 0 1.25rem 1.5rem;
    max-width: 720px;
}
.hero-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg,
        rgba(255,255,255,.5) 0%,
        rgba(255,255,255,.2) 50%,
        rgba(255,255,255,.1) 100%);
    border-radius: 0 4px 4px 0;
}

.hero-title {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    font-size: clamp(1.65rem, 5vw, 2.85rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 .85rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.subject-icon-wrap {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,.28);
    box-shadow:
        0 4px 16px rgba(0,0,0,.12),
        inset 0 1px 0 rgba(255,255,255,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.35);
}

.subject-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hero-desc {
    font-size: clamp(.92rem, 2.5vw, 1.12rem);
    color: rgba(255,255,255,.82);
    margin: 0 0 1.5rem;
    max-width: 600px;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.15rem;
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s ease, background .2s ease;
}

.stats-pill:hover {
    background: rgba(255,255,255,.28);
    transform: translateY(-1px);
}

/* ================================================
   TABS NAV
================================================ */
.tabs-section {
    position: sticky;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f5 50%, #fff3ee 100%);
    box-shadow:
        0 6px 24px rgba(255, 107, 53, .08),
        0 2px 0 rgba(255, 255, 255, .8) inset,
        0 -1px 0 rgba(255, 107, 53, .06);
    top: 0;
    z-index: 200;
    padding: 1.25rem 0;
}
.tabs-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 900px);
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 107, 53, .4) 15%,
        rgba(234, 88, 12, .55) 50%,
        rgba(255, 107, 53, .4) 85%,
        transparent 100%);
    border-radius: 0 0 3px 3px;
}

.tabs-section .container {
    position: relative;
}

.tabs-nav {
    display: flex;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: .6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: linear-gradient(145deg, #ffffff 0%, #fff8f5 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 200, 180, .55);
    box-shadow:
        0 4px 20px rgba(255, 107, 53, .07),
        0 1px 3px rgba(0, 0, 0, .04),
        inset 0 1px 0 rgba(255, 255, 255, .9);
}

.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .9);
    color: #475569;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.tab-icon {
    font-size: 1.1rem;
    opacity: .85;
}

.tab-count {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    padding: .2rem .55rem;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, .2);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--clr-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, .15);
}

.tab-btn:hover .tab-icon { opacity: 1; }

.tab-btn:hover .tab-count {
    background: rgba(255, 107, 53, .12);
    color: var(--clr-accent);
    border-color: rgba(255, 107, 53, .2);
}

.tab-btn.active {
    background: var(--grad-accent);
    color: #fff;
    box-shadow:
        0 4px 16px rgba(255, 107, 53, .35),
        0 1px 0 rgba(255, 255, 255, .2) inset;
}

.tab-btn.active .tab-icon { opacity: 1; }

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, .3);
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
}

/* ================================================
   CONTENT SECTION
================================================ */
.content-section {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 50%, #fef3ee 100%);
    padding: 2rem 0 3rem;
    min-height: 400px;
    position: relative;
}
.content-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(255,107,53,.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,140,66,.02) 0%, transparent 50%);
    pointer-events: none;
}

/* ================================================
   CARD BLOCK — Ultra-modern glassmorphism
================================================ */
.card-block {
    background: linear-gradient(145deg, #ffffff 0%, #fffaf8 100%);
    border-radius: var(--radius-xl);
    padding: clamp(1.25rem, 4vw, 2rem);
    box-shadow: 
        var(--shadow-md),
        0 0 0 1px rgba(255,107,53,.05),
        inset 0 1px 0 rgba(255,255,255,.9);
    border: 1px solid rgba(255,107,53,.08);
    position: relative;
    overflow: hidden;
}

.card-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
    opacity: .9;
    pointer-events: none;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(255,107,53,.35), rgba(255,140,66,.18), transparent) 1;
}

.block-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    background: var(--grad-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 6px 20px rgba(255,107,53,.35), 0 1px 0 rgba(255,255,255,.3) inset;
    flex-shrink: 0;
    transition: transform .3s var(--ease-out-expo);
}

.block-icon:hover { transform: scale(1.05) rotate(-2deg); }

.block-icon--exercises {
    background: var(--grad-pink);
    box-shadow: 0 6px 20px rgba(255,107,53,.3), 0 1px 0 rgba(255,255,255,.3) inset;
}

.block-title {
    font-size: clamp(1.25rem, 3.5vw, 1.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 .25rem;
    letter-spacing: -0.02em;
}

.block-sub {
    font-size: .9rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* ================================================
   LESSON COMPETENCE TITLE — en-tête de regroupement par compétence
================================================ */
.lesson-competence-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin: 2rem 0 .75rem;
    padding: .85rem 1rem;
    background: linear-gradient(90deg, rgba(255,107,53,.09), rgba(255,107,53,0));
    border-left: 4px solid var(--cs-primary, #FF6B35);
    border-radius: .5rem;
}

.lesson-competence-title--first {
    margin-top: 0;
}

.lesson-competence-title i {
    color: var(--cs-primary, #FF6B35);
    font-size: 1rem;
}

/* ================================================
   LESSON THEME TITLE — en-tête de regroupement par thème
================================================ */
.lesson-theme-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 1.5rem 0 .6rem;
    padding-top: 1.1rem;
    border-top: 1px dashed #e2e8f0;
}

.lesson-theme-title--first {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Thème imbriqué sous une compétence : léger décalage, comme les leçons sous un thème */
.lesson-theme-title--nested {
    margin-left: 1.25rem;
}

.lesson-theme-title i {
    color: var(--cs-primary, #FF6B35);
    font-size: .9rem;
}

/* ================================================
   LESSON LIST — Premium floating cards
================================================ */
.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.lesson-item {
    animation: fadeInLeft .5s var(--ease-out-expo) calc(var(--i, 0) * 50ms) both;
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.lesson-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .9rem;
    text-decoration: none;
    color: #334155;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,107,53,.07);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: all .28s var(--ease-out-expo);
    min-height: 46px;
    position: relative;
    overflow: hidden;
}

.lesson-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--grad-accent);
    border-radius: 0 4px 4px 0;
    transition: height .3s var(--ease-out-expo);
}

.lesson-link:hover,
.lesson-link:focus-visible {
    background: linear-gradient(145deg, #fff8f5 0%, #fff3ee 100%);
    border-color: rgba(255,107,53,.22);
    box-shadow: 0 4px 16px rgba(255,107,53,.1), 0 0 0 1px rgba(255,107,53,.07);
    transform: translateX(4px);
    color: #1e293b;
    outline: none;
}

.lesson-link:hover::before { height: 70%; }

.lesson-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.25), transparent);
    transition: left .6s ease;
    pointer-events: none;
}
.lesson-link:hover::after { left: 150%; }

.lesson-link--disabled {
    opacity: .6;
    pointer-events: none;
    cursor: default;
}

.lesson-num {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    background: var(--grad-accent);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(255,107,53,.3), 0 1px 0 rgba(255,255,255,.25) inset;
    transition: transform .3s var(--ease-out-expo), box-shadow .3s ease;
}

.lesson-link:hover .lesson-num {
    transform: scale(1.08);
    box-shadow: 0 5px 14px rgba(255,107,53,.4), 0 1px 0 rgba(255,255,255,.3) inset;
}

.lesson-title {
    flex: 1;
    font-size: clamp(.9rem, 2.5vw, 1rem);
    font-weight: 600;
    line-height: 1.4;
}

/* Titre multi-lignes — design hiérarchique avec points */
.lesson-title--multiline {
    display: block;
    line-height: 1.5;
    letter-spacing: 0.01em;
    padding: 0.15rem 0 0.1rem 0.6rem;
    margin: 0;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(90deg, rgba(255,107,53,.04) 0%, transparent 100%);
    transition: border-color .25s ease, background .25s ease;
}

.lesson-title-line {
    display: block;
    padding-left: 0;
    margin-bottom: 0.15rem;
}
.lesson-title-line:last-child {
    margin-bottom: 0;
}

/* Points ultra-modernes — orbes avec gradient & glow */
.lesson-title-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.9) 0%, transparent 50%),
        linear-gradient(145deg, #FFB347 0%, #FF6B35 40%, #ea580c 100%);
    margin-right: 0.55rem;
    vertical-align: 0.3em;
    box-shadow:
        0 0 0 2px rgba(255,107,53,.12),
        0 0 0 3px rgba(255,107,53,.06),
        0 2px 4px rgba(255,107,53,.3),
        inset 0 1px 0 rgba(255,255,255,.6),
        inset 0 -1px 0 rgba(234,88,12,.2);
    transition: all .3s var(--ease-out-expo);
    position: relative;
    flex-shrink: 0;
}

.lesson-title-line:first-child .lesson-title-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: 
        radial-gradient(circle at 28% 28%, rgba(255,255,255,.95) 0%, transparent 45%),
        linear-gradient(145deg, #FFB347 0%, #FF6B35 35%, #f97316 80%, #ea580c 100%);
    box-shadow:
        0 0 0 2.5px rgba(255,107,53,.2),
        0 0 12px rgba(255,107,53,.4),
        0 2px 6px rgba(255,107,53,.4),
        inset 0 1px 0 rgba(255,255,255,.7),
        inset 0 -1px 0 rgba(234,88,12,.25);
}

.lesson-link:hover .lesson-title-dot {
    transform: scale(1.2);
    box-shadow:
        0 0 0 2.5px rgba(255,107,53,.25),
        0 0 14px rgba(255,107,53,.4),
        0 0 22px rgba(255,107,53,.12),
        0 2px 5px rgba(255,107,53,.35),
        inset 0 1px 0 rgba(255,255,255,.65),
        inset 0 -1px 0 rgba(234,88,12,.15);
}

.lesson-link:hover .lesson-title-line:first-child .lesson-title-dot {
    transform: scale(1.25);
    box-shadow:
        0 0 0 3px rgba(255,107,53,.2),
        0 0 18px rgba(255,107,53,.45),
        0 0 28px rgba(255,107,53,.15),
        0 3px 7px rgba(255,107,53,.4),
        inset 0 1px 0 rgba(255,255,255,.75),
        inset 0 -1px 0 rgba(234,88,12,.2);
}

.lesson-title-line--empty {
    min-height: 0.4em;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 2.5px rgba(255,107,53,.18), 0 0 10px rgba(255,107,53,.35); }
    50% { opacity: .95; box-shadow: 0 0 0 2.5px rgba(255,107,53,.28), 0 0 14px rgba(255,107,53,.5); }
}
.lesson-title-line:first-child .lesson-title-dot {
    animation: dotPulse 3s ease-in-out infinite;
}
.lesson-link:hover .lesson-title-line:first-child .lesson-title-dot {
    animation: none;
}

.lesson-title-line:first-child {
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.lesson-link:hover .lesson-title--multiline,
.lesson-link:focus-visible .lesson-title--multiline,
.video-card:hover .lesson-title--multiline,
.exam-card:hover .lesson-title--multiline {
    border-left-color: #FF6B35;
    background: linear-gradient(90deg, rgba(255,107,53,.08) 0%, transparent 100%);
}

.video-card:hover .lesson-title-dot,
.exam-card:hover .lesson-title-dot {
    transform: scale(1.2);
    box-shadow:
        0 0 0 2.5px rgba(255,107,53,.25),
        0 0 14px rgba(255,107,53,.4),
        0 0 22px rgba(255,107,53,.12),
        0 2px 5px rgba(255,107,53,.35),
        inset 0 1px 0 rgba(255,255,255,.65),
        inset 0 -1px 0 rgba(234,88,12,.15);
}

.video-card:hover .lesson-title-line:first-child .lesson-title-dot,
.exam-card:hover .lesson-title-line:first-child .lesson-title-dot {
    animation: none;
}

/* Animation pulse légère sur le point de la première ligne */
@keyframes dotPulse {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: .92; filter: brightness(1.08); }
}
.lesson-title-line:first-child .lesson-title-dot {
    animation: dotPulse 3s ease-in-out infinite;
}
.lesson-link:hover .lesson-title-line:first-child .lesson-title-dot {
    animation: none;
}

.lesson-arrow {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform .3s var(--ease-out-expo), color .3s ease;
}

.lesson-link:hover .lesson-arrow {
    color: #FF6B35;
    transform: translateX(5px);
}

/* Badges */
.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #422006;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(245,158,11,.35), 0 1px 0 rgba(255,255,255,.4) inset;
    border: 1px solid rgba(255,255,255,.4);
}

.badge-disabled {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .65rem;
    border-radius: var(--radius-pill);
    background: rgba(100,116,139,.12);
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
    flex-shrink: 0;
}

.locked-access-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-weight: 600;
}

/* ================================================
   EXAM CARDS GRID
================================================ */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
}

.exam-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    animation:
        fadeInUp .5s ease calc(var(--i, 0) * 60ms) both,
        examCardFloat 3.2s ease-in-out calc(.6s + var(--i, 0) * 60ms) infinite,
        examCardGlow 2.4s ease-in-out calc(.6s + var(--i, 0) * 60ms) infinite;
    will-change: transform;
}

.exam-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.exam-card-inedit {
    position: relative;
    border: 1px solid rgba(255, 183, 3, 0.7);
    box-shadow: 0 18px 35px rgba(251, 133, 0, 0.18);
    overflow: hidden;
    z-index: 0;
    animation:
        fadeInUp .5s ease calc(var(--i, 0) * 60ms) both,
        examCardFloat 3.2s ease-in-out calc(.6s + var(--i, 0) * 60ms) infinite,
        ineditCardBreath 1.8s ease-in-out calc(.7s + var(--i, 0) * 60ms) infinite;
}

.exam-card-inedit::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 90%;
    height: 185%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 183, 3, 0.7) 50%, transparent 100%);
    transform: translateX(-160%) skewX(-26deg);
    pointer-events: none;
    z-index: 0;
    animation: ineditCardShine 1.9s ease-in-out infinite;
}

.exam-card-inedit > * {
    position: relative;
    z-index: 1;
}

.exam-card__header {
    background: var(--grad-pink);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.exam-type-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .85rem;
    background: rgba(255,255,255,.3);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
}

.exam-year {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
}

.exam-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 .6rem;
}

.exam-card__desc {
    font-size: .875rem;
    color: #64748b;
    flex: 1;
    margin: 0 0 1rem;
}

.exam-badge-inedit {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0 0 .8rem;
    padding: .35rem .75rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    color: #111827;
    border: 1px solid rgba(255, 183, 3, 0.65);
    box-shadow: 0 10px 24px rgba(251, 133, 0, 0.18);
    font-size: .78rem;
    font-weight: 800;
    animation: ineditBadgePulse 1.3s ease-in-out infinite;
}

.inedit-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: .45rem .7rem;
    border-radius: var(--radius-pill);
    font-size: .76rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    color: #111827;
    border: 1px solid rgba(255, 183, 3, 0.65);
    box-shadow: 0 10px 24px rgba(251, 133, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    user-select: none;
    animation: ineditRibbonFloat 1.4s ease-in-out infinite;
}

.exam-meta {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: #64748b;
}

.exam-meta span {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.exam-meta i { color: var(--clr-accent); }

.btn-exam {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--grad-success);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.btn-exam:hover {
    opacity: .9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: #fff;
}

.exam-card-inedit .btn-exam {
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    color: #111827;
    animation: ineditCtaPulse 1.25s ease-in-out infinite;
}

.exam-card-inedit .btn-exam:hover {
    color: #111827;
}

/* ================================================
   EMPTY STATE
================================================ */
.empty-state {
    text-align: center;
    padding: clamp(2.5rem, 8vw, 5rem) 1.5rem;
    color: #94a3b8;
}

.empty-icon {
    font-size: clamp(3rem, 10vw, 5rem);
    display: block;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: #475569;
    font-size: 1.1rem;
    margin: 0 0 .5rem;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ================================================
   ANIMATIONS
================================================ */
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes examCardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes examCardGlow {
    0%, 100% {
        box-shadow: var(--shadow-xs);
        border-color: #e2e8f0;
    }
    50% {
        box-shadow: 0 14px 40px rgba(255,107,53,.2);
        border-color: rgba(255,107,53,.35);
    }
}

@keyframes ineditBadgePulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 24px rgba(251, 133, 0, 0.18);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-2.6px) scale(1.04);
        box-shadow: 0 22px 52px rgba(251, 133, 0, 0.42);
        filter: brightness(1.08);
    }
}

@keyframes ineditRibbonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes ineditCardShine {
    0% { transform: translateX(-160%) skewX(-26deg); opacity: 0; }
    14% { opacity: 0.98; }
    52% { opacity: 0.98; }
    100% { transform: translateX(185%) skewX(-26deg); opacity: 0; }
}

@keyframes ineditCardBreath {
    0%, 100% {
        border-color: rgba(255, 183, 3, 0.7);
        box-shadow: 0 18px 35px rgba(251, 133, 0, 0.18);
    }
    50% {
        border-color: rgba(255, 183, 3, 0.95);
        box-shadow: 0 22px 56px rgba(251, 133, 0, 0.36);
    }
}

@keyframes ineditCtaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    .exam-card {
        animation: none !important;
    }

    .exam-card-inedit::after,
    .exam-badge-inedit,
    .inedit-ribbon,
    .exam-card-inedit .btn-exam {
        animation: none !important;
    }
}

/* ================================================
   RESPONSIVE BREAKPOINTS
================================================ */

/* Tablet */
@media (max-width: 768px) {
    .hero-inner { padding-block: 2rem; }

    .hero-title { gap: .6rem; }

    .subject-icon-wrap {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.25rem;
    }

    .stats-pill { font-size: .8rem; padding: .4rem .85rem; }

    .tabs-section { padding: .5rem 0; }

    .tab-btn { padding: .5rem .75rem; font-size: .82rem; gap: .4rem; }

    .tab-label { display: none; } /* icon + count only on small screens */

    .block-header { gap: .75rem; }

    .block-icon { width: 40px; height: 40px; min-width: 40px; font-size: 1.1rem; }

    .lesson-link { padding: .55rem .8rem; gap: .6rem; }

    .lesson-num { width: 26px; height: 26px; min-width: 26px; font-size: .72rem; border-radius: 6px; }
}

/* Mobile */
@media (max-width: 480px) {
    .lesson-link { padding: .5rem .75rem; gap: .55rem; }

    .lesson-title { font-size: .85rem; }

    .lesson-num { width: 24px; height: 24px; min-width: 24px; font-size: .7rem; border-radius: 6px; }

    .lesson-arrow { font-size: .85rem; }

    .card-block { border-radius: var(--radius-md); padding: 1rem; }

    .exam-grid { grid-template-columns: 1fr; }

    .tab-btn { padding: .45rem .65rem; }

    .lesson-title-dot { width: 6px; height: 6px; min-width: 6px; margin-right: 0.4rem; }
}

/* Landscape phone */
@media (max-width: 640px) and (orientation: landscape) {
    .subject-hero { min-height: 220px; }
    .hero-inner { padding-block: 1.25rem; }
}

/* Large screens */
@media (min-width: 1200px) {
    .exam-grid { grid-template-columns: repeat(3, 1fr); }
}

/** CSS VIDEOS */
.videos-section {
            padding: 2rem 0;
            font-family: 'Segoe UI', system-ui, sans-serif;
        }

        .videos-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 2rem;
        }

        .videos-header h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: #1a1a2e;
            margin: 0;
            letter-spacing: -0.02em;
        }

        .videos-count-badge {
            background: linear-gradient(135deg, #FF6B35, #f97316);
            color: white;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            letter-spacing: 0.04em;
        }

        /* ── Grid ── */
        .video-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        /* ── Card ── */
        .video-card {
            background: #ffffff;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            border: 1px solid rgba(255, 107, 53, 0.08);
            transition: transform 0.3s cubic-bezier(.34,1.56,.64,1),
                        box-shadow 0.3s ease;
            animation: cardIn 0.5s ease both;
            animation-delay: calc(var(--i, 0) * 80ms);
        }

        .video-card:hover {
            transform: translateY(-6px);
            box-shadow: 0 16px 40px rgba(255, 107, 53, 0.15);
        }

        @keyframes cardIn {
            from { opacity: 0; transform: translateY(24px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ── Thumbnail / Play area ── */
        .video-card__thumbnail {
            position: relative;
            width: 100%;
            padding-top: 56.25%; /* 16:9 */
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            overflow: hidden;
            cursor: pointer;
        }

        /* animated shimmer lines for depth */
        .video-card__thumbnail::before {
            content: '';
            position: absolute;
            inset: 0;
            background:
                linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.04) 50%, transparent 60%);
            background-size: 200% 100%;
            animation: shimmer 3s infinite linear;
        }

        @keyframes shimmer {
            from { background-position: 200% 0; }
            to   { background-position: -200% 0; }
        }

        /* decorative circles */
        .video-card__thumbnail::after {
            content: '';
            position: absolute;
            top: -30px; right: -30px;
            width: 120px; height: 120px;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.15);
        }

        /* Play button */
        .play-btn {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            z-index: 2;
        }

        .play-btn__circle {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(8px);
            border: 2px solid rgba(255,255,255,0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s cubic-bezier(.34,1.56,.64,1),
                        background 0.3s ease,
                        box-shadow 0.3s ease;
        }

        .play-btn__circle svg {
            width: 26px;
            height: 26px;
            fill: white;
            margin-left: 4px; /* optical centering for play triangle */
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
        }

        .play-btn:hover .play-btn__circle {
            transform: scale(1.15);
            background: linear-gradient(135deg, #FF6B35, #f97316);
            border-color: transparent;
            box-shadow: 0 8px 30px rgba(255, 107, 53, 0.5);
        }

        /* Pulse ring around play button */
        .play-pulse {
            position: absolute;
            width: 64px;
            height: 64px;
            border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.25);
            animation: pulse-ring 2.5s infinite ease-out;
        }

        @keyframes pulse-ring {
            0%   { transform: scale(1);   opacity: 0.6; }
            100% { transform: scale(1.9); opacity: 0; }
        }

        /* Duration badge */
        .video-duration {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: rgba(0,0,0,0.7);
            color: #fff;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.2rem 0.5rem;
            border-radius: 6px;
            letter-spacing: 0.05em;
            z-index: 2;
        }

        /* FREE badge */
        .video-free-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.2rem 0.55rem;
            border-radius: 6px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            z-index: 2;
        }

        /* PREMIUM badge (locked) */
        .video-premium-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.2rem 0.55rem;
            border-radius: 6px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            z-index: 2;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }

        .video-premium-badge i {
            font-size: 0.6rem;
        }

        /* Play button locked state */
        .play-btn--locked {
            cursor: not-allowed;
        }

        .play-btn__circle--locked {
            background: rgba(0,0,0,0.5) !important;
            border-color: rgba(255,255,255,0.2) !important;
        }

        .play-btn__circle--locked svg {
            fill: rgba(255,255,255,0.7);
            width: 22px;
            height: 22px;
            margin-left: 0;
        }

        .play-btn--locked:hover .play-btn__circle--locked {
            transform: none;
            background: rgba(0,0,0,0.6) !important;
            box-shadow: none;
        }

        /* Watch button locked state */
        .btn-watch--locked {
            background: linear-gradient(135deg, #94a3b8, #64748b) !important;
            cursor: pointer;
        }

        .btn-watch--locked:hover {
            background: linear-gradient(135deg, #f59e0b, #d97706) !important;
            box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
        }

        .btn-watch--locked svg {
            width: 13px;
            height: 13px;
            fill: white;
        }

        /* ── Card body ── */
        .video-card__body {
            padding: 1.1rem 1.2rem 1.2rem;
        }

        .video-card__chapter {
            font-size: 0.68rem;
            font-weight: 600;
            color: #FF6B35;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            margin-bottom: 0.35rem;
        }

        .video-card__title {
            font-size: 0.95rem;
            font-weight: 700;
            color: #1a1a2e;
            margin: 0 0 0.5rem;
            line-height: 1.35;
        }

        .video-card__title:not(.lesson-title--multiline) {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .video-card__desc {
            font-size: 0.8rem;
            color: #6b7280;
            line-height: 1.5;
            margin: 0 0 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .video-card__footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .btn-watch {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            background: linear-gradient(135deg, #FF6B35, #f97316);
            color: white;
            font-size: 0.78rem;
            font-weight: 600;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            letter-spacing: 0.02em;
        }

        .btn-watch:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
            color: white;
            text-decoration: none;
        }

        .btn-watch svg {
            width: 13px;
            height: 13px;
            fill: white;
        }

        .video-card__type-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #10b981;
            flex-shrink: 0;
        }

        .video-card__type-label {
            font-size: 0.72rem;
            color: #9ca3af;
            font-weight: 500;
        }

        /* ── Empty state ── */
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: #9ca3af;
        }

        .empty-state__icon-wrap {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1.25rem;
        }

        .empty-state__icon-wrap svg {
            width: 36px;
            height: 36px;
            fill: #d1d5db;
        }

        .empty-state h4 {
            font-size: 1rem;
            font-weight: 700;
            color: #374151;
            margin-bottom: 0.4rem;
        }

        .empty-state p {
            font-size: 0.85rem;
            color: #9ca3af;
            margin: 0;
        }

/* ================================================
   LAYOUT : CONTENT + SIDEBAR
================================================ */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-areas: "main sidebar";
    gap: 1.75rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.content-with-sidebar .tab-content {
    grid-area: main;
    min-width: 0; /* prevent overflow */
}

.subject-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: calc(var(--tabs-height, 80px) + 1.25rem);
}

/* ================================================
   SIDEBAR CARDS
================================================ */
.sidebar-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid rgba(255,107,53,.1);
    box-shadow: 0 2px 12px rgba(255,107,53,.06), 0 1px 0 rgba(255,255,255,.9) inset;
    animation: fadeInUp .45s var(--ease-out-expo) both;
}

.sidebar-card:nth-child(1) { animation-delay: .05s; }
.sidebar-card:nth-child(2) { animation-delay: .12s; }
.sidebar-card:nth-child(3) { animation-delay: .19s; }
.sidebar-card:nth-child(4) { animation-delay: .26s; }

/* Identity card */
.sidebar-card--identity {
    background: var(--grad-accent);
    border-color: transparent;
    box-shadow: 0 8px 28px rgba(255,107,53,.28);
    text-align: center;
}

.sidebar-subject-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: rgba(255,255,255,.25);
    border: 2px solid rgba(255,255,255,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto .85rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.4);
    overflow: hidden;
    transition: transform .3s var(--ease-out-expo);
}
.sidebar-subject-icon:hover { transform: scale(1.06) rotate(-2deg); }

.sidebar-subject-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-emoji { line-height: 1; }

.sidebar-subject-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 .5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.sidebar-classe-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .85rem;
    background: rgba(255,255,255,.25);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.sidebar-subject-desc {
    font-size: .82rem;
    color: rgba(255,255,255,.85);
    line-height: 1.5;
    margin: .6rem 0 0;
    text-align: left;
}

/* Section title */
.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #FF6B35;
    margin: 0 0 .85rem;
}

/* Stats list */
.sidebar-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sidebar-stat {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .65rem;
    border-radius: var(--radius-sm);
    background: #fafafa;
    border: 1px solid #f1f1f1;
    transition: background .2s ease, border-color .2s ease;
}
.sidebar-stat:hover {
    background: #fff8f5;
    border-color: rgba(255,107,53,.15);
}

.sidebar-stat__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-stat__icon--lessons   { background: linear-gradient(135deg, #FF6B35, #f97316); box-shadow: 0 3px 8px rgba(255,107,53,.3); }
.sidebar-stat__icon--exercises { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 3px 8px rgba(234,88,12,.3); }
.sidebar-stat__icon--videos    { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 3px 8px rgba(14,165,233,.3); }
.sidebar-stat__icon--exams     { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 3px 8px rgba(16,185,129,.3); }

.sidebar-stat__body {
    display: flex;
    align-items: baseline;
    gap: .35rem;
}

.sidebar-stat__val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.sidebar-stat__lbl {
    font-size: .75rem;
    color: #64748b;
    font-weight: 500;
}

/* Navigation links */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    color: #334155;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    border: 1px solid transparent;
    margin-bottom: .35rem;
}
.sidebar-nav-link:last-child { margin-bottom: 0; }

.sidebar-nav-link > i:first-child {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f8fafc;
    color: #FF6B35;
    font-size: .85rem;
    border: 1px solid rgba(255,107,53,.12);
    transition: background .2s ease;
    flex-shrink: 0;
}

.sidebar-nav-link span {
    flex: 1;
    line-height: 1.3;
}

.sidebar-nav-arrow {
    color: #94a3b8;
    font-size: .8rem;
    transition: transform .2s var(--ease-out-expo), color .2s ease;
    flex-shrink: 0;
}

.sidebar-nav-link:hover {
    background: #fff8f5;
    color: #FF6B35;
    border-color: rgba(255,107,53,.12);
    transform: translateX(2px);
}
.sidebar-nav-link:hover > i:first-child {
    background: rgba(255,107,53,.1);
}
.sidebar-nav-link:hover .sidebar-nav-arrow {
    transform: translateX(3px);
    color: #FF6B35;
}

/* CTA card */
.sidebar-card--cta {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: transparent;
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
    text-align: center;
}

.sidebar-cta-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    margin: 0 auto .75rem;
    box-shadow: 0 4px 14px rgba(245,158,11,.4);
    animation: cta-pulse 2s ease-in-out infinite;
}

@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(245,158,11,.4); }
    50%       { box-shadow: 0 6px 22px rgba(245,158,11,.6); }
}

.sidebar-cta-title {
    font-size: .95rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 .35rem;
}

.sidebar-cta-desc {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    line-height: 1.45;
    margin: 0 0 .85rem;
}

.sidebar-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    background: var(--grad-accent);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 14px rgba(255,107,53,.4);
    width: 100%;
}
.sidebar-cta-btn:hover {
    opacity: .92;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255,107,53,.5);
    color: #fff;
}

/* ================================================
   RESPONSIVE SIDEBAR
================================================ */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr 260px;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "main";
        gap: 1rem;
    }

    .subject-sidebar {
        position: static;
        /* On mobile: affichage horizontal des cards stats/nav */
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
    }

    .sidebar-card--identity {
        grid-column: 1 / -1; /* full width */
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }

    .sidebar-subject-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        margin: 0;
        flex-shrink: 0;
    }

    .sidebar-card--identity > *:not(.sidebar-subject-icon) {
        flex: 1;
    }

    .sidebar-card--cta {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .subject-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-card--identity {
        flex-direction: column;
        text-align: center;
    }

    .sidebar-subject-icon {
        margin: 0 auto;
    }
}
