/* ==========================================================================
   Page-specific styles
   ========================================================================== */

/* --- Home ----------------------------------------------------------------- */
.home-hero { position: relative; overflow: hidden; background: var(--bg); isolation: isolate; }
.home-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--primary), #e8b44a, var(--accent)); }
.home-hero::after { content: ""; position: absolute; z-index: 0; left: 0; top: 5px; bottom: 0; width: 54%; background: linear-gradient(90deg, transparent 0%, transparent 68%, var(--bg) 100%), linear-gradient(var(--hero-dim), var(--hero-dim)), url("/static/img/home-hero-learning-v1.png") 48% center / cover no-repeat; }
.home-hero-grid { position: relative; z-index: 1; min-height: 610px; display: grid; grid-template-columns: .92fr 1.08fr; gap: 48px; align-items: center; padding-top: 58px; padding-bottom: 82px; }
.hero-copy { position: relative; z-index: 5; }
.home-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--primary); font-size: .9rem; font-weight: 800; margin-bottom: 18px; }
.home-eyebrow > span { width: 28px; height: 2px; border-radius: 3px; background: #e8b44a; }
.hero-copy h1 { max-width: 590px; font-size: clamp(2.65rem, 5vw, 4.65rem); line-height: 1.16; letter-spacing: -.04em; color: var(--heading); margin-bottom: 20px; }
.hero-copy h1 em { position: relative; color: var(--accent); font-style: normal; white-space: nowrap; }
.hero-copy h1 em::after { content: ""; position: absolute; inset-inline: 3px; bottom: 3px; height: 9px; border-bottom: 4px solid #e8b44a; border-radius: 50%; transform: rotate(-2deg); }
.hero-copy .lead { max-width: 560px; color: var(--muted); font-size: 1.13rem; line-height: 1.95; margin-bottom: 28px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-forest-outline { background: transparent; color: var(--primary); border-color: var(--border-strong); box-shadow: none; }
.btn-forest-outline:hover { background: var(--primary-50); color: var(--primary); box-shadow: none; }
.hero-note { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .86rem; font-weight: 700; margin-top: 25px; }
.note-line { width: 40px; height: 1px; background: #d4a138; }
.algerian-pattern { position: absolute; width: 180px; height: 180px; opacity: .16; pointer-events: none; background-image: linear-gradient(30deg, var(--primary) 12%, transparent 12.5%, transparent 87%, var(--primary) 87.5%), linear-gradient(150deg, var(--primary) 12%, transparent 12.5%, transparent 87%, var(--primary) 87.5%), linear-gradient(30deg, var(--primary) 12%, transparent 12.5%, transparent 87%, var(--primary) 87.5%), linear-gradient(150deg, var(--primary) 12%, transparent 12.5%, transparent 87%, var(--primary) 87.5%); background-size: 42px 74px; background-position: 0 0, 0 0, 21px 37px, 21px 37px; }
.pattern-one { inset-inline-end: -45px; top: 26px; mask-image: linear-gradient(to bottom, #000, transparent 86%); }

.learning-scene { position: relative; min-height: 470px; direction: ltr; }
.scene-card { position: absolute; z-index: 5; min-width: 175px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--glass-strong); display: flex; align-items: center; gap: 10px; direction: rtl; box-shadow: 0 13px 28px rgba(18,59,50,.16); backdrop-filter: blur(10px); }
.scene-card > span { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: #d96c4a; }
.scene-card b, .scene-card small { display: block; }.scene-card b { color: var(--heading); font-size: .78rem; }.scene-card small { color: var(--faint); font-size: .6rem; }
.card-video { right: -12px; top: 95px; }.card-files { right: -32px; top: 180px; }.card-files > span { background: #3d705c; }.card-progress { right: -14px; top: 265px; }.card-progress > span { background: #e8b44a; color: var(--heading); }

.trust-wrap { position: relative; z-index: 8; margin-top: -35px; }
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 16px 40px rgba(18,59,50,.1); padding: 13px 18px; }
.trust-strip > div { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 66px; padding: 5px 20px; }
.trust-strip > div + div { border-inline-start: 1px solid var(--border); }
.trust-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--primary-100); color: var(--primary); }
.trust-strip p { margin: 0; line-height: 1.5; }.trust-strip strong,.trust-strip small { display: block; }.trust-strip strong { color: var(--heading); }.trust-strip small { color:var(--faint); font-size:.73rem; margin-top:2px; }

.home-courses { padding-top: 76px; background: var(--bg); }
.home-section-head h2, .why-intro h2 { color: var(--heading); font-size: clamp(1.65rem,3vw,2.35rem); margin: 2px 0 4px; }
.section-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-600); font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.section-kicker::before { content:""; width: 22px; height: 2px; border-radius: 3px; background:#e8b44a; }
.home-course-grid { grid-template-columns: repeat(3, 1fr); }
.home-course-grid .course-card { border-radius: 20px; box-shadow: 0 8px 25px rgba(18,59,50,.07); }
.home-course-grid .course-card:nth-child(3n+1) { --tint-card: var(--t2-50); }.home-course-grid .course-card:nth-child(3n+2) { --tint-card: var(--t1-50); }.home-course-grid .course-card:nth-child(3n+3) { --tint-card: var(--warning-50); }

.home-why { padding: 78px 0; background: var(--surface); border-block: 1px solid var(--border); }
.why-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 65px; align-items: center; }
.why-intro > p { color:var(--muted); max-width:520px; }
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 28px; border: 1px solid var(--border); border-radius:16px; overflow:hidden; }
.mini-stats div { padding:13px 12px; text-align:center; background: var(--bg); }.mini-stats div+div{border-inline-start:1px solid var(--border)}.mini-stats strong,.mini-stats span{display:block}.mini-stats strong{font-size:1.45rem;color:var(--primary)}.mini-stats span{font-size:.7rem;color:var(--faint)}
.why-cards { display:grid; gap:13px; }
.why-cards article { display:flex; gap:16px; align-items:center; padding:19px 20px; border:1px solid var(--border); border-radius:17px; background:var(--surface-2); box-shadow:0 8px 24px rgba(18,59,50,.05); }
.why-cards article:nth-child(2){transform:translateX(-25px);background:var(--surface-2)}.why-cards article>span{width:48px;height:48px;display:grid;place-items:center;flex:none;border-radius:14px;background:var(--t2-50);color:var(--primary)}.why-cards article:nth-child(2)>span{background:var(--t1-50);color:var(--t1-ink)}.why-cards article:nth-child(3)>span{background:var(--warning-50);color:var(--warning)}.why-cards h3{margin:0;color: var(--heading)}.why-cards p{margin:2px 0 0;color:var(--faint);font-size:.87rem}

.home-cta-section { padding: 64px 0 76px; background: var(--bg); }
.home-cta { position:relative; min-height:230px; overflow:hidden; display:grid; grid-template-columns:1fr auto; gap:30px; align-items:center; padding:42px 48px; border-radius:26px; color:#fff; background:linear-gradient(120deg,#0f332b,#174c3f 68%,#245e4e); box-shadow:var(--shadow-lg); }
.home-cta>div:not(.cta-pattern){position:relative;z-index:2}.home-cta span{color:#e8b44a;font-size:.8rem;font-weight:800}.home-cta h2{color:#fff;font-size:clamp(1.6rem,3vw,2.3rem);margin:5px 0}.home-cta p{color:rgba(255,255,255,.75);margin:0}.home-cta .btn{position:relative;z-index:3}.btn-saffron{background:#e8b44a;color:#213a31;box-shadow:none}.btn-saffron:hover{background:#f1c568;color:#163229;box-shadow:none}.cta-pattern{position:absolute!important;inset:0 auto 0 0;width:230px;opacity:.12;background-image:radial-gradient(circle at center,transparent 28%,#e8b44a 29%,#e8b44a 31%,transparent 32%);background-size:38px 38px}.algiers-line{position:absolute;left:0;bottom:0;width:410px;height:auto;opacity:.24;fill:none;stroke:#e8b44a;stroke-width:2}

@media (max-width: 1000px) { .home-hero::after{display:none}.home-hero-grid{grid-template-columns:1fr;padding-top:46px}.hero-copy{text-align:center}.hero-copy h1,.hero-copy .lead{margin-inline:auto}.hero-actions{justify-content:center}.hero-note{justify-content:center}.learning-scene{max-width:650px;width:100%;margin-inline:auto;background:linear-gradient(var(--hero-dim),var(--hero-dim)),url("/static/img/home-hero-learning-v1.png") 48% center/cover no-repeat;border-radius:34px;box-shadow:0 24px 50px rgba(18,59,50,.18)}.home-course-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width: 760px) { .learning-scene{min-height:500px;background-image:linear-gradient(var(--hero-dim),var(--hero-dim)),url("/static/img/home-hero-learning-mobile-v1.png");background-position:center 58%}.card-video{right:-4px;top:155px}.card-files{right:-8px;top:238px}.card-progress{right:-2px;top:321px}.trust-strip{grid-template-columns:1fr}.trust-strip>div+div{border-inline-start:0;border-top:1px solid var(--border)}.why-grid{grid-template-columns:1fr;gap:32px}.why-cards article:nth-child(2){transform:none}.home-cta{grid-template-columns:1fr;padding:34px 28px}.home-cta .btn{justify-self:start}.algiers-line{opacity:.12}.home-course-grid{grid-template-columns:1fr} }
@media (max-width: 520px) { .home-hero-grid{padding-top:38px;padding-bottom:55px}.hero-copy h1{font-size:2.45rem}.hero-copy .lead{font-size:1rem}.hero-actions .btn{width:100%}.learning-scene{min-height:520px;margin-top:5px;border-radius:22px;background-position:center 56%}.scene-card{min-width:142px;padding:8px 9px;gap:7px}.scene-card>span{width:30px;height:30px}.scene-card small{display:none}.card-video{right:-4px;top:165px}.card-files{right:-6px;top:228px}.card-progress{right:-2px;top:291px}.trust-wrap{margin-top:-15px}.mini-stats{grid-template-columns:1fr}.mini-stats div+div{border-inline-start:0;border-top:1px solid var(--border)}.home-cta{border-radius:20px}.home-cta .btn{width:100%} }

/* --- Course detail --------------------------------------------------------- */
.course-hero {
  color: #fff; background: radial-gradient(800px 420px at 90% -20%, rgba(18, 164, 241, .5), transparent 60%),
    linear-gradient(150deg, var(--deep) 0%, var(--deep-2) 100%);
}
.course-hero .container { display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding-top: 44px; padding-bottom: 48px; align-items: start; }
.course-hero h1 { color: #fff; }
.course-hero .lead { color: rgba(255, 255, 255, .85); font-size: 1.08rem; }
.course-hero .course-meta { color: rgba(255, 255, 255, .8); font-size: .92rem; }
.crumbs { font-size: .88rem; color: rgba(255, 255, 255, .7); margin-bottom: 12px; }
.crumbs a { color: rgba(255, 255, 255, .9); font-weight: 600; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.buy-card { color: var(--text); position: sticky; top: calc(var(--header-h) + 20px); overflow: hidden; box-shadow: var(--shadow-lg); }
.buy-card .price { font-size: 1.8rem; }
.buy-card h1, .buy-card h2, .buy-card h3 { color: var(--text); }
.course-body { display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding: 40px 20px 64px; }
.course-body > .main { min-width: 0; }
@media (max-width: 960px) {
  .course-hero .container, .course-body { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .course-body > .aside-spacer { display: none; }
}
.curriculum { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.curriculum details + details { border-top: 1px solid var(--border); }
.curriculum summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 12px; font-weight: 700; background: var(--surface-2); transition: background .15s; }
.curriculum summary:hover { background: var(--primary-50); }
.curriculum summary::-webkit-details-marker { display: none; }
.curriculum summary .chev { transition: transform .2s; color: var(--faint); display: inline-flex; }
.curriculum details[open] summary .chev { transform: rotate(-90deg); }
.curriculum summary .count { margin-inline-start: auto; color: var(--faint); font-weight: 600; font-size: .86rem; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--text); }
.lesson-row .l-icon { color: var(--faint); flex: none; display: inline-flex; }
.lesson-row .l-title { flex: 1; font-weight: 500; }
.lesson-row .l-extra { color: var(--faint); font-size: .84rem; display: inline-flex; gap: 4px; align-items: center; }
a.lesson-row:hover { background: var(--primary-50); color: var(--text); }
a.lesson-row:hover .l-icon { color: var(--link); }

/* --- Student dashboard ----------------------------------------------------- */
.dash-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius-lg); padding: 30px; margin-bottom: 24px;
  background: radial-gradient(700px 360px at 0% 0%, rgba(18, 164, 241, .55), transparent 60%), linear-gradient(140deg, var(--deep) 0%, var(--deep-2) 60%, #0b63cf 100%);
  display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 28px; align-items: center; box-shadow: var(--shadow-lg);
}
.dash-hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .05); inset-inline-start: -80px; bottom: -160px; pointer-events: none; }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero h1 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 6px; }
.dash-hero p { color: rgba(255, 255, 255, .86); margin-bottom: 18px; }
.continue-card { display: grid; grid-template-columns: 130px 1fr; overflow: hidden; color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lg); background: var(--surface); transition: transform .15s; }
a.continue-card:hover { transform: translateY(-2px); color: var(--text); }
.continue-card .cover { aspect-ratio: auto; height: 100%; min-height: 128px; }
.continue-card .card-body { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 16px 18px; }
.continue-card h2 { font-size: 1.02rem; margin: 0; line-height: 1.5; }
.continue-card .kicker { font-size: .8rem; font-weight: 700; color: var(--link); }
@media (max-width: 900px) { .dash-hero { grid-template-columns: 1fr; padding: 22px; } }
@media (max-width: 480px) { .continue-card { grid-template-columns: 96px 1fr; } }
.req-item .req-title { font-weight: 700; }

/* --- Lesson player --------------------------------------------------------- */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - var(--header-h)); }
.player-main { padding: 24px 28px 48px; min-width: 0; }
.player-side { background: var(--surface); border-inline-start: 1px solid var(--border); max-height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); overflow-y: auto; }
.player-side .side-head { padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.video-box { background: #06132f; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.video-box video { width: 100%; height: 100%; background: #000; }
.video-box .video-frame { width: 100%; height: 100%; border: 0; display: block; }
.video-box .no-video { color: rgba(255, 255, 255, .78); text-align: center; padding: 20px; }
.extra-video { margin-top: 22px; }
.extra-video-title { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.extra-video .video-box { box-shadow: var(--shadow); }
.lesson-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 20px 0; }
.lesson-toolbar h1 { font-size: clamp(1.25rem, 2.4vw, 1.65rem); margin: 0; }
.lesson-crumbs { font-size: .9rem; color: var(--faint); font-weight: 600; }
.nav-lessons { display: flex; gap: 10px; justify-content: space-between; margin-top: 28px; }
.side-lesson { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; color: var(--text); border-inline-start: 4px solid transparent; transition: background .15s; }
.side-lesson:hover { background: var(--surface-2); color: var(--text); }
.side-lesson.current { background: var(--primary-50); border-inline-start-color: var(--primary); font-weight: 700; }
.side-lesson .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; margin-top: 2px; color: #fff; font-size: .7rem; }
.side-lesson .dot svg { opacity: 0; }
.side-lesson.done .dot { background: var(--success-solid); border-color: var(--success-solid); }
.side-lesson.done .dot svg { opacity: 1; }
.side-lesson.current:not(.done) .dot { border-color: var(--primary); }
.side-lesson .t { flex: 1; font-size: .94rem; line-height: 1.55; }
.side-lesson .t small { display: block; color: var(--faint); font-weight: 400; }
.side-section { padding: 14px 20px 6px; font-weight: 800; font-size: .84rem; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); }
@media (max-width: 1000px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-side { position: static; max-height: none; border-inline-start: 0; border-top: 1px solid var(--border); }
  .player-main { padding: 0 0 28px; }
  .player-main .video-box { border-radius: 0; }
  .player-main .lesson-body { padding: 0 16px; }
}

/* --- Payment result -------------------------------------------------------- */
.result-icon { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; }
.result-icon.ok { background: var(--success-50); color: var(--success); }
.result-icon.ko { background: var(--danger-50); color: var(--danger); }
.result-sheet { text-align: start; margin: 22px 0; box-shadow: none; background: var(--surface-2); }

/* --- Error page ------------------------------------------------------------ */
.error-page { text-align: center; padding: 90px 20px; }
.error-page .code { font-size: 5rem; font-weight: 800; line-height: 1; margin-bottom: 12px; background: linear-gradient(135deg, var(--primary), var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 1.4rem; }

/* --- Admin ----------------------------------------------------------------- */
.settings-section { font-size: 1.05rem; margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.logo-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.logo-box { width: 96px; height: 96px; flex: none; border: 1.5px dashed var(--border-strong); border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.logo-box img { max-width: 84px; max-height: 84px; object-fit: contain; }
.section-block { margin-bottom: 18px; overflow: hidden; }
.section-block .card-head { background: var(--surface-2); }
.section-title-form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.section-title-form .input { min-height: 42px; font-weight: 700; background: transparent; border-color: transparent; }
.section-title-form .input:hover, .section-title-form .input:focus { background: var(--surface); border-color: var(--border-strong); }
.lesson-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.lesson-item:first-child { border-top: 0; }
.lesson-item .num { width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--primary-50); color: var(--link); display: grid; place-items: center; font-weight: 800; font-size: .86rem; }
.lesson-item .grow { min-width: 160px; }
.lesson-item .tags { display: flex; gap: 6px; }
details.add-lesson { border-top: 1px dashed var(--border-strong); }
details.add-lesson summary { padding: 14px 20px; cursor: pointer; color: var(--link); font-weight: 700; list-style: none; }
details.add-lesson summary:hover { background: var(--primary-50); }
details.add-lesson summary::-webkit-details-marker { display: none; }
details.add-lesson .card-body { padding-top: 0; }

.dash-hero.solo { grid-template-columns: 1fr; }
