:root {
  --bg-top: #06152d;
  --bg-mid: #0d2f60;
  --bg-bottom: #123f7c;
  --nav: #051326;
  --card: linear-gradient(180deg, rgba(4, 20, 43, 0.96), rgba(4, 27, 59, 0.92));
  --card-soft: linear-gradient(180deg, rgba(5, 25, 54, 0.9), rgba(6, 31, 67, 0.86));
  --line: rgba(109, 183, 255, 0.18);
  --line-strong: rgba(109, 183, 255, 0.34);
  --text: #eef6ff;
  --muted: #c9dbf6;
  --accent: #3db4ff;
  --accent-soft: rgba(61, 180, 255, 0.14);
  --yes-a: #38d39f;
  --yes-b: #23bb8e;
  --no-a: #f2a2a6;
  --no-b: #ff7d1e;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --wrap: min(1280px, calc(100% - 36px));
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(120, 190, 255, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 38%, var(--bg-bottom) 100%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
  filter: blur(20px);
  background: radial-gradient(circle, rgba(61, 180, 255, 0.14), transparent 65%);
}

.page-glow-left {
  top: 110px;
  left: -180px;
}

.page-glow-right {
  right: -180px;
  bottom: 80px;
}

.navbar,
.hero-full,
.layout-shell,
.smart-footer {
  position: relative;
  z-index: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 16, 34, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

@media (max-width: 768px) {
  .navbar {
    position: static;
    top: auto;
  }
}

.nav-container {
  width: var(--wrap);
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.logo {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-brand{
  text-decoration:none;
  color:inherit;
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.nav-brand-glass{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:16px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12);
  box-shadow:0 12px 30px rgba(0,0,0,0.22);
}

.nav-brand-icon{
  width:22px;
  height:22px;
  border-radius:8px;
  display:block;
  flex-shrink:0;
  object-fit:contain;
}

.nav-brand-text{
  font-weight:800;
  letter-spacing:0.01em;
  white-space:nowrap;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

/* Mobile / tablet kecil: panel membungkus menu + bahasa */
.nav-panel {
  margin-left: auto;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  position: static;
  min-height: 56px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 6px 10px;
  flex-wrap: wrap;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  z-index: 2;
  max-width: min(72vw, 720px);
}

/* Desktop: grid 1fr | auto | 1fr + display:contents → kotak glass benar-benar di tengah (bukan hanya geometri kontainer) */
@media (min-width: 861px) {
  .nav-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 16px;
    min-height: 78px;
  }

  .nav-panel {
    display: contents;
    margin-left: 0;
    flex: unset;
    min-height: 0;
  }

  .nav-brand {
    grid-column: 1;
    justify-self: start;
    align-self: center;
  }

  .nav-toggle {
    display: none;
  }

  .nav-menu {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    max-width: min(94vw, 980px);
  }

  .lang-switch {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    margin-left: 0;
    margin-right: 0;
  }

  html[lang="id"] .navbar .nav-menu,
  html[lang="en"] .navbar .nav-menu,
  html[lang="ar"] .navbar .nav-menu {
    flex-wrap: nowrap;
    justify-content: center;
  }

  html[lang="id"] .navbar .nav-menu a,
  html[lang="en"] .navbar .nav-menu a,
  html[lang="ar"] .navbar .nav-menu a {
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0 7px 0 9px;
    min-height: 34px;
  }
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
  color: #e8f2ff;
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 3;
}

.lang-switch button {
  min-width: 46px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e6f1ff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.lang-switch button.active {
  background: linear-gradient(180deg, #4ac0ff, #2495eb);
  color: #041425;
  box-shadow: 0 8px 18px rgba(36, 149, 235, 0.35);
}

.hero-full {
  padding: 84px 0 40px;
}

.hero-shell,
.layout-shell {
  width: var(--wrap);
  margin: 0 auto;
}

.hero-shell {
  text-align: center;
}

.hero-badge,
.section-kicker,
.insight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #dceeff;
  background: linear-gradient(180deg, rgba(67, 143, 214, 0.28), rgba(45, 104, 171, 0.22));
  border: 1px solid rgba(137, 205, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hero h1 {
  margin: 18px 0 18px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: #edf4ff;
}

.hero p {
  width: min(980px, 100%);
  margin: 0 auto;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.95;
  color: rgba(238, 246, 255, 0.94);
}

.hero-stats {
  width: min(920px, 100%);
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card,
.engine-card,
.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-card {
  border-radius: 22px;
  padding: 20px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
  color: #fff;
}

.stat-card span {
  color: var(--muted);
}

.layout-shell {
  padding: 6px 0 74px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.84fr);
  gap: 24px;
  align-items: start;
}

.engine-column,
.info-column {
  min-width: 0;
}

.engine-card,
.info-card {
  border-radius: var(--radius-xl);
}

.engine-primary-card {
  padding: 34px;
}

.engine-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.engine-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  line-height: 1.2;
}

.step-text {
  flex-shrink: 0;
  padding-top: 6px;
  color: #d2e7ff;
  font-size: 1rem;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 30px;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #49c1ff, #78d6ff);
  transition: width 0.25s ease;
}

.question-box,
.result-box {
  border-radius: 24px;
  padding: 34px 36px;
  background: linear-gradient(180deg, rgba(7, 35, 75, 0.88), rgba(8, 32, 67, 0.86));
  border: 1px solid rgba(104, 177, 252, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.question-mark {
  display: none;
}

.question-title {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.75;
  color: #f3f8ff;
}

.answer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.btn-answer,
.btn-reset {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.btn-answer:hover,
.btn-reset:hover,
.btn-answer:focus-visible,
.btn-reset:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn-answer {
  min-height: 60px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #062033;
}

.btn-yes {
  background: linear-gradient(90deg, var(--yes-a), var(--yes-b));
  box-shadow: 0 10px 24px rgba(35, 187, 142, 0.22);
}

.btn-no {
  background: linear-gradient(90deg, var(--no-a), var(--no-b));
  box-shadow: 0 10px 24px rgba(255, 125, 30, 0.18);
}

.result-box {
  display: none;
}

.result-box h3 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.result-line {
  margin: 0;
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 16px;
  align-items: start;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.result-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.result-line strong {
  color: #fff1ba;
}

.result-line span {
  color: #edf5ff;
  line-height: 1.8;
}

.reset-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.btn-reset {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(70, 108, 162, 0.34), rgba(57, 89, 134, 0.28));
  border: 1px solid rgba(156, 206, 255, 0.22);
  color: var(--text);
}

.info-column {
  display: grid;
  gap: 20px;
}

.info-card {
  padding: 24px 24px 22px;
  background: var(--card-soft);
}

.info-card h3 {
  margin: 14px 0 12px;
  font-size: 1.12rem;
  line-height: 1.32;
  color: #fff2c4;
}

.info-card p,
.smart-method-list {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.smart-method-list {
  padding-left: 22px;
}

.smart-method-list li + li {
  margin-top: 8px;
}

.smart-footer {
  padding: 26px 18px 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  color: #deebff;
}

.smart-footer p {
  margin: 0;
  font-size: 0.98rem;
}

html[lang="ar"] body,
body.rtl-mode {
  font-family: "Inter", "Amiri", "Segoe UI", Arial, sans-serif;
}

html[lang="ar"] .hero,
html[lang="ar"] .engine-card,
html[lang="ar"] .info-card,
html[lang="ar"] .smart-footer,
body.rtl-mode .hero,
body.rtl-mode .engine-card,
body.rtl-mode .info-card,
body.rtl-mode .smart-footer {
  direction: rtl;
}

html[lang="ar"] .nav-container,
body.rtl-mode .nav-container {
  direction: rtl;
}

html[lang="ar"] .nav-panel,
body.rtl-mode .nav-panel {
  margin-left: 0;
  margin-right: auto;
}

html[lang="ar"] .result-line,
body.rtl-mode .result-line {
  grid-template-columns: 1fr minmax(120px, 170px);
}

html[lang="ar"] .result-line strong,
body.rtl-mode .result-line strong {
  order: 2;
}

html[lang="ar"] .result-line span,
body.rtl-mode .result-line span {
  order: 1;
}

html[lang="ar"] .smart-method-list,
body.rtl-mode .smart-method-list {
  padding-left: 0;
  padding-right: 22px;
}

.scroll-to-top{
  position: fixed;
  left: 18px;
  bottom: 26px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.scroll-to-top svg{
  width: 16px;
  height: 16px;
}

.scroll-to-top.show{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.35),
    0 6px 14px rgba(239,68,68,0.45);
}

.scroll-to-top:active{
  transform: scale(0.96);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1080px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .info-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  /* Mobile: tanpa menu samping/hamburger — urutan: logo+glass → link nav → bar bahasa (pipih) */
  .nav-toggle {
    display: none !important;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    flex-wrap: nowrap;
    padding-top: 12px;
    padding-bottom: 14px;
    min-height: 0;
  }

  .nav-brand {
    width: 100%;
    justify-content: center;
  }

  .nav-brand-glass {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 16px;
  }

  .nav-panel {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    min-height: 0;
  }

  .nav-panel.open {
    display: flex !important;
  }

  html[lang="ar"] .nav-panel,
  body.rtl-mode .nav-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .nav-menu {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    max-width: none !important;
    width: 100%;
    z-index: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
    margin: 0;
    list-style: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .nav-menu li {
    width: auto;
    min-width: 0;
  }

  .nav-menu a {
    justify-content: center;
    width: 100%;
    padding: 12px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
    box-sizing: border-box;
  }

  .lang-switch {
    align-self: stretch;
    margin-top: 0;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
  }

  .layout-shell aside.info-column {
    display: none !important;
  }

  .hero-full {
    padding-top: 56px;
  }

  .hero-stats,
  .info-column {
    grid-template-columns: 1fr;
  }

  .engine-card {
    padding: 20px;
  }

  .scroll-to-top{
    position: fixed;
    left: 18px;
    bottom: 26px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1200;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .scroll-to-top svg{
    width: 16px;
    height: 16px;
  }

  .scroll-to-top.show{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .scroll-to-top:hover{
    transform: translateY(-2px);
    box-shadow:
      0 10px 22px rgba(0,0,0,0.35),
      0 6px 14px rgba(239,68,68,0.45);
  }

  .scroll-to-top:active{
    transform: scale(0.95);
  }

  .question-box,
  .result-box {
    padding: 24px 22px;
  }

  .question-title {
    line-height: 1.65;
  }

  .answer-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .scroll-to-top{
    left: 16px;
    bottom: 20px;
  }
}

@media (max-width: 560px) {
  :root {
    --wrap: min(100% - 22px, 100% - 22px);
  }

  .nav-container {
    min-height: 70px;
  }

  .logo {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }

  .hero p {
    font-size: 0.98rem;
    line-height: 1.8;
  }

  .engine-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .step-text {
    padding-top: 0;
  }

  .question-title {
    font-size: 1.16rem;
  }

  .btn-answer {
    min-height: 56px;
    font-size: 1rem;
  }

  .result-line {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  html[lang="ar"] .result-line,
  body.rtl-mode .result-line {
    grid-template-columns: 1fr;
  }
}
