:root {
  --bg: #f4f5ef;
  --card: #fffef9;
  --ink: #17241f;
  --muted: #66736d;
  --primary: #075f49;
  --primary-2: #087259;
  --primary-dark: #064638;
  --soft: #e8f3ee;
  --gold: #bd9542;
  --gold-soft: #fbf3df;
  --line: #dce5df;
  --danger: #9f3a3a;
  --shadow: 0 16px 45px rgba(18, 55, 44, .09);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 92px;
  background:
    radial-gradient(circle at 92% 0, rgba(189, 149, 66, .10), transparent 230px),
    linear-gradient(180deg, #edf6f1 0, #f7f8f4 230px, var(--bg) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 16px;
  background: rgba(248, 250, 247, .92);
  border-bottom: 1px solid rgba(220, 229, 223, .82);
  backdrop-filter: blur(14px);
}

.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(189, 149, 66, .65);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff4cf;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: 24px;
  box-shadow: 0 5px 13px rgba(7, 95, 73, .18);
}
.brand { font-size: 17px; font-weight: 850; letter-spacing: -.2px; }
.subbrand { margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--soft);
  color: var(--primary);
  font-size: 21px;
  cursor: pointer;
}
.icon-btn#backBtn { margin-left: 0; }

.screen { padding: 18px 16px 28px; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 29px 24px 25px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 244, 207, .15), transparent 150px),
    linear-gradient(145deg, #087058 0%, #064c3d 70%, #063d33 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -78px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 245, 214, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 245, 214, .04), 0 0 0 56px rgba(255, 245, 214, .025);
}
.hero-symbol {
  position: absolute;
  top: 22px;
  right: 24px;
  color: rgba(255, 241, 197, .45);
  font-size: 44px;
}
.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 13px 0 12px;
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.08;
  letter-spacing: -1.15px;
}
.hero p {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0;
  color: #dcece6;
  font-size: 15px;
  line-height: 1.62;
}
.hero-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 24px;
  background: #fffdf5;
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .13);
}

.eyebrow, .section-kicker {
  color: #d6bf83;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-kicker { color: var(--primary); }

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  padding: 13px 15px;
  border: 1px solid #d5e7de;
  border-radius: 17px;
  background: #f7fbf8;
  color: var(--primary-dark);
}
.privacy-strip > span { font-size: 20px; }
.privacy-strip b, .privacy-strip small { display: block; }
.privacy-strip b { font-size: 13px; }
.privacy-strip small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.card {
  margin-top: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--card);
  box-shadow: 0 6px 22px rgba(18, 55, 44, .045);
}
.card h2, .card h3 { margin: 7px 0 8px; }
.card h2 { font-size: 22px; line-height: 1.24; }
.card h3 { font-size: 17px; }
.card p { line-height: 1.58; }
.card > p:last-child { margin-bottom: 0; }

.mini-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 16px;
}
.mini-steps > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 9px 10px;
  border-radius: 14px;
  background: #f5f8f5;
  font-size: 12px;
}
.mini-steps span, .guide-item > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.principle-card { border-color: #e5d8b6; background: #fffaf0; }
.principle-card h3 { color: #735a24; }
.principle-card p { color: #665b3f; font-size: 13px; }
.last-card h3 { margin-bottom: 2px; }
.session-count, .verse-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 17px;
  border: 0;
  border-radius: 15px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .nav-btn:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid rgba(189, 149, 66, .4);
  outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-outline { border: 1px solid #cfdcd5; background: #fff; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.btn + .btn { margin-top: 9px; }

.gate-header { padding: 2px 2px 12px; }
.lock-pill {
  width: max-content;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid #d2e5db;
  border-radius: 999px;
  background: #f5fbf8;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}
.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}
.progress-copy b { color: var(--primary); }
.progress-track {
  height: 7px;
  overflow: hidden;
  margin-top: 7px;
  border-radius: 999px;
  background: #dce8e1;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #2d9878);
  transition: width .25s ease;
}

.gate-card {
  margin-top: 4px;
  padding: 28px 21px 22px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow);
}
.gate-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border: 1px solid #c9dfd4;
  border-radius: 23px;
  background: linear-gradient(145deg, #eff8f3, #e1f0e9);
  color: var(--primary);
  font-size: 31px;
  box-shadow: 0 10px 22px rgba(7, 95, 73, .09);
}
.gate-icon.arabic-icon { font-family: "Noto Naskh Arabic", "Amiri", serif; font-size: 20px; }
.gate-card h2 { margin: 9px auto 10px; max-width: 540px; font-size: 26px; line-height: 1.2; letter-spacing: -.45px; }
.gate-card > p { max-width: 550px; margin: 0 auto 19px; color: var(--muted); line-height: 1.62; }
.gate-card blockquote {
  margin: 0 0 20px;
  padding: 16px 15px;
  border: 1px solid #e7d9b4;
  border-radius: 16px;
  background: var(--gold-soft);
  color: #5f4b24;
  font-family: Georgia, serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.65;
  text-align: left;
}
.paused-card { margin-top: 20px; }
.gate-footnote { max-width: 540px; margin: 15px auto 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; text-align: center; }

.notice {
  margin: 15px 0;
  padding: 13px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: #fff7e4;
  color: #685124;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}
.notice.green { border-left-color: var(--primary); background: #edf8f3; color: #215a48; }

.mushaf-opening { padding: 48px 10px 30px; text-align: center; }
.mushaf-opening h2 { margin: 9px 0 6px; font-size: 25px; }
.mushaf-opening p { margin: 0; color: var(--muted); line-height: 1.55; }
.book-scene { width: 220px; height: 155px; display: grid; place-items: center; margin: 0 auto 12px; perspective: 900px; }
.book { position: relative; width: 174px; height: 114px; transform-style: preserve-3d; }
.book-pages { position: absolute; inset: 8px 14px; border: 1px solid #d8d0b9; border-radius: 8px; background: #fffdf5; box-shadow: 0 8px 22px rgba(45, 38, 23, .12); }
.book-cover { position: absolute; top: 0; z-index: 2; width: 50%; height: 100%; border: 2px solid #d1b364; background: linear-gradient(145deg, #087058, #064536); backface-visibility: hidden; }
.book-cover.left { left: 0; border-radius: 10px 2px 2px 10px; transform-origin: right center; animation: bookOpenLeft 1.1s ease forwards; }
.book-cover.right { right: 0; border-radius: 2px 10px 10px 2px; transform-origin: left center; animation: bookOpenRight 1.1s ease forwards; }
.book::after { content: ""; position: absolute; z-index: 1; top: 7px; bottom: 7px; left: 50%; width: 1px; background: #c7bfa6; }
.load-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.load-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: loadPulse .9s ease-in-out infinite; }
.load-dots span:nth-child(2) { animation-delay: .15s; }
.load-dots span:nth-child(3) { animation-delay: .3s; }

/* V2.1 — pandangan pertama hanya menampilkan satu ayat hasil pengacakan */
.bottom-nav[hidden] { display: none; }
.reveal-screen {
  min-height: calc(100svh - 70px);
  display: grid;
  place-items: center;
  padding-top: 18px;
  padding-bottom: 28px;
}
.single-ayah-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: hidden;
  padding: 32px 22px 22px;
  border: 1px solid #d9cda9;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 4%, rgba(189, 149, 66, .14), transparent 190px),
    linear-gradient(180deg, #fffdf6 0%, #fffefb 58%, #f3f8f5 100%);
  box-shadow: 0 18px 50px rgba(32, 59, 49, .12);
  text-align: center;
  animation: revealAyah .55s ease both;
}
.single-ayah-stage::before,
.single-ayah-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(189, 149, 66, .12);
  border-radius: 50%;
}
.single-ayah-stage::before { top: -105px; left: -95px; }
.single-ayah-stage::after { right: -105px; bottom: -115px; }
.reveal-ornament {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid #d8c48d;
  border-radius: 50%;
  background: #fff8e6;
  color: var(--gold);
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(98, 76, 32, .08);
}
.reveal-kicker {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.single-ayah-stage h1 {
  margin: 8px 0 4px;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.2;
}
.reveal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 17px 0 12px;
  color: var(--gold);
  font-size: 8px;
}
.reveal-divider::before,
.reveal-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, #dcca99);
}
.reveal-divider::after { background: linear-gradient(90deg, #dcca99, transparent); }
.reveal-arabic {
  max-width: 640px;
  margin: 0 auto;
  color: #14231d;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: clamp(31px, 7vw, 43px);
  line-height: 2.05;
  text-align: center;
  text-wrap: balance;
}
.reveal-translation {
  max-width: 590px;
  margin: 15px auto 0;
  color: #46534d;
  font-size: 15px;
  line-height: 1.72;
}
.reveal-assurance {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 21px 0 0;
  padding: 11px 12px;
  border: 1px solid #cfe2d8;
  border-radius: 14px;
  background: rgba(235, 247, 241, .88);
  color: #225b48;
  text-align: left;
}
.reveal-assurance > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.reveal-assurance p { margin: 1px 0 0; font-size: 11px; line-height: 1.45; }
.reveal-continue { margin-top: 14px; }
.reveal-note { margin: 10px 4px 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }

.result-intro {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 2px 11px;
}
.result-check {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 18px rgba(7, 95, 73, .19);
}
.result-intro h2 { margin: 4px 0 2px; font-size: 21px; }
.result-intro p { margin: 0; color: var(--muted); font-size: 12px; }

.mushaf-page {
  margin-top: 8px;
  padding: 14px 13px 12px;
  border: 1px solid #d8cfb1;
  border-radius: 19px;
  background:
    linear-gradient(rgba(255, 254, 248, .95), rgba(255, 254, 248, .95)),
    repeating-linear-gradient(45deg, #f9f0d7 0, #f9f0d7 2px, #fffdf6 2px, #fffdf6 7px);
  color: #1c241f;
  box-shadow: 0 14px 32px rgba(68, 57, 28, .09);
}
.mushaf-page-top, .mushaf-page-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  direction: ltr;
  color: #776e57;
  font-size: 10.5px;
}
.mushaf-page-top { padding-bottom: 10px; border-bottom: 1px solid #e6dec5; }
.mushaf-page-bottom { justify-content: center; padding-top: 10px; border-top: 1px solid #e6dec5; }
.mushaf-text { padding: 10px 2px; direction: rtl; text-align: right; }
.mushaf-surah-title {
  margin: 9px 0 8px;
  padding: 7px 8px;
  border: 1px solid #dcd1b0;
  border-radius: 11px;
  background: #faf4e2;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  text-align: center;
}
.mushaf-surah-title span { display: block; font-size: 21px; line-height: 1.35; }
.mushaf-surah-title small { display: block; margin-top: 2px; color: #776e57; font-family: Inter, system-ui, sans-serif; font-size: 9.5px; }
.mushaf-ayah { display: inline; padding: 4px 2px; border-radius: 9px; line-height: 2.35; }
.mushaf-ayah.selected {
  padding: 6px 5px;
  background: #dff2e8;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  outline: 1px solid rgba(7, 95, 73, .28);
}
.mushaf-arabic { font-family: "Noto Naskh Arabic", "Amiri", serif; font-size: 27px; line-height: 2.15; }
.ayah-number {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  margin: 0 4px;
  border: 1px solid #a9965d;
  border-radius: 50%;
  background: #fffaf0;
  color: #655a3a;
  font-family: Inter, system-ui, sans-serif;
  font-size: 10px;
  vertical-align: middle;
}
.selected-label {
  display: inline-block;
  margin: 0 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  direction: ltr;
  font-family: Inter, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 850;
  vertical-align: middle;
}

.selected-card { border-color: #bfd9cc; box-shadow: 0 10px 30px rgba(7, 95, 73, .08); }
.verse-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.arabic {
  margin: 17px 0 11px;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  direction: rtl;
  text-align: right;
  font-size: 32px;
  line-height: 2.05;
}
.translation { font-size: 16px; line-height: 1.72; }
.context-list { display: grid; gap: 9px; margin-top: 12px; }
.context-ayah { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.context-ayah.current { border-color: #b9d9ca; background: #eef8f3; }
.context-arabic { margin: 7px 0 5px; font-family: "Noto Naskh Arabic", "Amiri", serif; direction: rtl; text-align: right; font-size: 23px; line-height: 1.9; }
.closing-card .btn:first-of-type { margin-top: 15px; }

.page-heading { padding: 4px 2px 2px; }
.page-heading h1 { margin: 8px 0 7px; font-size: 29px; line-height: 1.14; letter-spacing: -.7px; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.guide-list { display: grid; gap: 3px; }
.guide-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e9efeb; }
.guide-item:last-child { border-bottom: 0; }
.guide-item b { display: block; margin-top: 2px; font-size: 14px; }
.guide-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.space-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: 11px; }
.error-card { margin-top: 22px; text-align: center; }
.error-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: #fff0f0; color: var(--danger); font-size: 25px; font-weight: 900; }
.toast { position: fixed; z-index: 99; bottom: 98px; left: 50%; max-width: 86%; padding: 11px 15px; border-radius: 12px; background: #17231f; color: #fff; text-align: center; transform: translateX(-50%); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.nav-btn {
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 7px 3px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #77847e;
  cursor: pointer;
}
.nav-btn span { font-size: 20px; }
.nav-btn small { font-size: 10.5px; }
.nav-btn.active { background: var(--soft); color: var(--primary); font-weight: 850; }

@keyframes loadPulse {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}
@keyframes bookOpenLeft {
  from { transform: rotateY(0); }
  to { transform: rotateY(-62deg) translateX(-5px); }
}
@keyframes bookOpenRight {
  from { transform: rotateY(0); }
  to { transform: rotateY(62deg) translateX(5px); }
}
@keyframes revealAyah {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .screen { padding-right: 13px; padding-left: 13px; }
  .hero { min-height: 315px; padding: 26px 21px 22px; }
  .hero h1 { font-size: 31px; }
  .gate-card { padding: 25px 18px 20px; }
  .gate-card h2 { font-size: 24px; }
  .single-ayah-stage { padding: 26px 17px 19px; }
  .single-ayah-stage h1 { font-size: 22px; }
  .reveal-arabic { font-size: 31px; line-height: 2; }
  .reveal-translation { font-size: 14px; }
  .mushaf-page { padding: 12px 9px; }
  .mushaf-arabic { font-size: 25px; }
  .arabic { font-size: 28px; }
  .selected-label { font-size: 7.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .book-cover.left { transform: rotateY(-62deg) translateX(-5px); }
  .book-cover.right { transform: rotateY(62deg) translateX(5px); }
}
