:root {
  --primary: #16a34a;
  --primary-dark: #14532d;
  --primary-light: #dcfce7;
  --accent: #10b981;
  --accent-dark: #065f46;
  --navy: #0e1512;
  --navy-light: #1f2937;
  --warn: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --outer-bg: #f2f7f4;
  --bg: #f7faf8;
  --surface: #ffffff;
  --text: #0f1712;
  --text-muted: #6b7572;
  --border: #e7ece9;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow: 0 2px 8px rgba(15, 23, 18, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 18, 0.12);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  --primary-light: #0f2a1b;
  --primary-dark: #6ee7a8;
  --outer-bg: #0a0f0c;
  --bg: #121814;
  --surface: #1a211c;
  --text: #eaf3ed;
  --text-muted: #9ca9a1;
  --border: #2a332c;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .demo-note { background: #2a2410; border-color: #4d3f13; color: #fcd34d; }
:root[data-theme="dark"] .banner-accent { background: linear-gradient(135deg, #103334, #123529); border-color: #1c4f43; }
:root[data-theme="dark"] .timer-badge.warn { background: #3a2e0f; color: #fcd34d; }
:root[data-theme="dark"] .timer-badge.danger { background: #3a1414; color: #fca5a5; }
:root[data-theme="dark"] .option-row.correct { background: #123321; }
:root[data-theme="dark"] .option-row.incorrect { background: #331414; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--outer-bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  scroll-behavior: smooth;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img { max-width: 100%; }
.icon-svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 8px 4px 20px;
  background: var(--navy);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}

.navbar-inner {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
}

.brand-icon {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.nav-links a:hover { color: #ffffff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-hover { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.paket-card, .paket-card-locked {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.paket-card { cursor: pointer; }
.paket-card-locked { opacity: 0.6; cursor: not-allowed; filter: grayscale(0.3); }

/* Hero */
.hero {
  padding: 90px 0 70px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 800;
}

.hero h1 span { color: var(--primary); }

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Grid */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* Stats bar */
.stats-bar { padding: 36px 0; background: var(--navy); }
.stat-item { text-align: center; }
.stat-number { font-size: 32px; font-weight: 800; color: #ffffff; }
.stat-label { font-size: 13px; color: rgba(255, 255, 255, 0.65); margin-top: 4px; }

/* Steps */
.step-card { text-align: center; }
.step-number {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  margin: 0 auto 14px;
}

/* Testimonials */
.testimonial-quote { color: var(--text); font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.testimonial-name { font-weight: 700; font-size: 14px; }
.testimonial-role { font-size: 12.5px; color: var(--text-muted); }

/* Trust row under pricing */
.trust-row {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
}
.trust-row span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.trust-row .icon-svg { color: var(--success); flex-shrink: 0; }

.section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 32px; font-weight: 800; margin: 0 0 12px; }
.section-title p { color: var(--text-muted); font-size: 16px; }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

/* Pricing */
.pricing-card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.pricing-card .price {
  font-size: 44px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 12px 0 4px;
}

.pricing-card .price small {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pricing-list li { display: flex; gap: 10px; align-items: flex-start; }
.pricing-list li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* Forms */
.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.form-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
.form-group input:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.demo-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.5;
}

/* App shell (protected pages) — navbar atas + kolom konten */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--bg); transform: translateY(-1px); }
.theme-toggle-fixed { position: fixed; top: 20px; right: 20px; z-index: 100; }

.topbar {
  position: sticky;
  top: 16px;
  z-index: 40;
  max-width: 1520px;
  margin: 24px auto 0;
  padding: 12px 16px 12px 24px;
  background: var(--navy);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-lg);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topbar-link.active { background: #fff; color: var(--navy); }
.topbar-link .pill {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.topbar-link.active .pill { background: var(--primary); color: white; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-actions .theme-toggle { width: 40px; height: 40px; font-size: 16px; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #fff; }
.topbar-actions .theme-toggle:hover { background: rgba(255, 255, 255, 0.16); }

.topbar-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.6);
}
.topbar-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.app-body {
  max-width: 1520px;
  margin: 24px auto 40px;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.app-main-content { flex: 1; min-width: 0; }
.app-right {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

@media (max-width: 1200px) {
  .app-right { display: none; }
}
@media (max-width: 860px) {
  .topbar { margin: 12px; padding: 8px 8px 8px 14px; gap: 10px; }
  .topbar-nav { gap: 0; }
  .topbar-link { padding: 10px; }
  .topbar-link .label { display: none; }
  .app-body { padding: 0 12px; }
}

/* Dashboard chart cards */
.chart-card { background: var(--surface); border-radius: 22px; padding: 22px; }
.chart-card .chart-card-title { font-weight: 700; font-size: 15px; margin-top: 16px; }
.chart-card .chart-card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.mbar.c1, .activity-bar.c1, .dot.c1 { background: var(--primary); }
.mbar.c2, .activity-bar.c2, .dot.c2 { background: var(--success); }
.mbar.c3, .activity-bar.c3, .dot.c3 { background: var(--warn); }

/* Ringkasan angka sederhana (tanpa grafik batang besar) */
.mini-stat-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 14px; }
.mini-stat { min-width: 56px; }
.mini-stat .mini-stat-num { font-size: 22px; font-weight: 800; color: var(--text); }
.mini-stat .mini-stat-num.muted { color: var(--text-muted); font-weight: 700; }
.mini-stat .mini-stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.chart-legend .legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* List card (subtests/history) */
.list-card { background: var(--surface); border-radius: 22px; padding: 8px 22px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.list-item:last-child { border-bottom: none; }
.list-item .title { font-weight: 700; font-size: 15px; }
.list-item .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.list-item .arrow {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px;
}

/* Feature ad card */
.feature-ad {
  background: linear-gradient(165deg, var(--primary), #34d399);
  border-radius: 22px; padding: 26px; color: white;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 260px; position: relative; overflow: hidden;
}
.feature-ad .eyebrow-white {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; opacity: 0.85;
}
.feature-ad h3 { font-size: 24px; margin: 10px 0 6px; line-height: 1.25; }
.feature-ad p { font-size: 13px; opacity: 0.85; margin: 0; }
.feature-ad .btn-white { background: white; color: var(--primary-dark); margin-top: 18px; align-self: flex-start; }

/* Right profile panel */
.profile-card { background: var(--surface); border-radius: 22px; padding: 26px 20px; text-align: center; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; overflow: hidden; flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card .name { font-weight: 700; font-size: 16px; }
.profile-card .role { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* Halaman Profil: avatar besar + tombol ganti foto */
.avatar-edit-wrap { position: relative; width: 120px; margin: 0 auto 12px; }
.profile-avatar-lg { width: 120px; height: 120px; font-size: 40px; margin: 0; }
.avatar-edit-btn {
  position: absolute; bottom: 0; right: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 3px solid var(--surface); font-size: 15px;
}
.avatar-edit-btn:hover { background: var(--primary-dark); }

.right-panel-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 4px; }
.right-panel-title h4 { font-size: 15px; margin: 0; }
.right-panel-title .cal { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; }

.activity-chart { margin-top: 12px; }
.activity-row { position: relative; height: 46px; border-top: 1px dashed var(--border); display: flex; align-items: flex-start; }
.activity-row .hour-label { font-size: 11px; color: var(--text-muted); margin-top: -6px; }
.activity-row .activity-bar { position: absolute; top: 4px; width: 6px; height: 34px; border-radius: 4px; }

.banner {
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.banner-accent { background: linear-gradient(135deg, #ecfeff, #f0fdfa); border: 1px solid #99f6e4; }

/* Subtest chips */
.subtest-list { display: flex; flex-direction: column; gap: 14px; }
.subtest-group-header {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin: 4px 4px -4px;
}
.subtest-group-header:first-child { margin-top: 0; }
.subtest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.subtest-row.selected { border-color: var(--primary); background: var(--primary-light); }
.subtest-meta { display: flex; align-items: center; gap: 14px; }
.subtest-meta .icon { font-size: 24px; }
.subtest-meta .name { font-weight: 700; }
.subtest-meta .sub { font-size: 13px; color: var(--text-muted); }

/* Timer */
.timer-badge {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.timer-badge.warn { background: #fef3c7; color: #92400e; }
.timer-badge.danger { background: #fee2e2; color: #991b1b; }

/* Question layout */
.question-layout { display: grid; grid-template-columns: 1fr 260px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .question-layout { grid-template-columns: 1fr; } }

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.qnav-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.qnav-btn.answered { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.qnav-btn.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option-row:hover { border-color: var(--primary); }
.option-row.selected { border-color: var(--primary); background: var(--primary-light); }
.option-row.correct { border-color: var(--success); background: #f0fdf4; }
.option-row.incorrect { border-color: var(--danger); background: #fef2f2; }
.option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.progress-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.explanation-box {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-hashtag { margin-top: 8px; font-weight: 700; color: var(--primary); letter-spacing: 0.02em; }

.hashtag-badge {
  display: inline-block;
  margin-top: 28px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}
:root[data-theme="dark"] .hashtag-badge { color: var(--primary); }

h1, h2, h3 { font-family: 'Poppins', sans-serif; }

.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.flex { display: flex; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
