:root {
  --blue-900: #061237;
  --blue-800: #0b2c6c;
  --blue-700: #123d7a;
  --blue-600: #1a62b5;
  --blue-500: #2f8ee0;
  --panel: #f4f4f4;
  --panel-line: #e3e3e3;
  --text: #1a5a8a;
  --section: #4f4f4f;
}

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

html,
body {
  width: 100%;
  min-height: 100dvh;
}

html {
  background: linear-gradient(180deg, #1a62b5 0%, #0b3a86 38%, #061237 100%);
  background-attachment: fixed;
}

body {
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  background: #f7f7f7;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 0 18px;
  font-size: 18px;
  color: #3a3a3a;
}

.title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #1c6bb7;
}

.badge {
  justify-self: end;
  width: 22px;
  height: 22px;
  background: #9ad200;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 22px 16px 86px;
}

.menu-card {
  width: min(600px, 100%);
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid #d0d0d0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.menu-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f8f8f8, #f0f0f0);
  border-bottom: 1px solid var(--panel-line);
}

.menu-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: transparent;
  display: grid;
  place-items: center;
}

.menu-icon img {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
}

.menu-title {
  font-size: 26px;
  font-weight: 700;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-size: 22px;
  font-weight: 600;
  border-bottom: 1px solid var(--panel-line);
  background: #fff;
}

.menu-button {
  width: 100%;
  border: none;
  text-align: left;
  color: inherit;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

.menu-button:active {
  filter: brightness(0.95);
}

.menu-section {
  padding: 10px 18px;
  background: #565656;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.chev {
  color: #1a7ac6;
  font-size: 28px;
}

.bottom-nav {
  height: 76px;
  background: #f6f6f6;
  border-top: 1px solid #dedede;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  text-align: center;
  font-size: 12px;
  color: #7a7a7a;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.nav-item {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.qris-button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: #7a7a7a;
}

.nav-center {
  transform: translateY(-8px);
}

.qris-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2f8ee0 0%, #0f53a6 60%, #0a3f8c 100%);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.25);
}

.qris-icon {
  width: 26px;
  height: 26px;
  fill: #eaf4ff;
}

.nav-item.active {
  color: #1a7ac6;
  font-weight: 700;
}

.nav-item.active .nav-icon {
  fill: #1a7ac6;
}

.camera-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 80;
}

.camera-backdrop[hidden] {
  display: none;
}

.camera-frame {
  width: min(520px, 92vw);
  height: min(720px, 78vh);
  background: #0b1a33;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: #e9f4ff;
  background: rgba(0, 0, 0, 0.35);
  font-weight: 600;
}

.camera-close {
  background: none;
  border: none;
  color: #e9f4ff;
  font-size: 18px;
  cursor: pointer;
}

.camera-video {
  width: 100%;
  height: calc(100% - 48px);
  object-fit: cover;
  background: #000;
}

.camera-guide {
  position: absolute;
  inset: 90px 40px 120px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 60;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(520px, 90vw);
  min-height: 520px;
  background: #f6f6f6;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  padding: 18px 22px 20px;
  color: #1a5a8a;
}

.modal-header {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.modal-body {
  font-size: 20px;
  line-height: 1.4;
  white-space: pre-line;
  flex: 1;
}

.modal-ok {
  margin-top: 16px;
  height: 52px;
  border-radius: 14px;
  border: none;
  font-size: 22px;
  font-weight: 600;
  color: #e8f3ff;
  background: linear-gradient(180deg, #2f8ee0 0%, #0f53a6 55%, #0a3f8c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 6px 12px rgba(3, 18, 44, 0.35);
  cursor: pointer;
}

.modal-ok:active {
  transform: translateY(1px);
}

.loading-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 70;
}

.loading-backdrop[hidden] {
  display: none;
}

.loading-card {
  width: 240px;
  height: 140px;
  background: #ffffff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(10, 90, 170, 0.2);
  border-top-color: #1a7ac6;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 16px;
  color: #2b2b2b;
  letter-spacing: 0.4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .topbar {
    height: 64px;
    font-size: 16px;
  }

  .title {
    font-size: 22px;
  }

  .menu-card {
    width: 100%;
  }

  .menu-item {
    font-size: 18px;
  }
}
