/* Psychera Academy - academic design system.
   Sections: 1 tokens  2 base  3 header/footer  4 buttons  5 surfaces  6 page bands  7 home  8 course page
             9 learning ledger  10 lecture  11 forms  12 quizzes/exam  13 admin  14 responsive
   Everything uses logical properties (inline/block) so Arabic and Kurdish (RTL) mirror automatically. */
[hidden]{display:none!important}

/* ---------- 0. fonts (self-hosted; files go in public/fonts/) ----------
   unicode-range keeps each file to its own script: Arabic and Kurdish letters use the Noto files, Latin letters fall through to the next font in the stack. */
@font-face{font-family:"Noto Sans Arabic";font-style:normal;font-weight:100 900;font-display:swap;
  src:url("/fonts/noto-sans-arabic-arabic-standard-normal.woff2") format("woff2");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Noto Naskh Arabic";font-style:normal;font-weight:400 700;font-display:swap;
  src:url("/fonts/noto-naskh-arabic-arabic-vf.woff2") format("woff2");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}

/* ---------- 1. tokens ---------- */
:root{
  /* Academic foundation */
  --academic-navy:#0d2033;
  --academic-slate:#1f3347;
  --academic-gold:#c59b27;
  --academic-gold-muted:#e6be58;
  --academic-gold-deep:#80610c;      /* gold that is dark enough for text on white (6:1) */
  /* Canvas */
  --bg-parchment:#f8f9fa;
  --surface-card:#ffffff;
  --surface-elevated:#f0f4f8;
  /* Ink */
  --text-primary:#151e29;
  --text-secondary:#4a5b6d;
  --text-muted:#5d6e80;
  /* States */
  --status-complete:#1b5e20;--status-complete-bg:#e8f5e9;
  --status-pending:#8d4f00;--status-pending-bg:#fff8e1;
  --status-locked:#5c6b73;--status-locked-bg:#eceff1;
  --status-error:#a4262c;--status-error-bg:#fdecea;
  /* Lines, shadows, radii */
  --line-subtle:#dbe2e8;
  --line-strong:#0d2033;
  --shadow-academic:0 4px 16px rgba(13,32,51,.06);
  --shadow-float:0 10px 30px rgba(13,32,51,.1);
  --radius-sm:6px;
  --radius-md:10px;
  /* Type: serif for titles and long reading, sans for interface. Arabic-script fallbacks are listed per stack. */
  --font-serif:"Noto Naskh Arabic","Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua","Traditional Arabic","Geeza Pro","Sakkal Majalla",Georgia,"Times New Roman",serif;
  --font-sans:"Noto Sans Arabic","Segoe UI","Noto Sans",system-ui,-apple-system,Roboto,Tahoma,Arial,sans-serif;
  --measure:68ch;
  /* legacy names, still used by admin.js and older rules */
  --bg:var(--bg-parchment);--card:var(--surface-card);--ink:var(--text-primary);--muted:var(--text-secondary);
  --brand:var(--academic-navy);--brand-d:var(--academic-navy);--brand-l:var(--surface-elevated);
  --ok:var(--status-complete);--ok-l:var(--status-complete-bg);--warn:var(--status-pending);--warn-l:var(--status-pending-bg);
  --lock:var(--status-locked);--lock-l:var(--status-locked-bg);--err:var(--status-error);--err-l:var(--status-error-bg);
  --line:var(--line-subtle);--r:var(--radius-md);
}

/* ---------- 2. base ---------- */
*{box-sizing:border-box}
html{font-size:17px;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg-parchment);color:var(--text-primary);line-height:1.65;font-family:var(--font-sans);overflow-x:clip;display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
body>main{flex:1 0 auto;width:100%}
html[dir=rtl] body{line-height:1.85}
h1,h2,h3{font-family:var(--font-serif);font-weight:600;line-height:1.22;margin:0 0 .5rem;color:var(--academic-navy);letter-spacing:-.01em;text-wrap:balance}
html[dir=rtl] h1,html[dir=rtl] h2,html[dir=rtl] h3{letter-spacing:0;line-height:1.5}
h1{font-size:clamp(1.8rem,4.2vw,2.5rem)}
h2{font-size:1.35rem;display:flex;align-items:center;gap:.55rem}
h3{font-size:1.1rem}
p{margin:.25rem 0 .8rem}
a{color:var(--academic-navy);text-decoration-color:var(--academic-gold);text-underline-offset:.2em;text-decoration-thickness:2px}
a:hover{text-decoration-color:var(--academic-navy)}
.wrap{max-width:1080px;margin:0 auto;padding:1.25rem}
.ic{width:1.15em;height:1.15em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.flip{display:inline-flex}[dir=rtl] .flip .ic{transform:scaleX(-1)}
.ltr{direction:ltr;unicode-bidi:isolate}
.muted{color:var(--text-secondary)}
img,iframe{max-width:100%}
.mini span,.card h2,.note,td,th,p{overflow-wrap:anywhere}
:focus-visible{outline:3px solid var(--academic-navy);outline-offset:2px}
.topbar :focus-visible,.band :focus-visible,.foot :focus-visible{outline-color:var(--academic-gold-muted)}
::selection{background:var(--academic-gold-muted);color:var(--academic-navy)}

/* ---------- 3. header and footer ---------- */
.topbar{background:var(--academic-navy);color:#fff;border-bottom:3px solid var(--academic-gold);position:sticky;top:0;z-index:5}
.bar-in{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-block:.55rem}
.brand{display:flex;align-items:center;gap:.7rem;font-family:var(--font-serif);font-size:1.2rem;font-weight:600;color:#fff;text-decoration:none;min-width:0;letter-spacing:.005em}
.brand:hover{color:var(--academic-gold-muted)}
.brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand-logo{width:40px;height:40px;border-radius:50%;flex:none;box-shadow:0 0 0 2px var(--academic-gold)}
.tools{display:flex;gap:.15rem;flex:none;align-items:center}
.topbar .btn-ghost{color:#e8eef4}
.topbar .btn-ghost:hover{background:rgba(255,255,255,.1);color:#fff}

.foot{background:var(--academic-navy);color:#c9d4df;margin-top:3rem;border-top:3px solid var(--academic-gold)}
.foot a{color:#fff;text-decoration-color:var(--academic-gold)}
.foot a:hover{color:var(--academic-gold-muted)}
.foot-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2rem;padding-block:2.25rem 1.5rem}
.foot h3{color:#fff;font-size:1.05rem;margin-bottom:.6rem}
.foot p{margin:.3rem 0;font-size:.95rem}
.foot-ypo{display:flex;align-items:center;gap:.8rem;margin:.9rem 0 0}
.foot-ypo img{width:48px;height:48px;border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.35)}
.foot-links{list-style:none;margin:0;padding:0}.foot-links li{margin:.35rem 0}
.foot .btn-secondary{background:transparent;border-color:rgba(255,255,255,.5);color:#fff}
.foot .btn-secondary:hover{background:rgba(255,255,255,.1);border-color:#fff}
.foot-base{border-top:1px solid rgba(255,255,255,.15);padding-block:1rem;font-size:.85rem;color:#9fb0c1}
.foot-base p{margin:0}

/* ---------- 4. buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:46px;padding:.55rem 1.15rem;border:2px solid var(--academic-navy);border-radius:var(--radius-sm);background:var(--academic-navy);color:#fff;font:inherit;font-weight:600;text-decoration:none;cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}
.btn:hover{background:var(--academic-slate);border-color:var(--academic-slate);color:#fff}
.btn-secondary{background:var(--surface-card);color:var(--academic-navy)}
.btn-secondary:hover{background:var(--surface-elevated);border-color:var(--academic-navy);color:var(--academic-navy)}
.btn-gold{background:var(--academic-gold);border-color:var(--academic-gold);color:var(--academic-navy)}
.btn-gold:hover{background:var(--academic-gold-muted);border-color:var(--academic-gold-muted);color:var(--academic-navy)}
.btn-light{background:transparent;border-color:rgba(255,255,255,.55);color:#fff}
.btn-light:hover{background:rgba(255,255,255,.12);border-color:#fff;color:#fff}
.btn-ghost{background:transparent;border-color:transparent;color:var(--academic-navy);min-height:42px;padding-inline:.7rem}
.btn-ghost:hover{background:var(--surface-elevated);border-color:transparent;color:var(--academic-navy)}
.btn-sm{min-height:36px;padding:.25rem .7rem;font-size:.85rem}
.btn-danger{background:var(--status-error);border-color:var(--status-error)}.btn-danger:hover{background:#7f1c21;border-color:#7f1c21}
.btn:disabled,.btn[aria-disabled=true]{background:var(--status-locked-bg);border-color:var(--status-locked-bg);color:var(--status-locked);cursor:not-allowed}
.card .btn{margin-top:auto}
.card>.btn{margin-top:1.1rem}
.crumb{display:inline-flex;align-items:center;gap:.3rem;color:#c9d4df;text-decoration:none;font-size:.95rem;margin-bottom:.9rem}
.crumb:hover{color:var(--academic-gold-muted)}

/* ---------- 5. surfaces, badges, notes ---------- */
.card{--pad:1.35rem;background:var(--surface-card);border:1px solid var(--line-subtle);border-radius:var(--radius-md);padding:var(--pad);margin-block:1.1rem;box-shadow:var(--shadow-academic)}
.hero{border-inline-start:5px solid var(--academic-gold)}
.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.75rem;margin-top:1rem}
.stat{background:var(--surface-elevated);border-radius:var(--radius-sm);padding:.7rem .9rem}.stat b{display:block;font-family:var(--font-serif);font-size:1.5rem;color:var(--academic-navy)}
.bar{height:10px;background:var(--status-locked-bg);border-radius:99px;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--academic-navy);border-radius:99px;transition:width .6s ease}
.badge{display:inline-flex;align-items:center;gap:.3rem;padding:.15rem .7rem;border-radius:99px;font-size:.85rem;font-weight:600;white-space:nowrap;border:1px solid transparent}
.b-locked{background:var(--status-locked-bg);color:var(--status-locked)}
.b-available{background:var(--surface-elevated);color:var(--academic-navy);border-color:var(--line-subtle)}
.b-in_progress,.badge.b-pending{background:var(--status-pending-bg);color:var(--status-pending)}
.b-completed,.badge.b-active,.badge.b-confirmed,.badge.b-free{background:var(--status-complete-bg);color:var(--status-complete)}
.badge.b-rejected,.badge.b-delivered{background:var(--status-locked-bg);color:var(--status-locked)}
.mini{display:flex;flex-wrap:wrap;gap:.35rem}
.mini span{display:inline-flex;align-items:center;gap:.3rem;font-size:.85rem;padding:.15rem .6rem;border-radius:99px;background:var(--status-locked-bg);color:var(--status-locked)}
.mini span.done{background:var(--status-complete-bg);color:var(--status-complete)}
.note{padding:.6rem .9rem;border-radius:var(--radius-sm);background:var(--surface-elevated);color:var(--text-primary);border-inline-start:4px solid var(--line-subtle)}
.note.ok{background:var(--status-complete-bg);color:var(--status-complete);border-inline-start-color:var(--status-complete);font-weight:600}
.note.warn{background:var(--status-pending-bg);color:var(--status-pending);border-inline-start-color:var(--status-pending)}
.note.err{background:var(--status-error-bg);color:var(--status-error);border-inline-start-color:var(--status-error);font-weight:600}
main>.note{max-width:var(--measure);margin-inline:auto}
.actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.75rem}
.banner p{display:flex;align-items:center;gap:.5rem}
.banner{background:var(--status-complete-bg);border:1px solid var(--status-complete);color:var(--status-complete);font-weight:700}
.pay-box{background:var(--status-pending-bg);border:1px solid #e6c98a;border-radius:var(--radius-sm);padding:.8rem 1rem;margin-block:.75rem}
.pay-box b{font-size:1.15em;direction:ltr;unicode-bidi:isolate}
.price{font-family:var(--font-serif);font-size:1.3rem;font-weight:600;color:var(--academic-navy)}
.price-sale{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.35rem .5rem}
.price-was{color:#8a8f98;font-weight:400;font-size:.95em;text-decoration:line-through}
.sale-badge{background:#c0392b;color:#fff;border-radius:999px;padding:.1rem .6rem;font-size:.75rem;font-weight:600;white-space:nowrap}
.ref-box{margin-top:.8rem;padding:.8rem 1rem;border:1px dashed var(--academic-gold);border-radius:var(--radius-sm);background:var(--status-pending-bg)}
.ref-box p{margin:.3rem 0}.ref-code{font-size:1.3rem;letter-spacing:.06em}
.steps-list,.rules{padding-inline-start:1.3rem;margin:.25rem 0}.steps-list li,.rules li{margin-block:.45rem}
.encourage{font-family:var(--font-serif);font-weight:600;color:var(--academic-navy);font-size:1.1rem;line-height:1.8}

/* ---------- 6. page bands (full-bleed navy title block) ---------- */
main.wrap:has(>.band:first-child){padding-top:0}
.band{position:relative;overflow:hidden;background:var(--academic-navy);color:#fff;margin-inline:calc(50% - 50vw);padding:2rem calc(50vw - 50%) 2.25rem;margin-bottom:1.5rem;border-bottom:1px solid var(--academic-slate)}
.band::after{content:"";position:absolute;inset-inline:0;bottom:0;height:3px;background:linear-gradient(90deg,var(--academic-gold),transparent 70%)}
[dir=rtl] .band::after{background:linear-gradient(270deg,var(--academic-gold),transparent 70%)}
.band h1{color:#fff;margin-bottom:.4rem;max-width:26ch}
.band .byline{color:#c9d4df;margin:0 0 1rem;font-size:1.02rem}
.band .lede{color:#dbe4ec;max-width:var(--measure);margin:.2rem 0 1rem}
.band .hero-actions{margin-top:1.1rem}
.band-row{display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;align-items:center}
.band-meta{display:flex;flex-wrap:wrap;gap:.45rem 1.5rem;margin:.9rem 0 0;padding:0;list-style:none;color:#dbe4ec;font-size:.98rem}
.band-meta li{display:inline-flex;align-items:center;gap:.5rem}.band-meta .ic{color:var(--academic-gold-muted)}
.band-meta b{color:#fff;font-family:var(--font-serif);font-size:1.15rem;font-weight:600}
.band .bar{background:rgba(255,255,255,.18);height:8px}.band .bar i{background:var(--academic-gold)}
.band .progress{max-width:520px;margin-top:1rem}
.band .progress .card-head{color:#dbe4ec;margin-bottom:.35rem}.band .progress b{color:#fff}
.band .badge{border-color:transparent}
.band-stats{display:flex;flex-wrap:wrap;gap:1.8rem;margin-top:1.3rem}
.band-stats div{color:#c9d4df;font-size:.92rem}
.band-stats b{display:block;font-family:var(--font-serif);font-size:1.6rem;font-weight:600;color:#fff;line-height:1.3}
.band-stats .badge{margin-bottom:.15rem}
.guilloche{position:absolute;inset-block:-30%;inset-inline-end:-6%;width:min(560px,70vw);height:auto;aspect-ratio:1;opacity:.5;pointer-events:none;color:var(--academic-gold)}
.guilloche ellipse{fill:none;stroke:currentColor;stroke-width:.6;opacity:.55}
.band>*:not(.guilloche){position:relative}

/* stepper (lecture page) */
.steps{list-style:none;padding:0;margin:1.1rem 0 0;display:flex;gap:0;flex-wrap:wrap;counter-reset:none}
.steps li{display:flex;align-items:center;gap:.55rem;padding:.4rem .9rem .4rem .4rem;color:#c9d4df;font-weight:600}
[dir=rtl] .steps li{padding:.4rem .4rem .4rem .9rem}
.steps li .ic{width:2rem;height:2rem;padding:.45rem;border-radius:50%;border:2px solid rgba(255,255,255,.45)}
.steps li+li{position:relative;margin-inline-start:1.4rem}
.steps li+li::before{content:"";position:absolute;inset-inline-start:-1.5rem;top:50%;width:1.2rem;border-top:2px solid rgba(255,255,255,.35)}
.steps li.done{color:#fff}.steps li.done .ic{background:var(--academic-gold);border-color:var(--academic-gold);color:var(--academic-navy)}
.steps li.done+li::before{border-color:var(--academic-gold)}

/* ---------- 7. home ---------- */
.hero-home{padding-block:3rem 3.4rem}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:2rem;align-items:center}
.hero-home h1{font-size:clamp(2.2rem,5.5vw,3.7rem);line-height:1.08;max-width:14ch;margin-bottom:.7rem}
html[dir=rtl] .hero-home h1{line-height:1.35}
.hero-home .lede{font-family:var(--font-serif);font-size:1.3rem;color:#e6edf3;margin-bottom:.4rem}
.hero-home .ypo{color:#aebdcb;font-size:.95rem;margin-bottom:1.6rem}
.hero-actions{display:flex;gap:.7rem;flex-wrap:wrap}
.seal-stage{position:relative;display:grid;place-items:center;aspect-ratio:1;max-width:340px;margin-inline:auto;width:100%}
.seal-stage .guilloche{position:absolute;inset:0;width:100%;height:100%;opacity:.9}
.hero-logo{position:relative;width:52%;height:auto;aspect-ratio:1;border-radius:50%;box-shadow:0 0 0 4px var(--academic-gold),0 0 0 10px rgba(197,155,39,.25),var(--shadow-float);background:#fff}
@media (prefers-reduced-motion:no-preference){
  .hero-home .guilloche{animation:inscribe 1.4s ease-out both}
  @keyframes inscribe{from{opacity:0;transform:rotate(-14deg) scale(.92)}to{opacity:.9;transform:none}}
}
.section-title{margin:2.4rem 0 .4rem;font-size:1.7rem}
.section-lede{color:var(--text-secondary);margin:0 0 1.1rem;max-width:var(--measure)}
.catalog{display:flex;flex-direction:column;gap:1rem}
.course-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem 2rem;align-items:center;background:var(--surface-card);border:1px solid var(--line-subtle);border-inline-start:5px solid var(--academic-navy);border-radius:var(--radius-md);padding:1.3rem 1.5rem;box-shadow:var(--shadow-academic)}
.course-row h3{font-size:1.5rem;margin-bottom:.15rem}
.course-row .byline{margin:0 0 .5rem;color:var(--text-muted);font-size:.95rem}
.course-row .desc{margin:0 0 .7rem;color:var(--text-secondary);max-width:var(--measure);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.course-row .facts{display:flex;flex-wrap:wrap;gap:.35rem 1.3rem;color:var(--text-secondary);font-size:.95rem;align-items:center}
.course-row .facts span{display:inline-flex;align-items:center;gap:.4rem}
.course-row .side{display:flex;flex-direction:column;gap:.6rem;align-items:stretch;min-width:180px}
.course-row .side .btn{margin:0}
.course-row .progress{min-width:180px}
.course-row .progress .card-head{font-size:.92rem;margin-bottom:.3rem}
.join-steps{list-style:none;margin:1rem 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem;counter-reset:j}
.join-steps li{counter-increment:j;position:relative;background:var(--surface-card);border:1px solid var(--line-subtle);border-radius:var(--radius-md);padding:1.2rem 1.2rem 1.2rem;box-shadow:var(--shadow-academic)}
.join-steps li::before{content:counter(j);display:grid;place-items:center;width:2.2rem;height:2.2rem;margin-bottom:.6rem;border-radius:50%;background:var(--academic-navy);color:var(--academic-gold-muted);font-family:var(--font-serif);font-size:1.15rem;font-weight:600}
.join-steps li bdi,.join-steps li span{display:block}
.contact-line{margin-top:1.2rem}

/* ---------- 8. course page ---------- */
.course-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:2rem;align-items:start}
.course-main>*:first-child{margin-top:0}
.prose{max-width:var(--measure);font-family:var(--font-serif);font-size:1.1rem;line-height:1.75;color:var(--text-primary)}
html[dir=rtl] .prose{line-height:2}
.panel{position:sticky;top:5.2rem}
.panel .card{margin-top:0;border-top:4px solid var(--academic-gold)}
.panel h2{font-size:1.25rem}
.syllabus{list-style:none;padding:0;margin:.8rem 0 0;border-top:1px solid var(--line-subtle)}
.syllabus li{display:grid;grid-template-columns:2.6rem minmax(0,1fr);gap:.4rem 1rem;padding:.95rem 0;border-bottom:1px solid var(--line-subtle)}
.syllabus .n{font-family:var(--font-serif);font-size:1.6rem;font-weight:600;line-height:1.1;color:var(--academic-gold-deep);text-align:center}
.syllabus b{font-family:var(--font-serif);font-size:1.1rem;color:var(--academic-navy);font-weight:600}
.syllabus .muted{margin-top:.15rem;font-size:.97rem}
.lock-note{display:flex;align-items:center;gap:.5rem;margin-top:1rem}

/* ---------- 9. learning ledger (learn + dashboard) ---------- */
.ledger{display:flex;flex-direction:column;gap:.8rem}
.lec{display:grid;grid-template-columns:3.2rem minmax(0,1fr) auto;gap:1rem 1.2rem;align-items:center;background:var(--surface-card);border:1px solid var(--line-subtle);border-radius:var(--radius-md);padding:1rem 1.3rem;box-shadow:var(--shadow-academic)}
.lec .plate{display:grid;place-items:center;width:3.2rem;height:3.2rem;border-radius:50%;background:var(--surface-elevated);border:2px solid var(--line-subtle);font-family:var(--font-serif);font-size:1.4rem;font-weight:600;color:var(--academic-navy)}
.lec.is-completed .plate{background:var(--status-complete-bg);border-color:var(--status-complete);color:var(--status-complete)}
.lec.is-in_progress .plate,.lec.is-available .plate{border-color:var(--academic-gold);color:var(--academic-navy)}
.lec.is-locked{background:var(--bg-parchment);box-shadow:none}.lec.is-locked .plate{color:var(--status-locked)}
.lec h2{font-size:1.2rem;margin-bottom:.4rem}
.lec.is-locked h2{color:var(--status-locked)}
.lec .info{min-width:0}
.lec .note{margin:.6rem 0 0}
.lec .side{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;justify-content:flex-end}
.lec .side .btn{margin:0;min-width:150px}
.lec.final{border-inline-start:5px solid var(--academic-gold);background:linear-gradient(0deg,#fff,#fff)}
.lec.final .plate{background:var(--academic-navy);border-color:var(--academic-navy);color:var(--academic-gold-muted)}
.lec.final.is-locked .plate{background:var(--status-locked-bg);border-color:var(--status-locked-bg);color:var(--status-locked)}
.lec.final h2{display:block}

/* ---------- 10. lecture and video ---------- */
.video-wrap{position:relative;aspect-ratio:16/9;background:#06121d;border-radius:var(--radius-sm);overflow:hidden;width:100%;box-shadow:var(--shadow-float)}
.video-wrap:fullscreen{border-radius:0;aspect-ratio:auto;width:100vw;height:100vh;padding-bottom:0}
.video-wrap:-webkit-full-screen{border-radius:0;aspect-ratio:auto;width:100vw;height:100vh;padding-bottom:0}
.video-wrap iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.form-frame{width:100%;height:min(85vh,900px);min-height:560px;border:1px solid var(--line-subtle);border-radius:var(--radius-sm);background:#fff}
.frame-holder:empty{display:none}
.lecture-grid{display:flex;flex-direction:column}
.lecture-grid>.card:first-child{margin-top:0}
.flow{display:none}

/* ---------- 11. forms ---------- */
.form-card{max-width:460px;margin:2.5rem auto;padding:0;overflow:hidden}
.form-head{background:var(--academic-navy);color:#fff;text-align:center;padding:1.8rem 1.5rem 1.5rem;border-bottom:3px solid var(--academic-gold)}
.form-head h1{color:#fff;font-size:1.6rem;margin:.9rem 0 .3rem}.form-head p{color:#c9d4df;margin:0}
.form-head img{width:84px;height:84px;border-radius:50%;box-shadow:0 0 0 3px var(--academic-gold),0 0 0 8px rgba(197,155,39,.25)}
.form-body{padding:.6rem 1.5rem 1.6rem}
.form-body>.note{margin-top:1rem}
label{display:block;font-weight:600;margin:.95rem 0 .3rem;color:var(--text-primary)}
input[type=text],input[type=password],input[type=number],textarea,select{width:100%;min-height:48px;padding:.6rem .8rem;border:1.5px solid #b7c3cf;border-radius:var(--radius-sm);font:inherit;background:#fff;color:var(--text-primary)}
input:focus,textarea:focus,select:focus{border-color:var(--academic-navy);outline:none;box-shadow:0 0 0 3px rgba(197,155,39,.45)}
.form-body .btn,form>.btn,.card form>.btn{width:100%;margin-top:1.1rem}
.panel form .btn,.panel .btn{width:100%}
.landing{text-align:center;padding-block:3rem}.landing .btn{width:auto;min-width:200px}
.radio-card{display:flex;gap:.7rem;align-items:flex-start;border:1.5px solid var(--line-subtle);border-radius:var(--radius-sm);padding:.75rem .9rem;margin-block:.5rem;cursor:pointer;font-weight:600}
.radio-card input{width:22px;height:22px;margin-top:.15rem;flex:none;accent-color:var(--academic-navy)}
.radio-card:has(input:checked){border-color:var(--academic-navy);background:var(--surface-elevated)}
.code-row{display:flex;gap:.5rem;align-items:stretch}
.form-card .code-row input{flex:1 1 0;width:auto;min-width:0}
.form-card .code-row .btn{flex:0 0 auto;width:auto;min-width:5.5rem;margin-top:0;padding-inline:.9rem}
.name-box{margin:.6rem 0}.name-box p{margin:.3rem 0}.name-actions{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:.6rem}.name-actions .btn{flex:1 1 140px;margin-top:0;width:auto}
.hero-actions .btn,.actions .btn{width:auto}

/* legal prose */
.legal{max-width:76ch;margin-inline:auto;padding:2rem 2.2rem}
.legal h1{margin-bottom:.3rem}
.legal h2{margin-top:1.8rem;font-size:1.2rem;display:block}
.legal p{font-family:var(--font-serif);font-size:1.07rem;line-height:1.75}
html[dir=rtl] .legal p{line-height:2}

/* ---------- 12. quizzes and exam ---------- */
fieldset.q,div.q{border:1px solid var(--line-subtle);border-radius:var(--radius-md);padding:1rem 1.1rem;margin-block:1rem;min-inline-size:0;background:var(--surface-card)}
fieldset.q legend{padding:0;width:100%;float:none}
.qn{font-family:var(--font-serif);font-weight:600;color:var(--academic-gold-deep);font-size:.98rem}
.qt{font-family:var(--font-serif);font-weight:600;font-size:1.12rem;margin-block:.25rem .6rem;line-height:1.75;color:var(--academic-navy)}
.opt{display:flex;gap:.6rem;align-items:flex-start;border:1.5px solid var(--line-subtle);border-radius:var(--radius-sm);padding:.65rem .8rem;margin-block:.45rem;cursor:pointer;min-height:48px;font-weight:400;transition:border-color .12s,background-color .12s}
.opt:hover{border-color:var(--academic-slate)}
.opt:has(input:checked){border-color:var(--academic-navy);background:var(--surface-elevated);box-shadow:inset 3px 0 0 var(--academic-gold)}
[dir=rtl] .opt:has(input:checked){box-shadow:inset -3px 0 0 var(--academic-gold)}
.opt input{width:22px;height:22px;flex:none;margin-top:.1rem;accent-color:var(--academic-navy)}
.opt .mark{width:22px;flex:none;text-align:center;font-weight:700}
.opt .ol{font-weight:700;flex:none;min-width:1.4rem;direction:ltr;font-family:var(--font-serif);color:var(--academic-gold-deep)}
.opt .ot{flex:1}
.opt.correct{border-color:var(--status-complete);background:var(--status-complete-bg);box-shadow:none}.opt.correct .mark{color:var(--status-complete)}
.opt.wrong{border-color:var(--status-error);background:var(--status-error-bg);box-shadow:none}.opt.wrong .mark{color:var(--status-error)}
.explain{background:var(--surface-elevated);border-radius:var(--radius-sm);padding:.7rem .9rem;margin:.6rem 0 0}
.result{display:flex;flex-direction:column;gap:.25rem;border-radius:var(--radius-md);padding:1rem 1.2rem;margin-block:.6rem}
.result.pass{background:var(--status-complete-bg);color:var(--status-complete);border:1px solid var(--status-complete)}
.result.fail{background:var(--status-pending-bg);color:var(--status-pending);border:1px solid #e6c98a}.result b{font-family:var(--font-serif);font-size:1.3rem}
.no-copy,.no-copy *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
@media print{.no-copy{display:none!important}}
.exam-box:fullscreen{background:var(--bg-parchment);overflow:auto;padding:1rem;width:100%;height:100%;box-sizing:border-box}
.exam-box:-webkit-full-screen{background:var(--bg-parchment);overflow:auto;padding:1rem;width:100%;height:100%;box-sizing:border-box}
.exam-pseudo{position:fixed;inset:0;z-index:60;background:var(--bg-parchment);overflow:auto;max-width:100vw;padding:1rem;padding-top:calc(1rem + env(safe-area-inset-top));box-sizing:border-box}

/* video full screen on iPhone (own black bar with the close button ABOVE the player so it never covers the controls) */
.fs-close{display:none;position:absolute;z-index:3;top:calc(4px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left));width:44px;height:44px;border-radius:50%;border:2px solid #fff;background:rgba(0,0,0,.65);color:#fff;font-size:1.2rem;cursor:pointer}
.video-wrap.pseudo-fs .fs-close{display:block}
.card .video-wrap.pseudo-fs,.video-wrap.pseudo-fs{position:fixed;inset:0;z-index:50;width:100vw;max-width:100vw;height:100vh;height:100dvh;margin:0;padding:0;border-radius:0;aspect-ratio:auto;background:#000}
.video-wrap.pseudo-fs iframe{inset:calc(52px + env(safe-area-inset-top)) 0 0 0;height:auto}
.no-scroll{overflow:hidden}

/* ---------- 13. admin ---------- */
.tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-block:1rem}
.tabs .btn[aria-pressed=true]{background:var(--academic-navy);border-color:var(--academic-navy);color:#fff}
.tabs .btn[aria-pressed=false]{background:var(--surface-card);color:var(--academic-navy)}
.tbl-wrap{overflow-x:auto;border:1px solid var(--line-subtle);border-radius:var(--radius-sm)}
table{border-collapse:collapse;width:100%;font-size:.92rem;background:#fff}
th,td{padding:.55rem .7rem;border-bottom:1px solid var(--line-subtle);text-align:start;vertical-align:middle}
th{background:var(--surface-elevated);color:var(--academic-navy);white-space:nowrap;font-weight:700}
tbody tr:hover td{background:var(--bg-parchment)}
.row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:flex-end}.row>*{flex:1 1 140px}.row .btn{flex:0 0 auto;margin:0;width:auto}
textarea.codes{min-height:160px;font-family:ui-monospace,Consolas,monospace}
fieldset.lang-box{border:1px solid var(--line-subtle);border-radius:var(--radius-sm);padding:.6rem .8rem .8rem;margin:.8rem 0;min-inline-size:0}
.lang-box legend{font-weight:700;padding:0 .4rem;font-family:var(--font-serif)}
details.sub{padding:.7rem 1rem}details.sub>summary{cursor:pointer;font-weight:700;padding:.35rem 0;font-family:var(--font-serif);color:var(--academic-navy)}
details.sub details.sub{box-shadow:none;border:1px solid var(--line-subtle);margin:.6rem 0}
.inner{margin-top:.5rem}.inner label{display:block;margin-top:.7rem;font-weight:600}.inner h3{margin:1.2rem 0 .3rem}
.quiz-text{width:100%;min-height:22rem;line-height:1.7;margin:.6rem 0}
.qexample{white-space:pre-wrap;background:var(--surface-elevated);border-radius:var(--radius-sm);padding:.8rem 1rem;margin:.5rem 0;direction:ltr;text-align:left;overflow-x:auto}
.qprev{padding-inline-start:1.3rem}.qprev>li{margin:.9rem 0}
.qopts{list-style:none;margin:.3rem 0;padding-inline-start:.6rem}.qopts li.ok{color:var(--status-complete);font-weight:700}
.qerr li{color:var(--status-error);margin:.3rem 0}.inline-check{display:flex;gap:.5rem;align-items:flex-start;font-weight:600}.inline-check input{width:auto;margin-top:.3rem}
td.ltr,td.nowrap,.btn-sm{white-space:nowrap}
.inner input::placeholder,.inner textarea::placeholder{color:#6b7785;opacity:1}

/* ---------- 14. responsive and motion ---------- */
@media (max-width:900px){
  .course-layout{grid-template-columns:minmax(0,1fr)}
  .panel{position:static}
  .hero-grid{grid-template-columns:minmax(0,1fr)}
  .seal-stage{max-width:220px;order:-1;margin-inline:0}
  .hero-home{padding-block:2rem 2.4rem}
  .foot-grid{grid-template-columns:1fr 1fr}.foot-grid>:first-child{grid-column:1/-1}
  .course-row{grid-template-columns:minmax(0,1fr)}.course-row .side{flex-direction:row;flex-wrap:wrap;align-items:center}.course-row .side .btn{flex:1 1 160px}
}
@media (max-width:700px){
  .card{--pad:1rem}
  .lec{grid-template-columns:2.6rem minmax(0,1fr);padding:.9rem 1rem}
  .lec .plate{width:2.6rem;height:2.6rem;font-size:1.15rem}
  .lec .side{grid-column:1/-1;justify-content:space-between}.lec .side .btn{flex:1 1 150px}
  .legal{padding:1.2rem 1.1rem}
  /* The Drive player lays itself out at the FULL SCREEN width, so on phones the frame spans the whole screen width
     (otherwise its right side is cut off). Height = 16:9 picture + ~96px for Drive's control bar. */
  .card .video-wrap{aspect-ratio:auto;padding:0;height:calc(56.25vw + 96px);width:100vw;max-width:100vw;margin-inline:calc(50% - 50vw);border-radius:0}
  .card .video-wrap.yt{height:56.25vw}
  .card .video-wrap.pseudo-fs{height:100vh;height:100dvh}
  .form-frame{height:78vh;min-height:520px}
}
@media (max-width:560px){
  html{font-size:16px}
  .wrap{padding:.85rem}
  .brand span{font-size:1rem;line-height:1.15;white-space:normal;overflow:visible;text-overflow:clip}
  .tools .tool span{display:none}
  .tools .tool{min-width:44px;padding-inline:.5rem}
  .band{padding-block:1.5rem 1.7rem}
  .actions .btn,.hero-actions .btn{flex:1 1 100%}
  .row>*{flex-basis:100%}
  .foot-grid{grid-template-columns:1fr}
  .steps li{padding-inline-end:.5rem}
  .steps li+li{margin-inline-start:1.1rem}.steps li+li::before{inset-inline-start:-1.2rem;width:1rem}
  .form-card{margin-block:1rem}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* certificate verification page */
.verify{max-width:640px}.verify h1{font-family:var(--font-serif)}
.vform{display:flex;gap:.6rem;flex-wrap:wrap;margin:1rem 0}.vform input{flex:1 1 220px;min-width:0;padding:.7rem .8rem;border:1px solid var(--line-subtle);border-radius:var(--radius-md);font:inherit;letter-spacing:.04em;text-transform:uppercase}
.vres h2{margin-top:0}.v-ok{border-inline-start:5px solid var(--status-complete)}.v-ok h2{color:var(--status-complete)}.v-bad{border-inline-start:5px solid var(--status-locked)}.v-bad h2{color:var(--status-locked)}
.vrows{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:0}.vrows dt{color:var(--text-muted,#5a6a7a)}.vrows dd{margin:0;font-weight:600}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* generated certificate view / print */
.certbar{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}.certbar p{flex-basis:100%;margin:.2rem 0}
.cert-sheet{max-width:1123px;margin:.5rem auto 2rem;padding:0 1rem}.cert-sheet svg{display:block;width:100%;height:auto;box-shadow:0 10px 30px rgba(10,30,50,.18);background:#fff}
@media print{@page{size:A4 landscape;margin:0}.noprint{display:none!important}body.certpage{background:#fff}.cert-sheet{max-width:none;margin:0;padding:0}.cert-sheet svg{width:297mm;height:210mm;box-shadow:none;page-break-inside:avoid}}

/* Instagram story shortcut */
.share-card .row{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.8rem}
.share-card h2{display:flex;align-items:center;gap:.5rem}
.share-card .share-file[hidden]{display:none}
.share-thumb{max-width:min(100%,260px);max-height:420px;border:1px solid var(--line-subtle);border-radius:var(--radius-md);display:block}

/* pictures inside quiz questions + "Part n" labels for lectures with several videos */
.qimg{display:block;max-width:min(100%,560px);height:auto;margin:.2rem auto .9rem;border:1px solid #d9d4c7;border-radius:6px;background:#fff}
.part-label{margin:.9rem 0 .4rem;font-size:1rem}
.video-extra .video-wrap{margin-bottom:.8rem}

/* story shortcut: keep everything inside the screen (RTL phones) */
.share-card{min-width:0;max-width:100%;overflow-wrap:anywhere}
.share-card svg{width:1.3em;height:1.3em;flex:none}
.share-card h2{flex-wrap:nowrap}
.share-steps{display:flex;flex-direction:column;gap:.65rem;margin-top:.9rem}
.share-steps .btn{width:100%;margin-top:0;white-space:normal;text-align:center}

/* ---- guest upgrade: "keep your progress" bar, course picker, list of progress that is kept ---- */
.guest-bar{background:var(--status-pending-bg);border-bottom:1px solid #e6c98a}
.guest-bar-in{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding-block:.6rem}
.guest-bar p{margin:0;flex:1 1 18rem;color:var(--text-primary);font-size:.95rem}
.guest-bar-x{background:none;border:0;font-size:1.5rem;line-height:1;cursor:pointer;color:var(--text-secondary);min-width:44px;min-height:44px}
.course-pick{border:0;padding:0;margin:0 0 1rem;min-width:0}
.course-pick legend{font-weight:700;margin-bottom:.5rem;padding:0}
.pick{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .75rem;padding:.7rem .9rem;margin-bottom:.5rem;border:1px solid var(--line-subtle);border-radius:var(--radius-md);background:var(--surface-card);cursor:pointer}
.pick.on{border-color:var(--academic-gold);box-shadow:0 0 0 2px var(--academic-gold-muted)}
.pick:focus-within{outline:2px solid var(--academic-navy);outline-offset:2px}
.pick input{flex:none;margin:0}
.pick-t{flex:1 1 12rem;font-weight:600}
.pick-p{flex:0 1 auto}
@media (max-width:480px){.pick-p{flex-basis:100%;padding-inline-start:2rem}}
.kept-list{list-style:none;margin:0;padding:0}
.kept-list li{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid var(--line-subtle)}

/* Admin -> Courses -> Discount: the "last day" date box looks like the other inputs */
input[type=date]{width:100%;min-height:48px;padding:.6rem .8rem;border:1.5px solid #b7c3cf;border-radius:var(--radius-sm);font:inherit;background:#fff;color:var(--text-primary)}

/* discount: "until 31 Oct 2026" next to the badge */
.sale-ends{font-size:.8rem;font-weight:600;color:inherit;opacity:.9;white-space:nowrap}
.share-result{margin:12px 0}
.rs-name{margin-bottom:10px}.rs-name label{display:block}

.ins-list{list-style:none;margin:0;padding:0}.ins-list li{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-subtle)}.ins-list li:last-child{border-bottom:0}.ins-list .main{min-width:0;overflow-wrap:anywhere}.ins-list .side{text-align:end;white-space:nowrap}.ins-list small{display:block;color:var(--text-muted);margin-top:2px}
