/* Courses catalogue, course detail and checkout — builds on styles.css */

.sub{padding-top:calc(var(--nav-h) + 24px)}
.crumbs{display:flex;align-items:center;gap:8px;font-size:.88rem;font-weight:700;color:var(--muted);margin-bottom:18px}
.crumbs a{color:var(--brand-text)}
.crumbs .ic{width:14px;height:14px;transform:scaleX(-1)}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:.8rem;font-weight:700;padding:5px 12px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--ink-2);white-space:nowrap}
.pill .ic{width:15px;height:15px}
.pill--brand{background:var(--brand-soft);color:var(--brand-text);border-color:transparent}
.pill--ok{background:#E6F4EC;color:var(--ok);border-color:transparent}
.pill--ink{background:var(--ink);color:#fff;border-color:var(--ink)}

/* ---------- catalogue ---------- */
.cat-head{display:grid;gap:18px;padding-block:clamp(20px,4vw,40px) clamp(28px,4vw,44px)}
.cat-head h1{font-size:clamp(2.2rem,6.6vw,4.4rem);line-height:1.2}
.cat-head p{color:var(--ink-2);font-size:1.08rem;max-width:56ch}
.cat-tools{display:grid;gap:12px;margin-bottom:26px}
.cat-tools__row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.search{flex:1;min-width:220px;display:flex;align-items:center;gap:10px;height:54px;padding:0 18px;border-radius:999px;background:var(--surface);border:1.5px solid var(--line);transition:border-color .2s}
.search:focus-within{border-color:var(--ink)}
.search input{flex:1;min-width:0;border:0;outline:none;background:transparent;font-size:1rem}
.search .ic{color:var(--muted)}
.sort{height:54px;border-radius:999px;border:1.5px solid var(--line);background:var(--surface);padding:0 20px 0 42px;font-weight:700;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316171B' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:left 18px center}
.cat-count{color:var(--muted);font-weight:700;font-size:.92rem}
.grid-courses{display:grid;gap:18px}
@media (min-width:640px){ .grid-courses{grid-template-columns:repeat(2,1fr)} }
@media (min-width:1080px){ .grid-courses{grid-template-columns:repeat(3,1fr);gap:22px} }
.pcard{display:flex;flex-direction:column;border-radius:var(--r-xl);overflow:hidden;background:var(--surface);border:1px solid var(--line);transition:transform .6s var(--ease-out),box-shadow .6s;animation:rise .7s var(--ease-out) both;animation-delay:var(--d,0s)}
@keyframes rise{from{opacity:0;transform:translateY(24px)}}
.pcard:hover{transform:translateY(-6px);box-shadow:var(--shadow-lg)}
.pcard__img{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--bg-2)}
.pcard__img img{width:100%;height:100%;object-fit:cover;transition:transform 1.2s var(--ease-out)}
.pcard:hover .pcard__img img{transform:scale(1.07)}
.pcard__badges{position:absolute;top:14px;right:14px;left:14px;display:flex;gap:6px;flex-wrap:wrap}
.pcard__badges .pill{background:rgba(255,255,255,.78);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-color:rgba(255,255,255,.8);color:var(--ink)}
.pcard__badges .pill--brand{background:var(--brand);border-color:var(--brand)}
.pcard__badges .pill--ok{background:#E6F4EC;color:var(--ok)}
.pcard__b{flex:1;display:flex;flex-direction:column;gap:10px;padding:20px 20px 18px}
.pcard__cat{font-size:.8rem;font-weight:700;color:var(--brand-text)}
.pcard__t{font-size:1.22rem;font-weight:800;line-height:1.45}
.pcard__d{color:var(--ink-2);font-size:.93rem;line-height:1.75}
.meta{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.84rem;color:var(--ink-2);font-weight:700}
.meta span{display:inline-flex;align-items:center;gap:5px}
.meta .ic{width:15px;height:15px;color:var(--muted)}
.meta .star{color:var(--brand)}
.pcard__f{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:14px;border-top:1px solid var(--line)}
.price{display:flex;flex-direction:column;line-height:1.25}
.price b{font-size:1.45rem;font-weight:800}
.price small{color:var(--muted);font-weight:600;font-size:.8rem}
.go{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--ink);color:#fff;transition:background .3s,color .3s,transform .5s var(--ease-out)}
.pcard:hover .go{background:var(--brand);color:var(--ink);transform:translateX(-4px)}
.empty{grid-column:1/-1;text-align:center;padding:60px 20px;color:var(--muted);font-weight:700}

/* ---------- course detail ---------- */
.cd{display:grid;gap:28px;align-items:start}
@media (min-width:1024px){ .cd{grid-template-columns:1fr 390px;gap:48px} .buy{position:sticky;top:calc(var(--nav-h) + 16px)} }
.cd-hero{display:grid;gap:16px}
.cd-hero h1{font-size:clamp(2.1rem,5.6vw,3.8rem);line-height:1.22}
.cd-hero > p{color:var(--ink-2);font-size:1.1rem;max-width:56ch}
.cd-hero .meta{font-size:.92rem;gap:8px 18px}
.cd-cover{position:relative;border-radius:var(--r-xl);overflow:hidden;aspect-ratio:16/9;margin-top:8px;background:var(--bg-2)}
.cd-cover img{width:100%;height:100%;object-fit:cover}
.cd-cover__play{position:absolute;inset:0;margin:auto;width:84px;height:84px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.78);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);transition:transform .5s var(--ease-out)}
.cd-cover__play .ic{width:32px;height:32px}
.cd-cover:hover .cd-cover__play{transform:scale(1.08)}
.cd-cover__tag{position:absolute;bottom:16px;right:16px;padding:8px 14px;border-radius:14px;background:rgba(255,255,255,.78);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);font-weight:800;font-size:.88rem}
.buy{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:24px;box-shadow:var(--shadow)}
.buy__price{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.buy__price b{font-size:2.6rem;font-weight:800;line-height:1.1}
.buy__price s{color:var(--muted);font-weight:700}
.buy__inst{color:var(--ink-2);font-weight:600;margin:4px 0 18px}
.buy__inst b{color:var(--ink)}
.buy .btn{width:100%}
.buy .btn + .btn{margin-top:10px}
.buy__list{list-style:none;margin:20px 0 0;padding:18px 0 0;border-top:1px solid var(--line);display:grid;gap:10px}
.buy__list li{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--ink-2);font-size:.95rem}
.buy__list .ic{width:20px;height:20px;color:var(--ink);flex:none}
.buy__safe{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:16px;font-size:.82rem;color:var(--muted);font-weight:700}
.buy__safe .ic{width:16px;height:16px}
.buy--owned{border-color:var(--ok)}
.blk{padding-top:clamp(40px,6vw,64px)}
.blk h2{font-size:clamp(1.6rem,3.8vw,2.3rem);margin-bottom:18px}
.outcomes{display:grid;gap:12px;list-style:none;margin:0;padding:0}
@media (min-width:640px){ .outcomes{grid-template-columns:1fr 1fr} }
.outcomes li{display:flex;gap:12px;align-items:flex-start;padding:16px 18px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line);font-weight:700;line-height:1.6}
.outcomes .ic{width:24px;height:24px;padding:5px;border-radius:50%;background:var(--brand);color:var(--ink);flex:none}
.curr__sum{display:flex;flex-wrap:wrap;gap:8px;margin:-6px 0 16px;color:var(--ink-2);font-weight:700;font-size:.93rem}
.lvl{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.lvl + .lvl{margin-top:10px}
.lvl summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:14px;padding:18px 20px;font-weight:800}
.lvl summary::-webkit-details-marker{display:none}
.lvl__n{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;background:var(--bg);font-weight:800;flex:none}
.lvl[open] .lvl__n{background:var(--ink);color:#fff}
.lvl summary span:nth-child(2){flex:1}
.lvl summary small{color:var(--muted);font-weight:600;font-size:.85rem}
.lvl__chev{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--bg);transition:transform .4s var(--ease-out)}
.lvl[open] .lvl__chev{transform:rotate(180deg)}
.lvl ol{list-style:none;margin:0;padding:0 14px 12px}
.lvl li{display:flex;align-items:center;gap:12px;padding:12px 8px;border-top:1px solid var(--line);font-weight:600;font-size:.95rem}
.lvl li .ic{width:18px;height:18px;color:var(--muted)}
.lvl li span{flex:1}
.lvl li small{color:var(--muted);font-weight:600}
.lvl li .pill{font-size:.72rem;padding:3px 9px}
.lvl__exam{margin-top:10px;display:flex;align-items:center;gap:14px;padding:18px 20px;border-radius:var(--r-lg);border:1.5px dashed var(--line-2);font-weight:800}
.lvl__exam .lvl__n{background:var(--brand)}
.lvl__exam small{display:block;color:var(--muted);font-weight:600;font-size:.85rem}
.how{display:grid;gap:12px}
@media (min-width:760px){ .how{grid-template-columns:repeat(3,1fr)} }
.how div{padding:22px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line)}
.how b{display:block;font-size:1.05rem;margin:14px 0 6px}
.how p{color:var(--ink-2);font-size:.93rem;line-height:1.8}
.how span{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:13px;background:var(--brand);font-weight:800}
.team{display:flex;gap:18px;align-items:center;padding:22px;border-radius:var(--r-lg);background:var(--night);color:#fff}
.team img{width:88px;height:88px;border-radius:22px;object-fit:cover;flex:none}
.team p{color:var(--night-muted);font-size:.95rem;line-height:1.8;margin-top:4px}
.mbar{position:fixed;z-index:95;inset:auto 10px calc(10px + env(safe-area-inset-bottom)) 10px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 10px 10px 16px;border-radius:22px;background:rgba(255,255,255,.86);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);border:1px solid rgba(255,255,255,.9);box-shadow:var(--shadow-lg);transform:translateY(140%);transition:transform .5s var(--ease-out)}
.mbar.is-on{transform:none}
.mbar .price b{font-size:1.25rem}
@media (min-width:1024px){ .mbar{display:none} }
.has-mbar .fab{bottom:calc(92px + env(safe-area-inset-bottom))}
@media (min-width:1024px){ .has-mbar .fab{bottom:calc(16px + env(safe-area-inset-bottom))} }

/* ---------- checkout ---------- */
.co-top{position:sticky;top:0;z-index:50;background:rgba(246,244,239,.86);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);border-bottom:1px solid var(--line)}
.co-top .container{display:flex;align-items:center;justify-content:space-between;gap:12px;height:72px}
.co-brand{display:flex;align-items:center;gap:10px;font-weight:800}
.co-brand img{width:46px}
.co-secure{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:.9rem;color:var(--ok)}
.co-secure .ic{width:18px;height:18px}
.steps{display:flex;align-items:center;gap:8px;margin:26px 0 24px;font-weight:700;font-size:.9rem;color:var(--muted);overflow-x:auto}
.steps span{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.steps i{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-style:normal;background:var(--bg-2);color:var(--ink-2);font-size:.8rem}
.steps .on{color:var(--ink)}
.steps .on i{background:var(--ink);color:#fff}
.steps .done i{background:var(--brand);color:var(--ink)}
.steps hr{flex:1;min-width:24px;border:0;height:1.5px;background:var(--line-2)}
.co{display:grid;gap:18px;align-items:start;padding-bottom:80px}
@media (min-width:1024px){ .co{grid-template-columns:1fr 400px;gap:28px} .summary{position:sticky;top:96px} }
.co-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:clamp(20px,3vw,30px)}
.co-card + .co-card{margin-top:16px}
.co-card h2{font-size:1.3rem;margin-bottom:16px;display:flex;align-items:center;gap:10px}
.co-card h2 i{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:.85rem;background:var(--ink);color:#fff}
.fgrid{display:grid;gap:14px}
@media (min-width:600px){ .fgrid--2{grid-template-columns:1fr 1fr} }
.opts{display:grid;gap:10px}
@media (min-width:600px){ .opts--2{grid-template-columns:1fr 1fr} .opts--3{grid-template-columns:repeat(3,1fr)} }
.opt{position:relative;display:flex;gap:12px;align-items:flex-start;padding:16px;border-radius:18px;border:1.5px solid var(--line-2);cursor:pointer;transition:border-color .2s,background .2s}
.opt input{position:absolute;opacity:0}
.opt__dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--line-2);flex:none;margin-top:2px;transition:all .2s}
.opt div{display:flex;flex-direction:column;line-height:1.5}
.opt b{font-weight:800}
.opt small{color:var(--muted);font-weight:600;font-size:.84rem}
.opt:has(input:checked){border-color:var(--ink);background:var(--bg)}
.opt:has(input:checked) .opt__dot{border-color:var(--ink);background:var(--ink);box-shadow:0 0 0 4px var(--surface) inset}
.opt:has(input:focus-visible){outline:2.5px solid var(--ink);outline-offset:2px}
.opt .ic{width:22px;height:22px;margin-inline-start:auto;color:var(--ink-2)}
.card-form{margin-top:16px;display:grid;gap:14px}
.card-num{position:relative}
.card-num input{padding-left:110px!important;letter-spacing:.08em}
.brands{position:absolute;left:12px;top:50%;transform:translateY(-50%);display:flex;gap:5px}
.brands span{font-size:.62rem;font-weight:800;padding:3px 6px;border-radius:5px;border:1px solid var(--line-2);color:var(--ink-2);letter-spacing:.03em}
.demo-note{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:14px;background:var(--brand-soft);color:#5E4200;font-size:.86rem;font-weight:600;line-height:1.7}
.demo-note .ic{width:18px;height:18px;flex:none;margin-top:3px}
.bank{display:grid;gap:0;margin-top:16px;padding:6px 16px;border-radius:16px;background:var(--bg)}
.bank div{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--line);font-size:.93rem}
.bank div:first-child{border:0}
.bank span{color:var(--ink-2);font-weight:600}
.bank b{font-weight:800}
.summary .co-card{padding:22px}
.sum-course{display:flex;gap:14px;align-items:center;padding-bottom:16px;border-bottom:1px solid var(--line)}
.sum-course img{width:84px;height:84px;border-radius:18px;object-fit:cover;flex:none}
.sum-course div{display:flex;flex-direction:column;line-height:1.45}
.sum-course small{color:var(--muted);font-weight:600;font-size:.84rem}
.sum-rows{display:grid;margin:8px 0}
.sum-rows div{display:flex;justify-content:space-between;padding:9px 0;font-size:.95rem}
.sum-rows span{color:var(--ink-2);font-weight:600}
.sum-rows b{font-weight:800}
.sum-rows .disc b{color:var(--ok)}
.sum-total{display:flex;justify-content:space-between;align-items:baseline;padding:14px 0;border-top:1.5px solid var(--ink);margin-top:4px}
.sum-total b{font-size:1.8rem;font-weight:800}
.sum-total small{display:block;color:var(--muted);font-weight:600;font-size:.82rem}
.coupon{display:flex;gap:8px;margin:12px 0 4px}
.coupon input{flex:1;min-width:0;height:46px;border-radius:12px;border:1.5px solid var(--line-2);padding:0 14px;outline:none;text-transform:uppercase}
.coupon input:focus{border-color:var(--ink)}
.coupon button{height:46px;padding:0 16px;border-radius:12px;background:var(--bg-2);font-weight:800}
.coupon-msg{font-size:.84rem;font-weight:700;min-height:1.2em}
.pay-btn{width:100%;margin-top:6px}
.pay-btn .spin{display:none;width:18px;height:18px;border-radius:50%;border:2px solid currentColor;border-inline-end-color:transparent;animation:spin .7s linear infinite}
.pay-btn.is-loading{pointer-events:none}
.pay-btn.is-loading .spin{display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}
.terms{font-size:.8rem;color:var(--muted);text-align:center;margin-top:12px;line-height:1.7}
.terms a{color:var(--brand-text);font-weight:700}

/* processing + success */
.proc{position:fixed;inset:0;z-index:300;display:grid;place-items:center;padding:16px;background:rgba(19,19,22,.45);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:fade .3s}
@keyframes fade{from{opacity:0}}
.proc__box{width:100%;max-width:400px;background:var(--surface);border-radius:var(--r-xl);padding:30px;text-align:center;box-shadow:var(--shadow-lg);animation:rise .6s var(--ease-out)}
.proc__spin{width:64px;height:64px;margin:0 auto 18px;border-radius:50%;border:4px solid var(--bg-2);border-top-color:var(--brand);animation:spin .9s linear infinite}
.proc__box p{color:var(--ink-2);margin-top:6px}
.proc__steps{list-style:none;margin:18px 0 0;padding:0;display:grid;gap:8px;text-align:start}
.proc__steps li{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--muted);transition:color .3s}
.proc__steps li i{width:22px;height:22px;border-radius:50%;border:2px solid var(--line-2);display:grid;place-items:center;flex:none;transition:all .3s}
.proc__steps li.ok{color:var(--ink)}
.proc__steps li.ok i{background:var(--brand);border-color:var(--brand)}
.proc__steps li.ok i::after{content:"";width:8px;height:5px;border:2px solid var(--ink);border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.success{max-width:680px;margin:40px auto 90px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px}
.success__ic{width:110px;height:110px;border-radius:50%;display:grid;place-items:center;background:var(--brand);animation:pop .8s var(--ease-out) both}
.success__ic .ic{width:52px;height:52px}
@keyframes pop{from{transform:scale(.4);opacity:0}}
.success h1{font-size:clamp(1.9rem,5vw,2.8rem)}
.success > p{color:var(--ink-2);font-size:1.06rem;max-width:48ch}
.receipt{width:100%;margin-top:14px;text-align:start;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:22px}
.receipt .sum-course{border:0;padding:0 0 14px}
.receipt dl{margin:0;display:grid}
.receipt dl div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:.95rem}
.receipt dt{color:var(--ink-2);font-weight:600}
.receipt dd{margin:0;font-weight:800}
.success__acts{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:10px}
.confetti{position:fixed;inset:0;pointer-events:none;z-index:310;overflow:hidden}
.confetti i{position:absolute;top:-20px;width:10px;height:14px;border-radius:2px;animation:fall linear forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}

@media (prefers-reduced-motion:reduce){ *,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important} }
