/* ============ Capital Market Institute — gaya ============ */
:root {
  --bg: #0b0f17;
  --bg-2: #0f1420;
  --panel: #121827;
  --panel-2: #182033;
  --line: #1e2638;
  --line-2: #2a3448;
  --text: #e7eaf0;
  --muted: #949cb0;
  --dim: #7f889e;
  --green: #089981;
  --green-hi: #12b896;
  --red: #f23645;
  --blue: #2962ff;
  --cyan: #38bdf8;
  --amber: #f5a524;
  --gutter: clamp(16px, 4vw, 48px);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --bg-rgb: 11, 15, 23;
  --panel-rgb: 18, 24, 39;
  --shadow: rgba(0, 0, 0, .8);
  --backdrop: rgba(5, 8, 13, .72);
  color-scheme: dark;
}

/* ---------- tema cerah ---------- */
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f1f4f9;
  --line: #e3e7ef;
  --line-2: #d3d9e4;
  --text: #0f1420;
  --muted: #535c6f;
  --dim: #6b7385;
  --green: #089981;
  --green-hi: #067a67;
  --red: #d9293a;
  --blue: #2962ff;
  --cyan: #0284c7;
  --amber: #b76e00;
  --bg-rgb: 245, 247, 251;
  --panel-rgb: 255, 255, 255;
  --shadow: rgba(15, 20, 32, .16);
  --backdrop: rgba(15, 20, 32, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.mono { font-family: var(--mono); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 820px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hi); }
.btn-ghost { background: rgba(var(--panel-rgb), .6); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--dim); }

/* butang tukar tema */
.nav-right { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-toggle {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: rgba(var(--panel-rgb), .6); color: var(--muted); cursor: pointer;
  transition: color .15s, background-color .15s;
}
.theme-toggle:hover { color: var(--text); background: var(--panel-2); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(var(--bg-rgb), .8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel);
}
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-full {
  font-size: 13px; color: var(--muted); white-space: nowrap;
  padding-left: 12px; border-left: 1px solid var(--line-2);
}
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-auth { display: flex; align-items: center; gap: 8px; flex: none; }
.hello { font-size: 13px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.hello b { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(680px, 100svh);
  padding: 150px var(--gutter) 130px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-chart { position: absolute; inset: 64px 0 0 0; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--bg-rgb),.94) 0%, rgba(var(--bg-rgb),.78) 34%, rgba(var(--bg-rgb),.18) 66%, rgba(var(--bg-rgb),0) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(var(--bg-rgb),0) 20%);
}

.hero-content { position: relative; z-index: 1; max-width: 760px; pointer-events: none; }
.hero-content a, .hero-content button { pointer-events: auto; }
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6.2vw, 84px); font-weight: 800;
  line-height: 1; letter-spacing: -.04em;
  text-shadow: 0 4px 40px rgba(var(--bg-rgb),.6);
}
.lede { margin: 0; max-width: 420px; font-size: clamp(16px, 1.4vw, 18px); color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.6vw, 54px); font-weight: 800;
  line-height: 1.05; letter-spacing: -.035em;
}
.section-head p { margin: 0; font-size: 17px; color: var(--muted); }

/* ---------- market cards ---------- */
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.market-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 360px; padding: 30px;
  text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.market-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 20px 50px -24px var(--shadow); }
.market-card.is-active { border-color: var(--mc); }
.market-card > *:not(.spark) { position: relative; z-index: 1; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; opacity: .75; pointer-events: none; }
.mc-cta { text-shadow: 0 2px 12px var(--panel), 0 0 4px var(--panel); }
.mc-tag { font-size: 14px; font-weight: 600; color: var(--mc); }
.market-card h3 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.03em; }
.market-card p { margin: 0; max-width: 430px; color: var(--muted); }
.mc-meta { font-size: 13px; color: var(--dim); }
.mc-cta { margin-top: auto; font-weight: 700; font-size: 15px; color: var(--mc); }

/* ---------- syllabus ---------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  height: 42px; padding: 0 24px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-weight: 700; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.access {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  transition: border-color .2s, box-shadow .3s;
}
.access.is-pending { border-color: rgba(245,165,36,.5); }
.access.is-approved { border-color: rgba(18,184,150,.5); }
.access.is-rejected { border-color: rgba(242,54,69,.45); }
.is-rejected .access-icon { color: var(--red); }
.access.flash { box-shadow: 0 0 0 4px rgba(56,189,248,.25); border-color: var(--cyan); }
.access-icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted);
}
.is-pending .access-icon { color: var(--amber); }
.is-approved .access-icon { color: var(--green-hi); }
.access-text { flex: 1 1 320px; min-width: 0; }
.access-text strong { display: block; font-size: 15px; }
.access-text span { font-size: 14px; color: var(--muted); }
.access-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.level-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 22px 0; }
.level-step { font-size: 13px; font-weight: 600; color: var(--dim); }
.level h3 { margin-top: 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.level-sum { padding: 4px 22px 0; font-size: 13px; color: var(--dim); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-free { background: rgba(8,153,129,.14); color: var(--green-hi); }
.badge-ok { background: rgba(56,189,248,.12); color: var(--cyan); }
.badge-lock { background: rgba(148,156,176,.10); color: var(--muted); }
.badge-wait { background: rgba(245,165,36,.12); color: var(--amber); }

.modules { flex: 1; padding: 10px 12px 10px; }
.module h4 {
  margin: 14px 10px 6px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson {
  width: 100%;
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 10px; border: 0; border-radius: 9px;
  background: transparent; text-align: left; font-size: 14px; line-height: 1.4; cursor: pointer;
  transition: background-color .15s;
}
.lesson:hover { background: var(--panel-2); }
.lesson .ic {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line);
}
.ld { font-size: 12px; color: var(--dim); }
.is-open .lesson .ic { color: var(--green-hi); border-color: rgba(8,153,129,.4); }
.is-locked .lesson { color: var(--muted); }
.is-locked .lesson .ic { color: var(--dim); }
.level-foot { padding: 16px 22px 22px; border-top: 1px solid var(--line); }
.level-foot .btn { width: 100%; }
.level-foot p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.step-n { display: block; font-size: 13px; font-weight: 700; color: var(--green-hi); margin-bottom: 36px; }
.step h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.steps-note { margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.steps-note strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 4px; font-size: 17px; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); font-size: 20px; color: var(--dim); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 4px 22px; color: var(--muted); max-width: 680px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 110px; background: var(--bg-2); }
.foot-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.disclaimer { margin: 0 0 18px; max-width: 900px; font-size: 13px; color: var(--muted); }
.disclaimer strong { color: var(--text); }
.foot-meta { margin: 0; font-size: 12px; color: var(--dim); }
.foot-meta a { color: var(--muted); }

/* ---------- modal ---------- */
dialog {
  width: min(440px, calc(100% - 32px)); padding: 0;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: 0 40px 80px -20px var(--shadow);
}
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.auth { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.auth-x {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.auth-x:hover { background: var(--panel-2); color: var(--text); }
.auth-tabs { display: inline-flex; gap: 4px; padding: 4px; align-self: flex-start; background: var(--bg-2); border-radius: 10px; border: 1px solid var(--line); }
.auth-tabs button { height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-tabs button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.auth h3 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.auth-sub { margin: -8px 0 4px; font-size: 14px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  height: 46px; padding: 0 14px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41,98,255,.2); }
.auth .btn { margin-top: 6px; }
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; color: var(--red);
  background: rgba(242,54,69,.08); border: 1px solid rgba(242,54,69,.3);
}
.auth .btn:disabled { opacity: .6; cursor: progress; }

/* ---------- pemain video ---------- */
.video-modal { width: min(960px, calc(100% - 32px)); }
.vm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 22px; }
.vm-head h3 { font-size: 17px; font-weight: 700; }
.vm-head .auth-x { position: static; }
.vm-stage { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.vm-stage video { width: 100%; height: 100%; display: block; background: #000; }
.vm-stage:fullscreen { aspect-ratio: auto; }
.vm-mark {
  position: absolute; pointer-events: none; user-select: none;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.32);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  transition: top 1.2s ease, left 1.2s ease;
}
.vm-empty {
  position: absolute; inset: 0; margin: 0; padding: 24px;
  display: grid; place-items: center; text-align: center;
  color: #c9cfdb; font-size: 15px;
}
.vm-empty[hidden] { display: none; }
.tag-sample {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; vertical-align: 1px;
  color: var(--amber); background: rgba(245,165,36,.14);
}
.is-locked .lesson.is-sample { color: var(--text); }
.is-locked .lesson.is-sample .ic { color: var(--amber); border-color: rgba(245,165,36,.45); }
.vm-end {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; padding: 24px;
  background: rgba(5,8,13,.86);
}
.vm-end[hidden] { display: none; }
.vm-end-box { max-width: 460px; text-align: center; color: #e7eaf0; }
.vm-end-box h4 { margin: 0 0 10px; font-size: clamp(20px, 3vw, 28px); font-weight: 800; letter-spacing: -.02em; }
.vm-end-box p { margin: 0 0 22px; color: #b9c0cf; font-size: 15px; }
.vm-end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.vm-end-actions .btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: #e7eaf0; }
.levels-msg { grid-column: 1 / -1; margin: 0; padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 18px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  box-shadow: 0 20px 40px -16px var(--shadow);
  font-size: 14px;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .levels, .steps { grid-template-columns: 1fr; }
  .step-n { margin-bottom: 16px; }
}
@media (max-width: 1080px) {
  .nav-links { display: none; }
}
@media (max-width: 760px) {
  .hero { padding: 132px var(--gutter) 48px; min-height: max(640px, 100svh); }
  .hero-shade {
    background: linear-gradient(180deg, rgba(var(--bg-rgb),.55) 0%, rgba(var(--bg-rgb),.82) 55%, var(--bg) 100%);
  }
  .market-grid { grid-template-columns: 1fr; }
  .market-card { min-height: 320px; padding: 24px; }
  .tabs { display: flex; }
  .tab { flex: 1; }
  .access-actions, .access-actions .btn { width: 100%; }
  .toast { right: 8px; left: 8px; bottom: 8px; max-width: none; }
}
@media (max-width: 560px) {
  .brand-full { display: none; }
  .hello { display: none; }
}
@media (max-width: 380px) {
  .nav-auth [data-open="masuk"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
