/* Course page version 2 (/course-v2/{slug}/). Everything is scoped under .cv2 so the shared layout and Bootstrap are not affected. */
.cv2 {
    --g50: #F0F7F5; --g100: #D9ECE7; --g200: #AFD6CC; --g300: #7BBBAC; --g400: #3F9A87;
    --g500: #1F7A66; --g600: #0B6352; --g700: #044F41; --g800: #033A30; --g900: #022720;
    --ink: #1E2B28; --muted: #5B6B67; --line: #E3ECE9; --surface: #F6FAF9;
    --acc: #89BB02; --cta: #587C00; --acc-soft: #F1F7DC;
    --warn: #9A5B00; --warn-soft: #FFF4DE; --err: #A3261D;
    --r: 16px; --tap: 48px;
    background: var(--surface); color: var(--ink); line-height: 1.85; font-size: 15px;
    padding-top: 5.5rem; -webkit-tap-highlight-color: transparent;
}
.cv2 *, .cv2 *::before, .cv2 *::after { box-sizing: border-box; }
.cv2 a { color: var(--g600); }
.cv2 button { font: inherit; color: inherit; }
.cv2 h1, .cv2 h2, .cv2 h3 { font-family: inherit; }
.cv2 .cv2-i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv2 .cv2-i.cv2-fill { fill: currentColor; stroke: none; }
body.cv2-lock { overflow: hidden; }

.cv2-wrap { max-width: 1120px; margin: auto; padding: 0 1rem; }
.cv2-crumb { font-size: 13px; color: var(--muted); padding: .5rem 0 .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv2-crumb a { color: var(--muted); text-decoration: none; }
.cv2-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; padding-bottom: 6rem; }
.cv2-side { position: sticky; top: 90px; }

/* in-app browser banner */
.cv2-inapp { background: var(--warn-soft); border-bottom: 1px solid #F1D9A8; color: #5C3A00; }
.cv2-inapp-in { display: flex; gap: .7rem; align-items: flex-start; padding-top: .7rem; padding-bottom: .7rem; }
.cv2-inapp b { display: block; }
.cv2-inapp button { display: block; margin-top: .4rem; border: 0; background: var(--warn); color: #fff; border-radius: 10px; padding: .35rem .9rem; font-weight: 600; min-height: 40px; cursor: pointer; }

/* teaser */
.cv2-teaser { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--g600); cursor: pointer; }
.cv2-teaser img { width: 100%; height: auto; display: block; } /* the whole banner, at its own ratio (no cropping of the academy logo) */
.cv2-teaser-img { cursor: default; }
.cv2-teaser-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--g700); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.cv2-teaser-play .cv2-i { width: 30px; height: 30px; margin-inline-start: -4px; }
.cv2-teaser-cap { position: absolute; bottom: .7rem; inset-inline-start: .7rem; background: rgba(2,39,32,.75); color: #fff; border-radius: 10px; padding: .15rem .7rem; font-size: 13px; }

.cv2-title { font-size: 1.45rem; line-height: 1.6; margin: 1rem 0 .5rem; color: var(--g800); font-weight: 800; }
.cv2-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin: .5rem 0 1rem; padding: 0; list-style: none; }
.cv2-facts li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; font-size: 13px; display: flex; gap: .5rem; align-items: center; }
.cv2-facts li .cv2-i { color: var(--g500); }
.cv2-facts b { display: block; font-size: 14px; }
.cv2-facts small { color: var(--muted); }

.cv2-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; }
.cv2-sec { margin-top: 1.25rem; }
.cv2-sec > h2 { font-size: 1.1rem; color: var(--g800); margin: 0 0 .6rem; font-weight: 800; }
.cv2-sec > h2 span { box-shadow: inset 0 -3px var(--acc); }
.cv2-sec-lead { margin: -.3rem 0 .6rem; color: var(--muted); font-size: 13.5px; }

/* buttons */
.cv2-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: var(--tap); border-radius: 14px; border: 0; font-weight: 800; font-size: 16px; cursor: pointer; text-decoration: none; padding: .5rem 1rem; }
.cv2 a.cv2-btn { text-decoration: none; }
.cv2-btn + .cv2-btn, .cv2-buy-form + .cv2-btn { margin-top: .5rem; }
.cv2 .cv2-btn-cta { background: var(--cta); color: #fff; }
.cv2 .cv2-btn-cta:active { background: #4A6800; }
.cv2 .cv2-btn-main { background: var(--g700); color: #fff; }
.cv2 .cv2-btn-soft { background: var(--g50); color: var(--g700); border: 1px solid var(--g100); }
.cv2-btn[disabled] { opacity: .6; cursor: default; }
.cv2-link { border: 0; background: none; color: var(--g600); font-weight: 600; cursor: pointer; min-height: 36px; padding: 0; }
.cv2-buy-form { margin: 0; }

/* price box */
.cv2-price p { margin: .2rem 0 .8rem; color: var(--muted); font-size: 14px; }
.cv2-old-row { display: flex; gap: .5rem; align-items: center; }
.cv2-old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.cv2-off { background: var(--acc-soft); color: var(--g800); border-radius: 8px; padding: 0 .5rem; font-size: 13px; font-weight: 800; }
.cv2-now { font-size: 1.6rem; font-weight: 800; color: var(--g700); line-height: 1.5; margin-bottom: .6rem; }
.cv2-now small { font-size: 14px; font-weight: 600; }
.cv2 .cv2-installment { display: flex; gap: .4rem; align-items: center; color: var(--ink); }
.cv2-perks { list-style: none; padding: 0; margin: .8rem 0 0; font-size: 14px; }
.cv2-perks li { display: flex; gap: .5rem; align-items: center; padding: .15rem 0; }
.cv2-perks .cv2-i { color: var(--g500); }
.cv2-owned { background: var(--g50); border-color: var(--g200); }
.cv2-owned h3 { margin: 0 0 .25rem; color: var(--g700); font-size: 1.05rem; font-weight: 800; display: flex; gap: .4rem; align-items: center; }

/* help */
.cv2-help { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.cv2-help-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .75rem; font-size: 14px; }
.cv2-help-item b { display: flex; gap: .4rem; align-items: center; color: var(--g700); }
.cv2-help-item p { margin: .25rem 0 0; color: var(--muted); font-size: 13px; }

/* syllabus */
.cv2-syl-sum { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin: -.3rem 0 .6rem; }
.cv2-season { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .6rem; overflow: hidden; }
.cv2-season-head { width: 100%; display: flex; align-items: center; gap: .6rem; border: 0; background: none; padding: .8rem 1rem; min-height: 56px; text-align: start; cursor: pointer; }
.cv2-season-t { flex: 1; }
.cv2-season-t b { display: block; font-size: 15px; }
.cv2-season-t small { color: var(--muted); font-size: 12.5px; }
.cv2-chev { transition: transform .2s; color: var(--g500); }
.cv2-season[data-expanded="true"] > .cv2-season-head .cv2-chev { transform: rotate(180deg); }
.cv2-num { width: 32px; height: 32px; border-radius: 10px; background: var(--g50); color: var(--g700); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.cv2-season-body { display: none; border-top: 1px solid var(--line); }
.cv2-season[data-expanded="true"] > .cv2-season-body { display: block; }
.cv2-sub { margin: .5rem; border-radius: 12px; }
.cv2-sub > .cv2-season-head { min-height: 48px; padding: .5rem .8rem; }

.cv2-ses { padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.cv2-ses:last-child { border-bottom: 0; }
.cv2-ses-top { display: flex; gap: .6rem; align-items: flex-start; }
.cv2-kind { width: 36px; height: 36px; border-radius: 10px; background: var(--g50); color: var(--g600); display: grid; place-items: center; flex: none; }
.cv2-ses-name { flex: 1; min-width: 0; }
.cv2-ses-name b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.cv2-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: .15rem .6rem; }
.cv2-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.cv2 .cv2-act { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; min-width: 104px; border-radius: 12px; font-weight: 800; font-size: 14.5px; cursor: pointer; border: 1.5px solid var(--g700); background: #fff; color: var(--g700); padding: 0 1rem; }
.cv2 .cv2-act-watch { background: var(--g700); color: #fff; }
.cv2 .cv2-act-locked { border-style: dashed; border-color: var(--g200); color: var(--muted); background: #FAFCFB; font-weight: 600; font-size: 14px; }
.cv2 .cv2-act[disabled] { opacity: .55; cursor: default; }
.cv2 .cv2-act-small { min-height: 40px; font-size: 13.5px; border-width: 1px; padding: 0 .8rem; }
.cv2-att { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .35rem .6rem; font-size: 13.5px; }
.cv2-att-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cv2-att-name small { color: var(--muted); display: block; font-size: 12px; }
.cv2-chip { display: inline-flex; align-items: center; gap: .25rem; border-radius: 8px; padding: 0 .45rem; font-size: 12px; font-weight: 600; }
.cv2-chip-lock { background: #F1F3F2; color: var(--muted); }

/* description, faq, related */
.cv2-desc { font-size: 15px; overflow-wrap: anywhere; }
.cv2-desc img { max-width: 100%; height: auto; }
.cv2-desc.cv2-clamp { max-height: 260px; overflow: hidden; position: relative; }
.cv2-desc.cv2-clamp::after { content: ""; position: absolute; inset: auto 0 0 0; height: 80px; background: linear-gradient(transparent, #fff); }
.cv2-more { margin-top: .5rem; }
.cv2-faq details { border-bottom: 1px solid var(--line); padding: .2rem 0; }
.cv2-faq details:last-child { border: 0; }
.cv2-faq summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; gap: .5rem; list-style: none; }
.cv2-faq summary::-webkit-details-marker { display: none; }
.cv2-faq summary::before { content: "+"; width: 26px; height: 26px; border-radius: 8px; background: var(--g50); color: var(--g700); display: grid; place-items: center; flex: none; font-weight: 800; }
.cv2-faq details[open] summary::before { content: "−"; }
.cv2-faq-a { margin: 0 0 .6rem; color: var(--muted); font-size: 14px; padding-inline-start: 2.1rem; }
.cv2-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.cv2-rel a { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.cv2-rel img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--g100); }
.cv2-rel span { display: block; padding: .5rem .6rem; }
.cv2-rel em { display: block; font-style: normal; color: var(--g700); font-weight: 800; font-size: 13px; }

/* mobile sticky bar */
.cv2-sticky { position: fixed; bottom: 0; inset-inline: 0; z-index: 1025; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(3,58,48,.08); padding: .55rem 1rem calc(.55rem + env(safe-area-inset-bottom)); display: none; align-items: center; gap: .75rem; transform: translateY(110%); transition: transform .25s; }
.cv2-sticky.cv2-show { transform: none; }
.cv2-sticky-p { line-height: 1.3; }
.cv2-sticky-p small { display: block; color: var(--muted); font-size: 12px; text-decoration: line-through; }
.cv2-sticky-p b { font-size: 1.05rem; color: var(--g700); }
.cv2-sticky .cv2-btn, .cv2-sticky .cv2-buy-form { width: auto; flex: 1; margin: 0; }
.cv2-sticky .cv2-buy-form .cv2-btn { width: 100%; }

/* sheets, player, toast */
.cv2-scrim { position: fixed; inset: 0; background: rgba(2,39,32,.55); z-index: 1040; display: none; }
.cv2-scrim.cv2-on { display: block; }
.cv2-sheet { position: fixed; z-index: 1041; inset-inline: 0; bottom: 0; margin: auto; max-width: 520px; background: #fff; border-radius: 22px 22px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; transform: translateY(105%); transition: transform .25s; visibility: hidden; }
.cv2-sheet.cv2-on { transform: none; visibility: visible; }
.cv2-sheet h3 { margin: .2rem 0 .5rem; padding-inline-end: 3rem; color: var(--g800); font-size: 1.1rem; font-weight: 800; display: flex; gap: .4rem; align-items: center; }
.cv2-sheet p { margin: .3rem 0; font-size: 14.5px; }
.cv2-x { position: absolute; top: .6rem; inset-inline-end: .6rem; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--g50); cursor: pointer; display: grid; place-items: center; }
.cv2-muted { color: var(--muted); font-size: 13.5px; text-align: center; }
.cv2-steps { list-style: none; padding: 0; margin: .7rem 0; counter-reset: cv2s; }
.cv2-steps li { counter-increment: cv2s; position: relative; padding: .4rem 2.4rem .4rem 0; font-size: 14.5px; min-height: 2.4rem; }
.cv2-steps li::before { content: counter(cv2s, persian); position: absolute; top: .45rem; inset-inline-start: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--g700); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.cv2-kbd { display: inline-flex; align-items: center; background: var(--g50); border: 1px solid var(--g100); border-radius: 8px; padding: 0 .4rem; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.cv2-file-line { display: flex; gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; margin: .6rem 0; }
.cv2-file-line b { overflow-wrap: anywhere; }
.cv2-file-line small { display: block; color: var(--muted); }
.cv2-note { border-radius: 12px; padding: .6rem .7rem; font-size: 13.5px; margin: .6rem 0; display: flex; gap: .5rem; align-items: flex-start; }
.cv2-note .cv2-i { margin-top: .25rem; }
.cv2-note-warn { background: var(--warn-soft); color: #5C3A00; }
.cv2-note-ok { background: var(--g50); color: var(--g800); }
.cv2-lock-price { font-size: 1.2rem; font-weight: 800; color: var(--g700); }
.cv2-field { display: block; margin: .6rem 0; }
.cv2-field span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: .2rem; }
.cv2-field input { width: 100%; min-height: var(--tap); border: 1.5px solid var(--line); border-radius: 12px; padding: .4rem .8rem; font: inherit; font-size: 16px; }
.cv2-field input:focus { outline: none; border-color: var(--g500); box-shadow: 0 0 0 3px var(--g100); }
.cv2-field em { display: none; color: var(--err); font-size: 13px; font-style: normal; margin-top: .2rem; }
.cv2-field.cv2-invalid input { border-color: var(--err); }
.cv2-field.cv2-invalid em { display: block; }
.cv2-form-error { color: var(--err); font-size: 14px; }

.cv2-player { position: fixed; z-index: 1042; inset: 0; margin: auto; width: 100%; height: max-content; max-height: 100%; background: #000; display: none; flex-direction: column; overflow: hidden; }
.cv2-player.cv2-on { display: flex; }
.cv2-player-bar { flex: none; display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .8rem; background: var(--g900); color: #fff; font-size: 14px; }
.cv2-player-bar b { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv2-player-bar button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
/* the screen takes the video's own shape (--cv2-ratio, set by course-v2.js), but never grows past the screen height minus the title bar and the download bar, so a vertical video cannot push them off the screen */
.cv2-screen { position: relative; aspect-ratio: var(--cv2-ratio, 16/9); min-height: 0; max-height: calc(100vh - 8rem); max-height: calc(100dvh - 8rem); flex: 0 1 auto; background: #000; }
.cv2-screen.cv2-err { aspect-ratio: auto; min-height: min(340px, calc(100dvh - 8rem)); }
.cv2-screen video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.cv2-state { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 1rem; color: #fff; background: rgba(0,0,0,.55); }
.cv2-state.cv2-on { display: grid; }
.cv2-spin { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.3); border-top-color: var(--acc); border-radius: 50%; animation: cv2-spin 1s linear infinite; margin: 0 auto .5rem; }
@keyframes cv2-spin { to { transform: rotate(360deg); } }
.cv2-errbox { background: #fff; color: var(--ink); border-radius: 16px; padding: 1rem; max-width: 340px; text-align: start; }
.cv2-errbox b { color: var(--err); display: flex; gap: .4rem; align-items: center; }
.cv2-errbox p { margin: .3rem 0 .7rem; font-size: 14px; color: var(--muted); }
.cv2-errbox .cv2-btn { font-size: 15px; min-height: 44px; }
.cv2-player-below { flex: none; background: #fff; padding: .6rem .9rem; font-size: 13.5px; color: var(--muted); display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.cv2-player-below .cv2-btn { width: auto; min-height: 40px; font-size: 14px; margin: 0; }

.cv2-toast { position: fixed; z-index: 1060; bottom: 5.5rem; inset-inline: 0; margin: auto; width: max-content; max-width: calc(100% - 2rem); background: var(--g800); color: #fff; padding: .55rem 1rem; border-radius: 14px; font-size: 14px; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; text-align: center; }
.cv2-toast.cv2-on { opacity: 1; transform: none; }

@media (min-width: 700px) {
    .cv2-sheet { bottom: auto; top: 50%; border-radius: 22px; transform: translateY(-40%) scale(.96); opacity: 0; transition: .2s; }
    .cv2-sheet.cv2-on { transform: translateY(-50%); opacity: 1; }
    .cv2-player { width: min(900px, calc(100% - 2rem)); border-radius: 16px; overflow: hidden; }
}

/* mobile: picture, title and facts first, then the price box, then the rest */
@media (max-width: 900px) {
    .cv2 { padding-top: 4.5rem; }
    .cv2-layout { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
    .cv2-main { display: contents; }
    .cv2-main > * { order: 2; }
    .cv2-main > .cv2-teaser, .cv2-main > .cv2-title, .cv2-main > .cv2-facts { order: 0; }
    .cv2-side { position: static; order: 1; }
    .cv2-sticky { display: flex; }
}
@media (max-width: 520px) {
    .cv2-help { grid-template-columns: 1fr; }
    .cv2-title { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cv2 *, .cv2-sheet, .cv2-sticky, .cv2-toast { transition: none !important; animation: none !important; }
}
