@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --green-deep: #0d493e;
  --green: #156b5a;
  --green-light: #1e8c73;
  --cream: #f8f1e8;
  --cream-dark: #efe4d0;
  --gold: #d9ac55;
  --gold-light: #e8c97a;
  --gold-dark: #b8923e;
  --ink: #1a2e28;
  --muted: #5a7a6f;
  --white: #ffffff;
  --paper: #f0ebe3;
  --line: #d8cfc0;
  --success: #2d8a5e;
  --error: #c0392b;
  --shadow: 0 4px 16px rgba(13, 73, 62, 0.10);
  --shadow-lg: 0 8px 32px rgba(13, 73, 62, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 16px/1.65 var(--sans);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.wrap { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }

/* ── Focus States ── */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Header / Navigation ── */
.site-header {
  position: sticky; z-index: 20; top: 0;
  background: rgba(13, 73, 62, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold);
}
.nav-wrap {
  width: min(1200px, calc(100% - 32px));
  height: 68px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand img { height: 42px; width: 42px; object-fit: contain; border-radius: 50%; background: var(--white); padding: 3px; }
.brand-text { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand-text small { display: block; font-family: var(--sans); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-light); }

.primary-nav { display: flex; align-items: center; gap: 6px; }
.primary-nav a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.80); font-size: 14px; font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.primary-nav a:hover, .primary-nav a.active { color: var(--white); background: rgba(255,255,255,0.12); }
.primary-nav a.active { color: var(--gold-light); }

.menu-toggle {
  display: none; grid-template-rows: 1fr 1fr 1fr; gap: 5px;
  padding: 8px; background: none; border: 0;
}
.menu-toggle span { display: block; height: 2px; background: var(--white); border-radius: 2px; }

@media (max-width: 700px) {
  .menu-toggle { display: grid; }
  .primary-nav {
    position: fixed; top: 68px; left: 0; right: 0; bottom: 0;
    flex-direction: column; gap: 4px; padding: 16px;
    background: var(--green-deep);
    transform: translateX(100%); transition: transform 0.3s ease;
    z-index: 10;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav a { width: 100%; padding: 14px 16px; font-size: 16px; }
}

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden;
  min-height: 420px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--white);
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z' fill='none' stroke='rgba(217,172,85,0.08)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  opacity: 0.5;
}
.hero-content { position: relative; z-index: 1; padding: 60px 24px; max-width: 700px; }
.hero-logo { width: 100px; height: 100px; margin: 0 auto 24px; border-radius: 50%; background: var(--white); padding: 8px; box-shadow: var(--shadow-lg); }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(32px, 5vw, 52px);
  font-weight: 700; margin: 0 0 12px; line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--gold-light); }
.hero p { margin: 0 0 32px; font-size: 17px; color: rgba(255,255,255,0.85); max-width: 520px; margin-left: auto; margin-right: auto; }

/* ── Menu Cards ── */
.menu-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; padding: 48px 0;
}
.menu-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 36px 24px 32px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.menu-icon {
  width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 50%; margin-bottom: 16px; font-size: 28px;
  background: linear-gradient(135deg, var(--green-deep), var(--green));
  color: var(--gold-light);
}
.menu-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; color: var(--green-deep); }
.menu-card p { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.menu-card .btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 999px;
  background: var(--green-deep); color: var(--white);
  font-size: 14px; font-weight: 700; border: 0;
  transition: background 0.2s, transform 0.2s;
}
.menu-card .btn:hover { background: var(--green); transform: translateY(-1px); }

/* ── Section ── */
.section { padding: 48px 0 64px; }
.section-title {
  font-family: var(--serif); font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 700; text-align: center; margin: 0 0 8px; color: var(--green-deep);
}
.section-subtitle { text-align: center; color: var(--muted); margin: 0 0 36px; font-size: 15px; }

/* ── Bab Cards (Belajar) ── */
.bab-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.bab-card {
  padding: 28px 24px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.bab-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.bab-card .bab-number {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--cream); color: var(--green-deep); margin-bottom: 12px;
}
.bab-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 19px; color: var(--green-deep); }
.bab-card p { margin: 0; font-size: 14px; color: var(--muted); }
.bab-card .bab-status { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; }
.bab-card .bab-status.done { color: var(--success); }
.bab-card .bab-status.pending { color: var(--muted); }

/* ── Materi Detail ── */
.materi-panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 36px; margin-top: 32px;
}
.materi-panel h2 { font-family: var(--serif); font-size: 28px; color: var(--green-deep); margin: 0 0 8px; }
.materi-panel .materi-category { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 24px; }
.materi-panel .materi-body { font-size: 16px; line-height: 1.8; color: var(--ink); }
.materi-panel .materi-body p { margin: 0 0 16px; }
.materi-panel .materi-ayat {
  margin-top: 24px; padding: 20px 24px;
  background: var(--cream); border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--muted);
}
.nav-buttons { display: flex; justify-content: space-between; margin-top: 32px; gap: 16px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px;
  background: var(--green-deep); color: var(--white);
  font-size: 14px; font-weight: 700; border: 0;
  transition: background 0.2s;
}
.nav-btn:hover { background: var(--green); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.nav-btn.secondary { background: var(--cream-dark); color: var(--green-deep); }
.nav-btn.secondary:hover { background: var(--line); }

/* ── Quiz ── */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.quiz-progress { font-size: 14px; font-weight: 600; color: var(--green-deep); }
.quiz-score { font-size: 14px; font-weight: 700; color: var(--gold-dark); }
.quiz-question {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 36px 32px; margin-bottom: 24px;
}
.quiz-question h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 24px; color: var(--green-deep); }
.quiz-options { display: grid; gap: 12px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border: 2px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white);
  font-size: 15px; transition: border-color 0.2s, background 0.2s;
  cursor: pointer; text-align: left; width: 100%;
}
.quiz-option:hover { border-color: var(--green); background: var(--cream); }
.quiz-option .option-letter {
  flex: 0 0 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--cream); color: var(--green-deep);
  font-weight: 700; font-size: 14px;
}
.quiz-option.selected { border-color: var(--green); background: var(--cream); }
.quiz-option.correct { border-color: var(--success); background: #e8f5e9; }
.quiz-option.correct .option-letter { background: var(--success); color: var(--white); }
.quiz-option.wrong { border-color: var(--error); background: #fdecea; }
.quiz-option.wrong .option-letter { background: var(--error); color: var(--white); }
.quiz-feedback {
  padding: 20px 24px; border-radius: var(--radius-sm);
  margin-top: 20px; font-size: 14px; line-height: 1.7;
}
.quiz-feedback.correct { background: #e8f5e9; border: 1px solid var(--success); color: #1b5e20; }
.quiz-feedback.wrong { background: #fdecea; border: 1px solid var(--error); color: #7f1d1d; }

/* ── Quiz Results ── */
.quiz-result {
  text-align: center; padding: 48px 32px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.quiz-result .result-icon { font-size: 64px; margin-bottom: 16px; }
.quiz-result h2 { font-family: var(--serif); font-size: 28px; color: var(--green-deep); margin: 0 0 8px; }
.quiz-result .result-score { font-size: 48px; font-weight: 700; color: var(--gold-dark); margin: 16px 0; }
.quiz-result p { color: var(--muted); margin: 0 0 24px; }

/* ── Progres Dashboard ── */
.progres-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 36px;
}
.stat-card {
  padding: 24px 20px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
}
.stat-card .stat-value { font-size: 36px; font-weight: 700; color: var(--green-deep); }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.progres-list { display: grid; gap: 12px; }
.progres-item {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.progres-item .progres-bab { flex: 1; }
.progres-item .progres-bab h4 { margin: 0 0 4px; font-size: 16px; color: var(--green-deep); }
.progres-item .progres-bab p { margin: 0; font-size: 13px; color: var(--muted); }
.progres-item .progres-score {
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.progres-item .progres-score.done { background: #e8f5e9; color: var(--success); }
.progres-item .progres-score.pending { background: var(--cream); color: var(--muted); }

/* ── Bab Selector ── */
.bab-selector {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 32px;
}
.bab-select-btn {
  padding: 16px 20px; border: 2px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white);
  font-size: 14px; font-weight: 600; text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.bab-select-btn:hover { border-color: var(--green); background: var(--cream); }
.bab-select-btn.active { border-color: var(--green-deep); background: var(--green-deep); color: var(--white); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px;
  font-size: 14px; font-weight: 700; border: 0;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary { background: var(--green-deep); color: var(--white); }
.btn-primary:hover { background: var(--green); transform: translateY(-1px); }
.btn-secondary { background: var(--cream-dark); color: var(--green-deep); }
.btn-secondary:hover { background: var(--line); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-light); }

/* ── Back Link ── */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 24px; font-size: 14px; font-weight: 600;
  color: var(--green-deep);
}
.back-link:hover { color: var(--green); }

/* ── Footer ── */
.site-footer {
  padding: 32px 0; text-align: center;
  background: var(--green-deep); color: rgba(255,255,255,0.70);
  font-size: 13px; margin-top: 64px;
}
.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: var(--gold); }

/* ── Demo Badge ── */
.demo-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 16px;
}

/* ── Fasal List ── */
.fasal-list {
  margin-top: 24px;
  padding: 24px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.fasal-list h3 {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--green-deep);
  margin: 0 0 16px;
}
.arab-toggle {
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--white);
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 700;
}
.arab-toggle:hover { background: var(--cream-dark); }
.fasal-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.fasal-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.fasal-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fasal-number {
  flex: 0 0 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-deep);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.fasal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

/* ── Arabic Hapalan Text ── */
.arab-text {
  margin-top: 8px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fef9f0 0%, #fdf3e0 100%);
  border-radius: var(--radius-sm);
  border: 2px solid var(--gold);
  border-right: 4px solid var(--gold-dark);
}
.arab-text p {
  margin: 0;
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-size: 22px;
  line-height: 2.2;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  text-align: right;
}
.arab-fasal-title {
  margin: 0 0 12px !important;
  font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-size: 26px !important;
  font-weight: 700;
  line-height: 2.2;
  color: var(--green-deep) !important;
  text-align: center;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 10px;
}
.arab-details {
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.arab-details p { margin: 0 0 8px; }
.arab-details p:last-child { margin-bottom: 0; }
.arab-details strong { color: var(--green-deep); }
.fasal-count {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  margin: 8px 0 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--serif); color: var(--green-deep); margin: 0 0 8px; }

/* ── Responsive ── */
@media (max-width: 500px) {
  .hero { min-height: 340px; }
  .hero-content { padding: 40px 16px; }
  .menu-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .menu-card { padding: 24px 16px 20px; }
  .materi-panel { padding: 28px 20px; }
  .quiz-question { padding: 24px 20px; }
  .nav-buttons { flex-direction: column; }
  .nav-btn { justify-content: center; }
  .fasal-list { padding: 16px; }
  .fasal-item { padding: 12px 14px; }
  .arab-text { padding: 14px 16px; }
  .arab-text p { font-size: 19px; line-height: 2; }
}
