/* BAIS Basics — design tokens */
:root {
  --bg: #F7F8FC; --surface: #FFFFFF; --surface-2: #F1F4FA; --line: #E3E8F1;
  --text: #0F172A; --text-2: #475569; --muted: #64748B;
  --primary: #4F46E5; --primary-600: #4338CA; --primary-50: #EEF2FF;
  --teal: #0EA5A4; --teal-50: #E6FFFB; --amber: #F59E0B; --amber-50: #FFF7ED;
  --green: #16A34A; --green-50: #DCFCE7; --red: #DC2626; --red-50: #FEE2E2;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(30,27,75,.07);
  --shadow-lg: 0 20px 50px rgba(30,27,75,.14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020; --surface: #121933; --surface-2: #1A2242; --line: #26304F;
    --text: #E8ECF8; --text-2: #B6C0DA; --muted: #8C97B5;
    --primary: #818CF8; --primary-600: #A5B4FC; --primary-50: #1E2350;
    --teal-50: #0D2E33; --amber-50: #33240C; --green-50: #0E3020; --red-50: #3A1518;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
  :root:not([data-theme="light"]) .banner.warn, :root:not([data-theme="light"]) .price-tag { color: #FCD34D; }
  :root:not([data-theme="light"]) .pill.warn { color: #FBBF24; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; } .brand b { color: var(--primary); font-weight: 800; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a.link { color: var(--text-2); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.nav a.link:hover { background: var(--surface-2); text-decoration: none; }
.nav a.link.active { color: var(--primary); background: var(--primary-50); }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 11px; flex-direction: column; justify-content: space-between; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
@media (max-width: 860px) {
  .menu-btn { display: flex; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .nav a.link, .nav .btn { padding: 12px 14px; }
}

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem; padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: transform .08s, background .2s, box-shadow .2s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-danger { background: var(--surface); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn-lg { padding: 15px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea.input { min-height: 220px; resize: vertical; line-height: 1.6; }
.field { margin-bottom: 16px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.error { color: var(--red); font-size: .9rem; font-weight: 600; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.pill.ba { background: var(--primary-50); color: var(--primary); }
.pill.mis { background: var(--teal-50); color: var(--teal); }
.pill.good { background: var(--green-50); color: var(--green); }
.pill.warn { background: var(--amber-50); color: #B45309; }
.page { padding-top: 34px; padding-bottom: 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; display: block; }

/* landing */
.hero { padding: 56px 0 40px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -200px -10% auto auto; width: 700px; height: 700px; background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 14%, transparent), transparent); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; position: relative; }
.hero h1 span { background: linear-gradient(90deg, var(--primary), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.price-tag { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; background: var(--amber-50); color: #92400E; font-weight: 700; }
.price-tag strong { font-size: 1.3rem; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: .92rem; font-weight: 600; }
.checks li::before { content: "✓"; color: var(--green); font-weight: 900; margin-right: 6px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 32px; } .hero-art { max-width: 460px; margin: 0 auto; } }
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 36px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.steps { counter-reset: s; }
.step { position: relative; padding-top: 52px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--teal)); }
.feature img { width: 120px; height: 96px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); }
.chip:hover { border-color: var(--primary); text-decoration: none; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 820px; margin: 0 auto; }
.plan { position: relative; }
.plan.pro { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); }
.plan .badge { position: absolute; top: -13px; right: 20px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.plan .amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.plan .amount small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.plan ul { padding: 0; list-style: none; margin: 18px 0 22px; }
.plan li { padding: 6px 0 6px 28px; position: relative; color: var(--text-2); }
.plan li::before { content: ""; position: absolute; left: 0; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-8' stroke='%2316A34A' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.pay-logos { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pay-logos span { font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface); }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--primary); }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 10px 0 0; color: var(--text-2); }
.cta-band { background: linear-gradient(120deg, var(--primary), #6D28D9 55%, var(--teal)); color: #fff; border-radius: 24px; padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-band .btn { background: #fff; color: var(--primary-600); }
.cta-band p { opacity: .9; margin: 0; }

/* auth */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 66px); }
.auth-art { background: linear-gradient(140deg, #4F46E5, #6D28D9 60%, #0EA5A4); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.auth-art img { max-width: 360px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 36px 16px; }
.auth-form .card { width: 100%; max-width: 420px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; text-align: center; padding: 9px 6px; border-radius: 9px; cursor: pointer; font-size: .85rem; color: var(--text-2); }
.seg input:checked + label { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* app */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { font-size: .85rem; color: var(--muted); font-weight: 600; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--teal)); border-radius: 999px; transition: width .5s; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .88rem; color: var(--text-2); cursor: pointer; font-family: inherit; }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.topic-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: transform .15s, box-shadow .2s, border-color .2s; }
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); text-decoration: none; }
.topic-card p { color: var(--text-2); font-size: .93rem; margin: 0; flex: 1; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .input { padding-left: 42px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.lesson { max-width: 760px; }
.lesson p { font-size: 1.05rem; color: var(--text-2); }
.terms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.term { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.term b { display: block; margin-bottom: 4px; }
.example { border-left: 4px solid var(--amber); background: var(--amber-50); padding: 14px 18px; border-radius: 0 12px 12px 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.layout-notes { grid-template-columns: 320px minmax(0, 1fr); }
.layout-pay { grid-template-columns: minmax(0, 1fr) 420px; }
@media (max-width: 980px) { .layout-2, .layout-notes, .layout-pay { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; gap: 12px; } .stats .num { font-size: 1.5rem; } }
.sticky { position: sticky; top: 86px; }
.dropzone { border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--line)); border-radius: var(--radius); padding: 30px 18px; text-align: center; background: color-mix(in srgb, var(--primary-50) 60%, var(--surface)); cursor: pointer; transition: background .2s, border-color .2s; }
.dropzone.drag { background: var(--primary-50); border-color: var(--primary); }
.dropzone img { width: 140px; margin: 0 auto 8px; }
.empty { text-align: center; padding-top: 30px; padding-bottom: 30px; color: var(--muted); }
.empty img { width: 170px; margin: 0 auto 10px; }

/* quiz player */
.player { max-width: 720px; margin: 0 auto; }
.qprogress { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.question { font-size: 1.25rem; font-weight: 700; margin: 18px 0; line-height: 1.4; }
.options { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; font: inherit; color: var(--text); padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.opt .key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); color: var(--text-2); }
.opt.sel { border-color: var(--primary); background: var(--primary-50); }
.opt.sel .key { background: var(--primary); color: #fff; }
.opt.right { border-color: var(--green); background: var(--green-50); }
.opt.wrong { border-color: var(--red); background: var(--red-50); }
.result-hero { text-align: center; padding: 26px 10px; }
.ring { width: 150px; height: 150px; margin: 0 auto 12px; }
.review { border-radius: 14px; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.review.ok { border-left: 5px solid var(--green); } .review.no { border-left: 5px solid var(--red); }
.flash-wrap { perspective: 1200px; max-width: 560px; margin: 0 auto; }
.flash { position: relative; height: 300px; cursor: pointer; transform-style: preserve-3d; transition: transform .5s; }
.flash.flipped { transform: rotateY(180deg); }
.flash .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 22px; padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; box-shadow: var(--shadow-lg); overflow: auto; }
.flash .front { background: linear-gradient(135deg, var(--primary), #6D28D9); color: #fff; font-size: 1.35rem; font-weight: 800; }
.flash .back { background: var(--surface); border: 1px solid var(--line); transform: rotateY(180deg); font-size: 1.05rem; color: var(--text-2); }
.flash .face small { position: absolute; top: 16px; left: 20px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; font-weight: 800; }
.note-item { cursor: pointer; padding: 14px; border-radius: 12px; border: 1px solid transparent; }
.note-item:hover, .note-item.active { background: var(--surface-2); border-color: var(--line); }
.note-item h4 { margin: 0 0 4px; font-size: .98rem; }
.note-item p { margin: 0; font-size: .85rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .col i { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--teal), var(--primary)); min-height: 3px; }
.chart .col i.zero { background: var(--surface-2); }
.chart .col span { font-size: .65rem; color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.checklist .dot { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; color: #fff; }
.checklist li.done .dot { background: var(--green); border-color: var(--green); }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }
.banner { padding: 14px 18px; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); font-weight: 600; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.success { background: var(--green-50); color: var(--green); }
.banner.warn { background: var(--amber-50); color: #92400E; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .3s; z-index: 80; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.spinner { width: 22px; height: 22px; border: 3px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
.mysr-form { margin-top: 10px; }
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 34px 0; }
.footer-inner { display: grid; grid-template-columns: 2fr 2fr 1.4fr; gap: 20px; align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 20px; font-weight: 600; font-size: .92rem; }
.footer-links a { color: var(--text-2); }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } .cta-band { padding: 28px 22px; } .card { padding: 18px; } .flash { height: 340px; } }
.prose { max-width: 760px; } .prose h3 { margin-top: 1.6em; } .prose p, .prose li { color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
