:root {
  --navy: #1e3a5f;
  --blue: #2e5fa3;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e1e7f0;
  --text: #1a2330;
  --muted: #6b7891;
  --green: #2e9e6b;
  --amber: #d98324;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--navy);
  color: #fff;
}
.brand { font-weight: 700; font-size: 19px; letter-spacing: 1px; cursor: pointer; }
.brand span { font-weight: 400; opacity: 0.7; font-size: 14px; }

#nav { display: flex; gap: 8px; align-items: center; }
#nav a { color: #cdd8ea; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
#nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
#nav .who { color: #8ea4c4; font-size: 13px; }

main { flex: 1; max-width: 980px; width: 100%; margin: 0 auto; padding: 28px; }

footer { text-align: center; padding: 18px; color: var(--muted); font-size: 12px; }

.loading { text-align: center; color: var(--muted); padding: 60px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

h1 { font-size: 26px; color: var(--navy); margin-bottom: 6px; }
h2 { font-size: 20px; color: var(--navy); margin-bottom: 12px; }
h3 { font-size: 16px; color: var(--navy); }
p.sub { color: var(--muted); margin-bottom: 20px; }

.course-card { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(30,58,95,.12); }
.badge { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; background: #eaf0fb; color: var(--blue); padding: 3px 9px; border-radius: 20px; margin-bottom: 10px; }
.course-card h3 { margin-bottom: 8px; }
.course-card .desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.course-card .meta { margin-top: 14px; font-size: 13px; color: var(--blue); font-weight: 600; }

/* Buttons */
button, .btn {
  font: inherit; cursor: pointer; border: none; border-radius: 9px;
  padding: 11px 20px; font-weight: 600; font-size: 14px;
  background: var(--blue); color: #fff; transition: background .12s;
}
button:hover, .btn:hover { background: var(--navy); }
button.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
button.ghost:hover { background: #f0f4fb; color: var(--navy); }
button:disabled { background: #b9c4d6; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Forms */
.form { max-width: 380px; margin: 30px auto; }
.form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }
.form input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.form input:focus { outline: none; border-color: var(--blue); }
.form button { width: 100%; margin-top: 22px; }
.form .switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.form .switch a { color: var(--blue); cursor: pointer; }
.err { background: #fdecec; color: #c0392b; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-top: 14px; }
.ok { background: #eafaf1; color: var(--green); padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-top: 14px; }

/* Mode toggle */
.mode-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.mode-toggle button { background: #fff; color: var(--muted); border-radius: 0; padding: 8px 14px; font-size: 13px; }
.mode-toggle button.active { background: var(--blue); color: #fff; }

/* Lesson roadmap */
.roadmap { list-style: none; }
.roadmap li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.roadmap li:last-child { border-bottom: none; }
.roadmap .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; border: 2px solid var(--line); color: var(--muted); }
.roadmap li.done .mark { background: var(--green); border-color: var(--green); color: #fff; }
.roadmap li.current .mark { background: var(--blue); border-color: var(--blue); color: #fff; }
.roadmap li.current { font-weight: 600; color: var(--navy); }

.progressbar { height: 10px; background: #e7edf6; border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.progressbar > div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .3s; }
.pct { font-size: 13px; color: var(--muted); }

/* Quiz */
.q { margin-bottom: 22px; }
.q .qtext { font-weight: 600; margin-bottom: 10px; }
.opt { display: block; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.opt:hover { border-color: var(--blue); background: #f7faff; }
.opt input { margin-right: 9px; }
.opt.correct { border-color: var(--green); background: #eafaf1; }
.opt.wrong { border-color: #c0392b; background: #fdecec; }

.bubble { background: #fffaf0; border: 1px solid #f0d9a8; border-left: 4px solid var(--amber); padding: 12px 16px; border-radius: 8px; margin: 14px 0; font-size: 14px; line-height: 1.5; }
.bubble strong { color: var(--amber); }

.layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }

.steps { list-style: none; }
.steps li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.steps li:last-child { border-bottom: none; }
.steps .n { display: inline-block; width: 24px; height: 24px; background: var(--navy); color: #fff; border-radius: 50%; text-align: center; line-height: 24px; font-size: 12px; margin-right: 10px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

.plan-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan-featured { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }

.plan-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #fff; background: var(--blue); padding: 3px 10px; border-radius: 20px; align-self: flex-start; }
.plan-featured .plan-tag { background: var(--navy); }
.plan-tag-empty { height: 22px; }

.plan-label { font-size: 18px; font-weight: 700; color: var(--navy); }
.plan-price { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1; }
.plan-period { font-size: 15px; font-weight: 400; color: var(--muted); }
.plan-calls { font-size: 13px; color: var(--blue); font-weight: 600; padding: 6px 10px; background: #eaf0fb; border-radius: 8px; }

.plan-features { list-style: none; flex: 1; }
.plan-features li { font-size: 13px; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before { content: '✓ '; color: var(--green); font-weight: 700; }

.plan-card button { width: 100%; margin-top: 4px; }

.topup-banner { background: #fffaf0; border: 1px solid #f0d9a8; border-left: 4px solid var(--amber); padding: 14px 18px; border-radius: 8px; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

#nav-pricing { background: var(--amber); color: #fff !important; border-radius: 8px; font-weight: 600; }
#nav-pricing:hover { background: #b86f1a !important; }
