/* =========================================================================
   style.css — Global Design System, Design Tokens, Reset, Shell Perangkat,
   Navigasi (Topbar & Bottom Tabbar), Sheet, dan Toast.
   Identitas Visual: IIA Indonesia Modern Light UI
   (Navy Blue, Hijau Pucuk / Light Green, Sky Blue, White, Light Gray).
   ========================================================================= */
@import url('fonts.css');

:root {
  /* Palet Utama — Navy Blue (IIA Indonesia) */
  --navy-950: #06152d;
  --navy-900: #0a2246;
  --navy: #003366;
  --navy-700: #004b87;
  --navy-600: #005da6;
  --navy-100: #e5eff9;
  --navy-50: #f2f7fc;

  /* Warna Aksen — Light Green / Hijau Pucuk (IIA Indonesia) */
  --lime: #78be20;
  --lime-bright: #8fd129;
  --lime-d: #436e0d;
  --lime-50: #f1f9e6;

  /* Warna Pendukung — Sky Blue (IIA Indonesia) */
  --sky: #3b97b8;
  --sky-d: #006699;
  --sky-50: #eaf5fa;

  /* Surface & Netral — Clean White & Light Gray */
  --paper: #ffffff;
  --bg: #f6f8fb;
  --bg-subtle: #eff3f8;
  --ink: #111827;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5eaf2;
  --line-2: #cbd5e1;

  /* Status Semantik */
  --ok: #15803d;
  --ok-50: #e8f7ee;
  --warn: #b45309;
  --warn-50: #fef4e2;
  --red: #dc2626;
  --red-d: #b91c1c;
  --red-50: #fef2f2;

  /* Bentuk, Radius & Elevasi (Soft Shadows) */
  --r-card: 16px;
  --r-ctl: 12px;
  --r-sm: 8px;
  --r-pill: 999px;
  --sh1: 0 2px 8px -2px rgba(10, 34, 70, 0.06), 0 4px 16px -4px rgba(10, 34, 70, 0.05);
  --sh2: 0 8px 24px -6px rgba(10, 34, 70, 0.10), 0 2px 6px -1px rgba(10, 34, 70, 0.05);
  --sh-pop: 0 24px 60px -18px rgba(4, 14, 34, 0.45);

  /* Tipografi — Modern Clean Sans-Serif */
  --f-ui: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-sans: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-serif: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);

  /* Skala tampilan default 90% pada desktop */
  --stage-zoom: 0.9;
  --vh-full: calc(100vh / var(--stage-zoom));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--navy-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; letter-spacing: 0.01em; }

/* ---------- Panggung & Perangkat (Stage & Device Shell) ---------- */
.stage {
  zoom: var(--stage-zoom);
  min-height: var(--vh-full);
  display: grid;
  grid-template-columns: minmax(290px, 370px) auto;
  gap: 52px;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background:
    repeating-linear-gradient(-14deg, transparent 0 18px, rgba(120, 190, 32, 0.04) 18px 19.5px),
    radial-gradient(900px 550px at 85% 20%, rgba(0, 102, 153, 0.32), transparent 65%),
    radial-gradient(700px 500px at 15% 80%, rgba(120, 190, 32, 0.12), transparent 60%),
    linear-gradient(160deg, #041226 0%, #0a2547 55%, #061830 100%);
}

/* Panel Mode Demo (Desktop Left Sidebar) */
.demo {
  color: #e2ebf6;
  max-height: calc(var(--vh-full) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}
.demo-in h3 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8fb4dc;
  margin: 20px 0 10px;
}
.demo-brand h2 {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 10px 0 6px;
}
.demo-brand p { color: #b4c6e0; font-size: 13.5px; line-height: 1.45; max-width: 34ch; }
.persona-list, .flow-list { display: grid; gap: 8px; }
.persona {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.persona b { display: block; font-size: 13.5px; font-weight: 700; }
.persona small { display: block; color: #b0c2de; font-size: 12px; line-height: 1.35; }
.persona:hover { background: rgba(255, 255, 255, 0.09); }
.persona.on {
  border-color: var(--lime-bright);
  background: rgba(120, 190, 32, 0.15);
  box-shadow: 0 4px 14px -4px rgba(120, 190, 32, 0.25);
}
.flow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: #e6ecf8;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.flow small {
  color: var(--lime-bright);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(120, 190, 32, 0.14);
}
.flow:hover { background: rgba(255, 255, 255, 0.1); }
.flow.on { border-color: var(--lime-bright); background: rgba(120, 190, 32, 0.14); }
.demo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.demo-foot { margin-top: 16px; font-size: 11.5px; color: #8ea5c8; line-height: 1.45; max-width: 38ch; }

/* Frame Perangkat (Mengikuti Referensi Sample-UI: Bezel Putih Bersih & Modern) */
.device {
  position: relative;
  width: 394px;
  height: min(854px, calc(var(--vh-full) - 48px));
  border-radius: 48px;
  background: #ffffff;
  padding: 10px;
  box-shadow: var(--sh-pop), 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.screen {
  position: relative;
  height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  isolation: isolate;
  border: 1px solid var(--line);
}

/* Statusbar */
.statusbar {
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 700;
  color: #e5eff9;
  background: linear-gradient(180deg, #05142b 0%, #081d3d 100%);
}
.statusbar i { display: flex; gap: 5px; align-items: center; font-style: normal; }
.statusbar i span { width: 15px; height: 8px; border-radius: 2px; background: #ffffff; display: block; opacity: 0.9; }
.statusbar i span:first-child { width: 13px; clip-path: polygon(0 100%, 0 70%, 33% 70%, 33% 40%, 66% 40%, 66% 10%, 100% 10%, 100% 100%); }

/* ---------- Topbar / App Header (Refactored: Dark Navy-to-Navy Gradient) ---------- */
.topbar {
  flex: none;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  background: linear-gradient(135deg, #071936 0%, #002c59 55%, #003366 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px -2px rgba(4, 15, 33, 0.35);
  z-index: 3;
}
.topbar.none { display: none; }
.tb-l, .tb-r { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tb-l { flex: 1; }
.tb-h {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Subpage Header: Judul terpusat dan ikon kembali Hijau Pucuk seperti referensi gbr2.png */
.topbar.subpage {
  position: relative;
}
.topbar.subpage .tb-h {
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
}
.topbar.subpage .tb-l > .icon-btn:first-child {
  color: var(--lime-bright);
}
.topbar.subpage .tb-l > .icon-btn:first-child:hover {
  background: rgba(143, 209, 41, 0.18);
  color: #bbf45a;
}
.topbar.subpage .tb-r .icon-btn {
  color: var(--lime-bright);
}
.topbar.subpage .tb-r .icon-btn:hover {
  background: rgba(143, 209, 41, 0.18);
  color: #bbf45a;
}
.tb-logo {
  height: 36px;
  width: auto;
  max-width: 176px;
  margin-left: 4px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: opacity 0.15s;
}
.tb-logo:hover { opacity: 0.92; }
.wordmark {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: #ffffff;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}
.wordmark b {
  font-weight: 800;
  font-size: 1.1em;
  color: var(--lime-bright);
}
.wordmark.light { color: #fff; }
.wordmark.light b { color: var(--lime-bright); }
.wordmark.big { font-size: 22px; }

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #e5eff9;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.icon-btn:active { transform: scale(0.95); }
.icon-btn.on { color: var(--lime-bright); background: rgba(143, 209, 41, 0.2); }
.icon-btn.on svg { fill: currentColor; }
.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3.5px;
  border-radius: 99px;
  background: #e63946;
  color: #fff;
  font: 800 9.5px/15px var(--f-ui);
  font-style: normal;
  text-align: center;
  border: 2px solid #071936;
  box-sizing: content-box;
  transform: translate(30%, -30%);
}
.ic { flex: none; }

/* ---------- Flowbar (Alur Terpandu) ---------- */
.flowbar { flex: none; background: var(--navy-900); color: #fff; z-index: 2; border-bottom: 1px solid rgba(255,255,255,0.1); }
.flowbar.done { background: var(--ok); }
.fb-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 40px; font-size: 12.5px; font-weight: 600; color: #fff; }
.fb-n { min-width: 30px; height: 22px; border-radius: 11px; background: var(--lime-bright); color: var(--navy-950); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; padding: 0 6px; }
.flowbar.done .fb-n { background: #fff; color: var(--ok); }
.fb-t { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-head .ic { transition: transform 0.2s; }
.flowbar.open .fb-head .ic { transform: rotate(180deg); }
.fb-body { display: none; padding: 0 16px 12px; font-size: 12.5px; }
.flowbar.open .fb-body { display: block; }
.fb-body ol { list-style: none; margin: 8px 0 10px; display: grid; gap: 6px; }
.fb-body li { display: flex; gap: 8px; align-items: center; color: #c5d6ed; }
.fb-body li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #5c7ba6; flex: none; }
.fb-body li.ok { color: #fff; font-weight: 600; }
.fb-body li.ok::before { background: var(--lime-bright) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306152d' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 5 5 9-10'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--lime-bright); }
.fb-body .link { color: var(--lime-bright); }

/* ---------- View & Container Halaman ---------- */
.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  position: relative;
  background: var(--bg);
}
.view::-webkit-scrollbar { display: none; }
.view.in-fwd { animation: inFwd 0.26s var(--ease); }
.view.in-back { animation: inBack 0.24s var(--ease); }
.view.in-tab { animation: inTab 0.18s ease-out; }
@keyframes inFwd { from { transform: translateX(20px); opacity: 0.25; } }
@keyframes inBack { from { transform: translateX(-18px); opacity: 0.25; } }
@keyframes inTab { from { opacity: 0.4; } }

.pad {
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pad > * { flex: none; }
.pad.home { gap: 20px; }

/* ---------- Bottom Navigation (Mengikuti Referensi gbr3.png) ---------- */
.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 6px 6px 10px;
  z-index: 3;
  box-shadow: 0 -4px 16px rgba(10, 34, 70, 0.04);
}
.nonav .tabbar { display: none; }
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  min-height: 48px;
  transition: color 0.18s;
}
.tab-i {
  width: 44px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  transition: background 0.18s, color 0.18s, transform 0.15s;
}
.tab:hover { color: var(--navy-700); }
.tab.on {
  color: var(--sky-d);
  font-weight: 700;
}
.tab.on::before {
  content: '';
  position: absolute;
  top: -6px;
  width: 24px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--lime);
}
.tab.on .tab-i {
  background: var(--sky-50);
  color: var(--sky-d);
}
.tab.on .tab-i svg {
  stroke-width: 2.2;
}
.nonav .view { padding-bottom: 0; }

/* ---------- Lapisan: Bottom Sheet, Side Drawer & Toast ---------- */
.layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.sheet-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(6, 21, 45, 0.5); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: relative;
  width: 100%;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.26s var(--ease);
  box-shadow: 0 -12px 40px -10px rgba(6, 21, 45, 0.28);
}
.sheet::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--line-2);
  margin: 8px auto 0;
  flex: none;
}
.sheet-wrap.side .sheet::before { display: none; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.full .sheet { height: 90%; }
.sheet-wrap.side { align-items: stretch; }
.sheet-wrap.side .sheet {
  width: 92%;
  max-height: none;
  height: 100%;
  border-radius: 0 24px 24px 0;
  transform: translateX(-100%);
}
.sheet-wrap.side.open .sheet { transform: none; }
.sheet-h {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px 20px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}
.sheet-h h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.sheet-b {
  padding: 16px 20px 26px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet-b::-webkit-scrollbar { display: none; }
.sheet-p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.sheet-p b { color: var(--ink); font-weight: 700; }

/* Toast Notification */
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 82px;
  margin: auto;
  width: fit-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--navy-900);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--sh2);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s var(--ease);
}
.toast .ic { color: var(--lime-bright); }
.toast.warn .ic { color: #fbbf24; }
.toast.in { opacity: 1; transform: none; }
.mob-only { display: none; }

/* ---------- Teks Besar ---------- */
.device.bigtext .screen { zoom: 1.12; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  :root { --stage-zoom: 1; --vh-full: 100vh; }
  .stage { zoom: 1; grid-template-columns: auto; padding: 0; gap: 0; min-height: 100dvh; }
  .demo { display: none; }
  .device { width: 100vw; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; background: var(--bg); }
  .screen { border-radius: 0; border: 0; }
  .mob-only { display: inline-grid; }
}
@media (min-width: 961px) and (max-height: 684px) {
  .device { height: calc(var(--vh-full) - 28px); }
  .stage { padding: 14px; }
}
@media (min-width: 521px) and (max-width: 960px) {
  .stage { background: var(--navy-950); place-items: center; padding: 16px; }
  .device { width: min(430px, 100vw); height: min(880px, calc(100dvh - 32px)); margin: auto; border-radius: 40px; padding: 8px; background: #fff; box-shadow: var(--sh-pop); }
  .screen { border-radius: 32px; }
}
@media (max-width: 520px) { .statusbar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
