/* Palette and type taken from hypemedia.co.il/course2.html */
:root {
  --bg: #0A0706;
  --card: #151110;
  --card-2: #1E1816;
  --line: #2E2522;
  --line-2: #5A4F4A;
  --fg: #F7F3F0;
  --mute: #B4ABA6;
  --orange: #E85D2F;
  --orange-t: #F47346;
  --violet: #7A63FF;
  --rec: #FF3B30;
  --green: #2ED47A;
  --err: #FF4B4B;
  --ink: #120604;           /* text on orange */
  --spring: cubic-bezier(.2, 1.1, .3, 1);
  --display: 'Secular One', 'Heebo', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); color-scheme: dark; }
body {
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--fg); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow-x: hidden;
}
::selection { background: var(--orange); color: var(--ink); }
a { color: var(--orange-t); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--orange-t); outline-offset: 3px; border-radius: 6px; }
h1 { font-weight: 700; font-size: clamp(32px, 6vw, 48px); line-height: 1.12; letter-spacing: -.03em; margin: .15em 0 .5em; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 1.6em 0 .7em; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .9em; letter-spacing: -.01em; }
code { background: var(--card-2); padding: .1em .4em; border-radius: 6px; font-size: .86em; }
.muted { color: var(--mute); }
.small { font-size: .85rem; }
.o-t { color: var(--orange-t); }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--mute); letter-spacing: .06em; }

/* ---------- background: orange glow + rings + embers ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#embers { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-glow {
  position: absolute; left: 50%; bottom: -38%; width: max(1500px, 150vw); height: 900px; transform: translateX(-50%); z-index: -1;
  background:
    radial-gradient(ellipse 50% 46% at 50% 62%, rgba(232,93,47,.40), rgba(232,93,47,.08) 58%, transparent 76%),
    repeating-radial-gradient(circle at 50% 100%, transparent 0 46px, rgba(255,255,255,.035) 46px 47px);
}

/* ---------- brand ---------- */
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.01em; direction: ltr; display: inline-flex; align-items: center; gap: 8px; color: var(--fg); }
.logo.big { font-size: 26px; margin-bottom: 18px; }
.rec { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: rec 2.4s steps(1, end) infinite; }
@keyframes rec { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }

/* selection box with handles, like the site's hero */
.sel { position: relative; display: inline-block; padding: 0 .14em; line-height: 1.1; margin-inline: .04em; border: 1.5px solid var(--orange); background: rgba(232,93,47,.16); color: #FFE7DD; }
.sel .h { position: absolute; width: 7px; height: 7px; background: #fff; border: 1.5px solid var(--orange); }
.h.a { top: -4px; right: -4px } .h.b { top: -4px; left: -4px } .h.c { bottom: -4px; right: -4px } .h.d { bottom: -4px; left: -4px }

/* ---------- layout ---------- */
main { width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 20px 70px; flex: 1; }
main.wide { max-width: 1200px; }
.foot { text-align: center; color: var(--mute); font-size: .82rem; padding: 22px; border-top: 1px solid var(--line); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 0 24px; min-height: 68px; position: sticky; top: 0; z-index: 10;
  background: rgba(10,7,6,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand-sub { color: var(--mute); font-size: .88rem; font-weight: 500; padding-inline-start: 12px; border-inline-start: 1px solid var(--line-2); }
.tag { font-style: normal; font-size: .75rem; background: var(--orange); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .95rem; }
.top nav a { color: var(--mute); padding: 6px 12px; border-radius: 10px; font-weight: 500; transition: .15s; }
.top nav a:hover { color: var(--fg); background: var(--card-2); text-decoration: none; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--mute); font: inherit; font-weight: 500; cursor: pointer; padding: 6px 12px; }
button.link:hover { color: var(--orange-t); }

/* ---------- auth ---------- */
.auth { display: grid; place-items: center; min-height: 76vh; }
.auth-card {
  width: 100%; max-width: 420px; text-align: center; padding: 38px 30px 28px;
  background: var(--card); border-radius: 24px; box-shadow: 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.55), 0 -20px 90px rgba(232,93,47,.12);
  animation: up .7s var(--spring) both;
}
.auth-card h1 { font-size: clamp(30px, 7vw, 40px); margin-bottom: .35em; }
.auth-card form { text-align: start; margin: 24px 0 12px; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.narrow { max-width: 420px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .92rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; gap: 16px; flex-wrap: wrap; }
legend { font-size: .92rem; font-weight: 500; padding: 0 6px; }
input, select, textarea {
  font: inherit; color: var(--fg); min-height: 50px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); min-width: 0; transition: border-color .15s;
}
textarea { min-height: 0; resize: vertical; width: 100%; }
input::placeholder, textarea::placeholder { color: #6A615C; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange-t); }
input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; min-height: 0; }
input[type=file] { padding: 8px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; background: var(--card-2); color: var(--fg); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 12px; margin-inline-end: 10px; cursor: pointer; }

/* buttons: outlined orange → filled on hover (same as the site) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  font: inherit; font-weight: 700; padding: 8px 24px; border-radius: 14px; cursor: pointer; white-space: nowrap;
  border: 2px solid var(--line-2); background: transparent; color: var(--fg);
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--spring), box-shadow .2s;
}
.btn:hover { text-decoration: none; border-color: var(--orange); }
.btn:active { transform: scale(.98); }
.btn.primary { border: 2.5px solid var(--orange); background: rgba(232,93,47,.06); }
.btn.primary:hover { background: var(--orange); color: var(--ink); transform: translateY(-2px); }
form .btn.primary, .btn.solid { background: var(--orange); color: var(--ink); }
form .btn.primary:hover, .btn.solid:hover { background: #FF7A45; }
.btn.glow { margin-top: 8px; box-shadow: 0 12px 30px rgba(232,93,47,.2); animation: hop 2.8s ease-in-out infinite; }
.btn.glow:hover { background: var(--orange); color: var(--ink); box-shadow: 0 14px 40px rgba(232,93,47,.55); animation-play-state: paused; }
@keyframes hop { 50% { transform: translateY(-5px) } }
.btn.danger { color: #FF9A8C; border-color: rgba(255,75,75,.4); }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.sm { min-height: 0; padding: 6px 12px; font-size: .85rem; border-radius: 9px; border-width: 1.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.flash { background: rgba(232,93,47,.1); border: 1px solid rgba(232,93,47,.4); padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.flash.ok { background: rgba(46,212,122,.08); border-color: rgba(46,212,122,.4); }
.flash.err { background: rgba(255,75,75,.08); border-color: rgba(255,75,75,.45); color: #FF9A8C; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: 20px; padding: 24px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.title-input { font-weight: 700; font-size: 1.05rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- student dashboard ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: 12px 0 34px; animation: up .7s var(--spring) both; }
.hero-text { flex: 1; }
.hero-text p { max-width: 46ch; font-size: 1.05rem; }
h1.hello { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; line-height: 1.3; }
.progress-ring {
  --p: 0; width: 150px; height: 150px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--card-2) 0);
  box-shadow: 0 0 70px -12px rgba(232,93,47,.6);
}
.pr-inner { width: 128px; height: 128px; border-radius: 50%; background: var(--bg); display: grid; place-content: center; text-align: center; }
.pr-inner b { font-size: 2.1rem; font-weight: 800; line-height: 1; direction: ltr; letter-spacing: -.03em; }
.pr-inner span { color: var(--mute); font-size: .8rem; margin-top: 4px; }

.section-label { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.section-label span { font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.section-label i { flex: 1; height: 1px; background: var(--line); }
.section-label b { font-weight: 600; color: var(--orange-t); font-size: .9rem; }

.lessons { display: flex; flex-direction: column; gap: 12px; }
.lesson-card {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px; background: var(--card); border-radius: 18px; color: var(--fg);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s, transform .25s var(--spring), background .2s;
  animation: up .6s var(--spring) both; animation-delay: var(--d, 0ms);
}
.lesson-card:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--orange); transform: translateY(-2px); }
.lesson-num { position: relative; width: 62px; height: 62px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.3px solid var(--orange-t); }
.lesson-num b { font-size: 1.35rem; font-weight: 700; direction: ltr; }
.lesson-card.seen .lesson-num { border-color: var(--green); color: var(--green); }
.lesson-card.pending .lesson-num { border-color: var(--line-2); color: var(--mute); }
.lesson-body { flex: 1; min-width: 0; }
.lesson-title { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.lesson-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--mute); font-size: .86rem; margin-top: 3px; }
.play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: var(--ink); transition: transform .25s var(--spring), background .2s; }
.lesson-card.has-video:hover .play { background: var(--orange); transform: scale(1.1); }
.lesson-card.pending { opacity: .6; }
.lesson-card.pending .play { background: var(--card-2); color: var(--mute); }

.pill { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgba(232,93,47,.14); color: var(--orange-t); white-space: nowrap; }
.pill.dim { background: var(--card-2); color: var(--mute); font-weight: 500; }
.pill.ok { background: rgba(46,212,122,.12); color: var(--green); }
.pill.err { background: rgba(255,75,75,.12); color: #FF9A8C; }

@keyframes up { from { opacity: 0; transform: translateY(20px); } }

/* ---------- lesson page ---------- */
.back { display: inline-block; margin-bottom: 14px; font-size: .92rem; color: var(--mute); font-weight: 500; }
.back:hover { color: var(--fg); text-decoration: none; }
.lesson-head h1 { margin-top: .1em; }
.player { border-radius: 14px; overflow: hidden; background: #141212; margin-bottom: 18px; box-shadow: 0 0 0 1px #342b27, 0 -20px 90px rgba(232,93,47,.25); }
.win-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding-inline: 14px; background: #1b1716; direction: ltr; }
.win-bar > i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.win-bar > i:nth-child(2) { background: #FEBC2E; } .win-bar > i:nth-child(3) { background: #28C840; }
.win-bar span { flex: 1; margin-inline: 12px 40px; background: #2a2321; border-radius: 6px; font-size: 12.5px; line-height: 22px; color: var(--mute); text-align: center; display: flex; align-items: center; justify-content: center; gap: 7px; letter-spacing: .04em; overflow: hidden; white-space: nowrap; }
.win-bar .rec { width: 7px; height: 7px; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.empty { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; color: var(--mute); position: relative; background: radial-gradient(circle at 50% 42%, #3b2a24, #120d0c); }
.player.empty p { margin: 0; font-weight: 600; font-size: 1.1rem; color: #E8E1DC; }
.rec-top { position: absolute; top: 12px; left: 14px; direction: ltr; display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #fff; }
.rec-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: rec 1.6s steps(1, end) infinite; }
.prose { color: #DDD6D1; }
.files { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.files li { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s; }
.files li:hover { box-shadow: inset 0 0 0 1px var(--orange); }
.files a { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); font-weight: 500; }
.file-ico { font-size: .7rem; font-weight: 800; padding: 6px 7px; border-radius: 8px; background: var(--orange); color: var(--ink); letter-spacing: .04em; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.pager-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 18px; background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 1px transparent; transition: .2s; }
.pager-card span { color: var(--orange-t); font-size: .85rem; font-weight: 600; }
.pager-card b { font-size: 1.1rem; }
.pager-card.next { text-align: left; }
.pager-card:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--orange); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: 20px; padding: 20px 22px; color: var(--fg); display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px transparent; transition: .2s; }
.stat:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--orange); }
.stat b { font-size: 2.6rem; font-weight: 800; line-height: 1.05; letter-spacing: -.04em; color: var(--orange-t); }
.stat span { color: var(--mute); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: start; font-weight: 500; color: var(--mute); font-size: .82rem; border-bottom: 1px solid var(--line); padding: 8px; }
td { border-bottom: 1px solid var(--line); padding: 11px 8px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .5; }
td a { color: var(--fg); }
.card:has(table.users) { overflow-x: auto; }
.add-lesson { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.small-form { margin-top: 14px; }
.uploader { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.progress { position: relative; height: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--orange); transition: width .3s; }
.progress .pct { position: relative; display: block; text-align: center; font-size: .82rem; font-weight: 700; line-height: 28px; }
details summary { cursor: pointer; color: var(--orange-t); margin: 8px 0; font-weight: 500; }
.creds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cred-head { display: flex; flex-direction: column; margin-bottom: 8px; }
.pw { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; font-weight: 700; background: var(--bg); border: 1.5px solid var(--orange); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; text-align: center; letter-spacing: .08em; }
.cred textarea { font-size: .85rem; margin-bottom: 8px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 20px 16px 60px; }
  .top { padding: 8px 14px; min-height: 0; }
  .top nav { gap: 0; font-size: .9rem; }
  .top nav a { padding: 6px 9px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .progress-ring { width: 112px; height: 112px; }
  .pr-inner { width: 94px; height: 94px; }
  .pr-inner b { font-size: 1.6rem; }
  .lesson-card { padding: 15px 14px; gap: 13px; }
  .lesson-num { width: 50px; height: 50px; }
  .lesson-num b { font-size: 1.1rem; }
  .play { width: 42px; height: 42px; }
  .pager { grid-template-columns: 1fr; }
  .win-bar span { margin-inline: 8px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
