@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/caveat-700-latin.woff2) format("woff2"); }

:root {
  --bg: #0E100C;
  --surface: #171A13;
  --surface-2: #20241B;
  --line: #2C3125;
  --text: #F2F4EC;
  --text-2: #A7AE9A;
  --lime: #C6F24E;
  --lime-ink: #11160A;
  --lime-soft: #1C2410;
  --warn: #F4B740;
  --warn-soft: #2A2110;
  --danger: #FF7A6B;
  --danger-soft: #2C1512;
  --info: #9DC3FF;
  --radius: 16px;
  --gutter: 16px;
  --nav-h: 64px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
::selection { background: var(--lime); color: var(--lime-ink); }
button, a { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 8px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pill svg { width: 14px; height: 14px; }
.pill[hidden] { display: none; }

/* ---------- Card area ---------- */
.card-zone { --card-w: min(448px, calc(100vw - 2 * var(--gutter))); margin-top: 6px; }
.card-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; color: var(--text-2); font-size: 13px; min-height: 20px; }
.card-hint svg { width: 15px; height: 15px; }
.card-hint .tnum { color: var(--text); font-weight: 600; }

/* ---------- Sections ---------- */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.link { background: none; border: 0; padding: 4px 0; color: var(--lime); font-size: 13.5px; font-weight: 600; }

/* Masa aktif */
.term { margin-top: 20px; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--lime-soft); border: 1px solid #2A3618; }
.term[data-s="akan_habis"] { background: var(--warn-soft); border-color: #3E3116; }
.term[data-s="expired"] { background: var(--danger-soft); border-color: #47201B; }
.term[data-s="belum_aktif"], .term[data-s="tidak_ada"] { background: var(--surface); border-color: var(--line); }
.term-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.term h2 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
.term p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.badge { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--lime); color: var(--lime-ink); }
.badge[data-s="akan_habis"] { background: var(--warn); color: #1E1503; }
.badge[data-s="expired"] { background: var(--danger); color: #2A0B07; }
.badge[data-s="belum_aktif"], .badge[data-s="tidak_ada"] { background: var(--surface-2); color: var(--text); }
.bar { position: relative; height: 8px; margin: 18px 0 10px; border-radius: 99px; background: rgba(242, 244, 236, .12); }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--lime); }
.term[data-s="akan_habis"] .bar-fill { background: var(--warn); }
.term[data-s="expired"] .bar-fill { background: var(--danger); }
.bar-today { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.bar-dates { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.bar-dates b { display: block; color: var(--text); font-weight: 600; font-size: 13px; }
.bar-dates span:last-child { text-align: right; }
.term .btn { margin-top: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 14px; border: 0; font-weight: 650; font-size: 15px; text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--lime); color: var(--lime-ink); }
.btn-primary:active { filter: brightness(.92); }
.btn-ghost { background: var(--surface-2); color: var(--text); }

/* Aksi cepat */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; transition: background-color .15s ease-out, border-color .15s ease-out; }
.action svg { width: 22px; height: 22px; color: var(--lime); }
.action:hover { background: var(--surface-2); }
.action:active { background: var(--surface-2); border-color: #3A4130; }

/* Panel pasang (iOS) */
.install { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.install[hidden] { display: none; }
.install b { color: var(--text); }
.install ol { margin: 8px 0 0; padding-left: 20px; }
.install li + li { margin-top: 4px; }

/* Daftar check-in */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 14px; background: var(--surface); }
.date-chip { display: grid; place-items: center; height: 48px; border-radius: 11px; background: var(--surface-2); line-height: 1; }
.date-chip b { font-size: 18px; font-weight: 700; }
.date-chip span { margin-top: 3px; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.item-main b { display: block; font-size: 14.5px; font-weight: 600; }
.item-main span { font-size: 12.5px; color: var(--text-2); }
.chip { height: 24px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; border: 1px solid #3B4A1E; color: var(--lime); }
.chip[data-m="Manual"] { border-color: var(--line); color: var(--text-2); }
.month { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.empty { padding: 22px 18px; border-radius: 14px; border: 1px dashed var(--line); color: var(--text-2); font-size: 14px; text-align: center; }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.profile-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.profile-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.rows { margin-top: 12px; border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--text); }
.row + .row { border-top: 1px solid var(--line); }
.row > svg:first-child { width: 20px; height: 20px; color: var(--lime); flex: none; }
.row span { flex: 1; }
.row small { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.row .chev { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.note { margin: 14px 4px 0; color: var(--text-2); font-size: 12.5px; }

/* Bottom nav */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 6px max(var(--gutter), calc((100vw - 480px) / 2 + var(--gutter))) calc(env(safe-area-inset-bottom) + 6px);
  background: rgba(14, 16, 12, .94); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
@supports (backdrop-filter: blur(1px)) { .nav { background: rgba(14, 16, 12, .8); backdrop-filter: blur(14px) saturate(1.2); } }
.nav button { height: 52px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.nav svg { width: 22px; height: 22px; }
.nav button[aria-current="page"] { color: var(--lime); }

/* Full-screen states */
.state { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 24px 4px; }
.state-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); color: var(--lime); display: grid; place-items: center; margin-bottom: 18px; }
.state-ico svg { width: 26px; height: 26px; }
.state h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
.state p { margin: 10px 0 22px; color: var(--text-2); font-size: 15px; max-width: 36ch; }
.state .btn + .btn { margin-top: 10px; }
.skeleton { width: var(--card-w); aspect-ratio: 91 / 55; border-radius: calc(3.5 * var(--card-w) / 91); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: sheen 1.4s ease-in-out infinite; }
@keyframes sheen { to { background-position: -150% 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); transform: translate(-50%, 8px); opacity: 0; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; transition: opacity .2s ease-out, transform .2s ease-out; pointer-events: none; z-index: 20; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .toast, .action { transition: none; }
}

/* =================== Kartu hologram (desain bawaan komponen) =================== */
.bc-wrap {
  width: var(--card-w); aspect-ratio: 91 / 55; margin: 0 auto;
  --mm: calc(var(--card-w) / 91); perspective: 1200px;
  touch-action: pan-y; /* scroll vertikal tetap jalan; geser samping / ketuk = tilt & flip */
  font-family: var(--font);
}
.bc-btn {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none;
  border-radius: calc(3.5 * var(--mm)); transform-style: preserve-3d; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  --px: .5; --py: .5; --mx: 50%; --my: 50%; --holo: .12; --fx: .5;
}
.bc-btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
.bc-flipper { position: absolute; inset: 0; display: block; transform-style: preserve-3d; }
.bc-face {
  position: absolute; inset: 0; display: block; overflow: hidden; background: #fff; text-align: left; color: #0B1B33;
  border-radius: calc(3.5 * var(--mm)); backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(0);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 4px 14px rgba(0, 0, 0, .35);
}
.bc-back { transform: rotateY(180deg); opacity: 0; }
.bc-content { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* Foil "shards" + glare (z di atas konten, di bawah QR) */
.bc-foil {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  opacity: calc(var(--holo) * var(--fx) * .6);
  -webkit-mask-image: radial-gradient(farthest-corner circle at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, .4) 55%, transparent 100%);
  mask-image: radial-gradient(farthest-corner circle at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, .4) 55%, transparent 100%);
}
.bc-foil-layer {
  position: absolute; inset: 0;
  background-image: linear-gradient(#5a5a5a, #5a5a5a),
    repeating-linear-gradient(125deg, hsl(185 100% 80%) 0%, hsl(150 90% 80%) 5%, hsl(270 100% 85%) 10%, hsl(330 100% 85%) 15%, hsl(55 100% 82%) 20%, hsl(185 100% 80%) 25%),
    var(--shards);
  background-blend-mode: screen, difference, normal;
  background-size: auto, 300% 300%, 100% 100%;
  background-position: 0 0, var(--mx) var(--my), 0 0;
}
.bc-glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background-image: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, .06) 30%, transparent 60%);
  opacity: calc(var(--holo) * var(--fx));
}

/* Depan: panel langit */
.bc-sky {
  position: relative; display: block; flex: 1; overflow: hidden; color: #fff;
  background:
    radial-gradient(42% 34% at 14% 104%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 72%),
    radial-gradient(36% 30% at 42% 112%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%),
    radial-gradient(40% 32% at 88% 100%, rgba(255, 255, 255, .88), rgba(255, 255, 255, 0) 70%),
    radial-gradient(26% 14% at 72% 26%, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 70%),
    radial-gradient(22% 12% at 30% 18%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 70%),
    radial-gradient(18% 10% at 52% 52%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #2F72D4 0%, #4B91E4 52%, #8CC2F2 100%);
}
.bc-sky-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(5 * var(--mm)) calc(6.5 * var(--mm)) calc(6.5 * var(--mm)); z-index: 1; }
.bc-hello { display: flex; align-items: center; gap: calc(1.6 * var(--mm)); font-size: calc(3 * var(--mm)); font-weight: 500; }
.bc-sky-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: calc(3 * var(--mm)); translate: 0 calc(-3.5 * var(--mm)); }
.bc-headline { display: block; line-height: .85; text-shadow: 0 2px 18px rgba(10, 40, 90, .18); min-width: 0; }
.bc-word { display: block; font-weight: 500; letter-spacing: -0.05em; font-size: calc(12.5 * var(--mm)); }
.bc-script { display: block; font-family: "Caveat", "Bradley Hand", "Segoe Script", cursive; font-weight: 700; font-size: calc(8.075 * var(--mm)); margin: .05em 0 0 .15em; white-space: nowrap; }
.bc-sticker {
  flex: none; width: calc(17 * var(--mm)); aspect-ratio: 1; border-radius: 50%; background: #fff; color: #0B1B33;
  display: grid; place-items: center; font-weight: 700; font-size: calc(5.6 * var(--mm)); letter-spacing: -0.03em;
  rotate: -8deg; box-shadow: inset 0 0 0 calc(.8 * var(--mm)) #E4EEFB; filter: drop-shadow(0 6px 10px rgba(10, 40, 90, .3));
}
.bc-melt { position: absolute; left: 0; right: 0; bottom: -1px; height: calc(6 * var(--mm)); background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .55) 60%, #fff 100%); }
.bc-strip { flex: none; height: calc(10 * var(--mm)); padding: 0 calc(6.5 * var(--mm)); display: flex; align-items: center; justify-content: space-between; }
.bc-strip-l { display: flex; align-items: center; gap: .4em; font: 600 calc(2.3 * var(--mm)) / 1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: .03em; color: #111; text-transform: uppercase; }
.bc-muted { font-weight: 400; color: #6B7280; }
.bc-dot { width: .8em; height: .8em; border-radius: 50%; background: #22A35A; }
.bc-dot[data-s="akan_habis"] { background: #E59A12; }
.bc-dot[data-s="expired"] { background: #D9412E; }
.bc-dot[data-s="belum_aktif"], .bc-dot[data-s="tidak_ada"] { background: #9AA3B2; }
.bc-strip-r { display: flex; align-items: center; gap: .35em; font-weight: 600; font-size: calc(2.3 * var(--mm)); color: #387FD9; }
.bc-ico-inline { width: 1.15em; height: 1.15em; stroke-width: 2.2; }

/* Belakang */
.bc-topline { position: absolute; left: 0; right: 0; top: 0; height: calc(1.6 * var(--mm)); background: linear-gradient(90deg, #387FD9, #6DB0EC, #387FD9); }
.bc-back-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: calc(6 * var(--mm)) calc(6.5 * var(--mm)); gap: calc(5 * var(--mm)); }
.bc-info { display: block; min-width: 0; }
.bc-name { display: block; font-weight: 700; letter-spacing: -0.03em; font-size: calc(5.2 * var(--mm)); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-code { display: block; margin-top: calc(1 * var(--mm)); font-size: calc(2.7 * var(--mm)); letter-spacing: .08em; color: #5B6B82; font-weight: 500; font-variant-numeric: tabular-nums; }
.bc-tag { display: block; margin-top: calc(1.2 * var(--mm)); font-size: calc(2.5 * var(--mm)); font-weight: 600; color: #387FD9; }
.bc-sub { display: block; margin-top: calc(.5 * var(--mm)); font-size: calc(2 * var(--mm)); color: #387FD9; opacity: .85; font-weight: 500; }
.bc-rows { display: grid; gap: calc(1.2 * var(--mm)); margin-top: calc(3.2 * var(--mm)); font-size: calc(2.35 * var(--mm)); font-weight: 500; }
.bc-row { display: flex; align-items: center; gap: calc(1.4 * var(--mm)); }
.bc-ico { width: calc(2.6 * var(--mm)); height: calc(2.6 * var(--mm)); color: #387FD9; flex: none; }
.bc-qrbox { position: relative; z-index: 3; display: block; width: calc(30 * var(--mm)); padding: calc(1.2 * var(--mm)); border-radius: calc(4 * var(--mm)); background: #F3F7FD; }
.bc-qr { display: block; aspect-ratio: 1; }
.bc-qr svg { display: block; width: 100%; height: 100%; }
.bc-qr-logo {
  position: absolute; left: 50%; top: calc(1.2 * var(--mm) + (30 * var(--mm) - 2.4 * var(--mm)) / 2); translate: -50% -50%;
  width: calc(7.4 * var(--mm)); height: calc(7.4 * var(--mm)); border-radius: 30%; background: #fff; color: #0B1B33;
  display: grid; place-items: center; box-shadow: 0 0 0 calc(.6 * var(--mm)) #F3F7FD;
}
.bc-qr-logo svg { width: 70%; height: 70%; stroke-width: 2.4; }
.bc-qr-cap { display: block; margin-top: calc(1.2 * var(--mm)); text-align: center; font-weight: 600; font-size: calc(1.9 * var(--mm)); color: #5B6B82; }
.bc-qr-cap2 { display: block; margin-top: calc(.3 * var(--mm)); font-size: calc(1.6 * var(--mm)); font-weight: 500; font-variant-numeric: tabular-nums; }
