/* =========================================================================
   ASTRA ZONE: sistem desain bersama (store + panel admin)

   Design Read: toko digital pribadi (paket aplikasi, akun, jasa) untuk
   pembeli muda di HP, bahasa visual poster esports-komik.
   Dial store: ENERGY 3 / RHYTHM 3 / MOTION 3. Dial admin: ENERGY 2 / RHYTHM 1 / MOTION 1.

   Alasan keputusan (R-31):
   - Warna: kobalt + cyan diambil dari logo ASTRA dan poster referensi;
     magenta satu-satunya aksen, hanya di bayangan keras fokus dan tanda larangan.
   - Font merek: Russo One, paling dekat dengan bobot tebal dan sudut membulat
     logo ASTRA. Font isi: Plus Jakarta Sans, buatan foundry Jakarta, enak dibaca
     di layar kecil.
   - Motif identitas: "pelat miring" (skew -10deg) dengan bayangan keras,
     dipakai di wordmark, tombol utama, tab aktif, dan transisi menu.
   - Bayangan keras hanya pada elemen fokus (wordmark, tombol utama, lembar
     detail) sebagai penanda elevasi; kartu biasa tetap datar.
   - Radius: 4px kontrol, 8px panel, 0 untuk pelat miring. Tidak ada pil.
   - Tema tetap gelap kobalt karena identitas merek (logo dan maskot) berwarna
     kobalt, bukan karena tren.
   ========================================================================= */

@font-face { font-family: "Russo One"; src: url("/fonts/russo-one.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/jakarta-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/jakarta-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/jakarta-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --ink: #060D2E;
  --ink-2: #0B1745;
  --ink-3: #12215C;
  --cobalt: #1838E6;
  --cobalt-deep: #0B1FA8;
  --cyan: #2EE6FF;
  --magenta: #FF2E93;
  --white: #FFFFFF;
  --muted: #B7C4F0;
  --line: #5C78E8;        /* batas kontrol interaktif, >= 3:1 di ink-3 */
  --line-soft: #2C45A8;   /* pemisah dekoratif saja */
  --ok: #6CF2C2;
  --warn: #FF8FB8;

  --font-brand: "Russo One", "Arial Black", Impact, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-ctrl: 4px;
  --r-panel: 8px;
  --slant: -10deg;
  --unslant: 10deg;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --fast: 140ms;

  --header-h: 60px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

/* Latar dasar: gradien kobalt satu arah meniru pencahayaan poster (terang di
   titik fokus maskot, gelap ke bawah). Fungsinya hierarki: atas = sapaan,
   bawah = katalog yang tenang. */
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--white);
  background:
    radial-gradient(120% 70% at 75% 12%, #2C4DFF 0%, #1838E6 30%, #0B1FA8 62%, #060D2E 100%) fixed;
  overflow-x: clip;
}

html.is-locked, html.is-locked body { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--white); }

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

h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }

/* Kursor sebagai penanda bisa diklik (R-39), dipasang sekali di lapisan dasar */
a[href], button:not(:disabled), summary, select:not(:disabled), label[for],
input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled),
[role="tab"], [role="button"] { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled,
[aria-disabled="true"] { cursor: not-allowed; }

/* Indikator fokus putih: >= 5:1 di kobalt, ink, dan cyan-adjacent area (R-32) */
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 999;
  padding: 10px 16px; background: var(--white); color: var(--ink);
  font-weight: 800; text-decoration: none; border-radius: var(--r-ctrl);
}
.skip-link:focus { top: 12px; }

/* ---------- Latar beranimasi (canvas) ---------- */
.bg-canvas {
  position: fixed; inset: 0; z-index: -1;
  width: 100vw; height: 100vh; height: 100lvh;
  pointer-events: none;
}

/* ---------- Wordmark ASTRA ZONE ---------- */
/* Muka putih dengan kilau biru muda diagonal + ekstrusi biru tua, meniru
   perlakuan logo ASTRA. drop-shadow dipakai karena text-shadow menimpa isi
   gradien teks. */
.wordmark {
  font-family: var(--font-brand);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.95;
  color: var(--white);
  background: linear-gradient(118deg, #FFFFFF 0 36%, #CFE0FF 36% 50%, #FFFFFF 50% 68%, #CFE0FF 68% 76%, #FFFFFF 76%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #0B1FA8) drop-shadow(0 2px 0 #0B1FA8) drop-shadow(0 2px 0 #071584);
}
.wordmark-line { display: block; }

/* ---------- Tombol ---------- */
.btn {
  --btn-bg: var(--ink-2);
  --btn-fg: var(--white);
  --btn-bd: var(--white);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px;
  border: 2px solid var(--btn-bd);
  border-radius: var(--r-ctrl);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-body); font-weight: 800; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; text-align: center;
  transition: transform var(--fast) var(--ease), background-color var(--fast) ease, color var(--fast) ease, box-shadow var(--fast) var(--ease), border-color var(--fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--white); color: var(--ink); }
.btn:active { transform: translateY(2px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; box-shadow: none; transform: none; }
.btn:disabled:hover { background: var(--btn-bg); color: var(--btn-fg); }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Tombol utama: pelat miring cyan + bayangan keras magenta (motif identitas).
   Hanya satu per layar sebagai titik fokus aksi. */
.btn-primary {
  --btn-bg: var(--cyan);
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  transform: skewX(var(--slant));
  box-shadow: 4px 4px 0 var(--magenta);
  font-family: var(--font-brand); font-weight: 400; font-size: 1rem; letter-spacing: 0.01em;
  padding-inline: 22px;
}
.btn-primary > * , .btn-primary .btn-label { transform: skewX(var(--unslant)); display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: var(--white); color: var(--ink); transform: skewX(var(--slant)) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--magenta); }
.btn-primary:active { transform: skewX(var(--slant)) translate(2px, 2px); box-shadow: 1px 1px 0 var(--magenta); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { transform: skewX(var(--slant)); }
.btn-primary:disabled:hover { background: var(--cyan); color: var(--ink); }

.btn-ghost { --btn-bg: transparent; --btn-bd: var(--line); }
.btn-ghost:hover { background: var(--ink-3); color: var(--white); border-color: var(--white); }

.btn-danger { --btn-bg: transparent; --btn-fg: var(--warn); --btn-bd: var(--warn); }
.btn-danger:hover { background: var(--warn); color: var(--ink); }

.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border: 2px solid var(--line); border-radius: var(--r-ctrl);
  background: var(--ink-2); color: var(--white);
  transition: background-color var(--fast) ease, border-color var(--fast) ease, transform var(--fast) ease;
}
.icon-btn:hover { background: var(--ink-3); border-color: var(--white); }
.icon-btn:active { transform: translateY(2px); }
.icon-btn:disabled { opacity: 0.45; }
.icon-btn:disabled:hover { background: var(--ink-2); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Chip filter & tag ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--line); border-radius: var(--r-ctrl);
  background: var(--ink-2); color: var(--white);
  font-weight: 700; font-size: 0.9rem;
  transition: background-color var(--fast) ease, color var(--fast) ease, border-color var(--fast) ease;
}
.chip:hover { border-color: var(--white); }
.chip[aria-pressed="true"] { background: var(--cyan); color: var(--ink); border-color: var(--cyan); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 3px;
  font-size: 0.78rem; font-weight: 800; line-height: 1.3;
  background: var(--ink-3); color: var(--muted); border: 1.5px solid var(--line-soft);
}
.tag-ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.tag-warn { color: var(--warn); border-color: var(--warn); background: transparent; }
.tag-info { color: var(--cyan); border-color: var(--cyan); background: transparent; }
.tag-sample { background: var(--magenta); color: var(--ink); border-color: var(--magenta); }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; }
.field-label { font-weight: 800; font-size: 0.9rem; color: var(--white); }
.field-hint { font-size: 0.82rem; color: var(--muted); }
.field-error { font-size: 0.85rem; font-weight: 700; color: var(--warn); }
.req { color: var(--warn); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--ink-3); color: var(--white);
  border: 2px solid var(--line); border-radius: var(--r-ctrl);
  font-size: 1rem; /* 16px: mencegah zoom otomatis iOS */
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.85; }
.input:hover, .select:hover, .textarea:hover { border-color: #8EA4F5; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--warn); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--white) 50%), linear-gradient(135deg, var(--white) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }

.check {
  display: flex; align-items: flex-start; gap: 10px;
  min-height: 44px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: var(--r-ctrl);
  background: var(--ink-3); font-weight: 700; font-size: 0.92rem;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cyan); flex: none; }

/* ---------- Status ---------- */
.state-box {
  display: grid; gap: 10px; justify-items: start;
  padding: 22px 18px;
  background: var(--ink-2);
  border: 2px dashed var(--line); border-radius: var(--r-panel);
}
.state-title { font-family: var(--font-brand); font-weight: 400; font-size: 1.15rem; }
.state-text { color: var(--muted); max-width: 60ch; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-ctrl);
  font-weight: 700; font-size: 0.92rem;
  border: 2px solid currentColor;
}
.alert-error { color: var(--warn); background: #2A0F33; }
.alert-ok { color: var(--ok); background: #08302A; }
.alert-info { color: var(--cyan); background: var(--ink-2); }
.alert .alert-body { color: var(--white); font-weight: 600; }

.loading-line { display: flex; align-items: center; gap: 12px; padding: 18px; font-weight: 700; color: var(--cyan); background: var(--ink-2); border: 2px solid var(--line-soft); border-radius: var(--r-panel); }
.loading-bar { width: 46px; height: 10px; flex: none; background: repeating-linear-gradient(120deg, var(--cyan) 0 8px, transparent 8px 14px); background-size: 28px 100%; animation: loadSlide 0.6s linear infinite; transform: skewX(var(--slant)); }
@keyframes loadSlide { to { background-position: 28px 0; } }

/* Pita mode demo: jujur bahwa data belum terhubung ke Supabase */
.demo-ribbon {
  position: relative; z-index: 60;
  padding: 8px 14px; text-align: center;
  background: var(--magenta); color: var(--ink);
  font-weight: 800; font-size: 0.85rem;
}

/* ---------- Lembar (modal / bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 7, 26, 0.78);
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  position: relative;
  width: 100%; max-height: 94dvh;
  display: flex; flex-direction: column;
  background: var(--ink-2);
  border-top: 3px solid var(--cyan);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  animation: sheetUp 260ms var(--ease) both;
}
.sheet-backdrop.is-closing .sheet { animation: sheetDown 180ms ease-in both; }
.sheet-backdrop.is-closing { animation: fadeOut 180ms ease-in both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetDown { to { transform: translateY(40px); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 2px solid var(--line-soft);
  background: var(--ink-2);
}
.sheet-title { flex: 1; min-width: 0; font-family: var(--font-brand); font-weight: 400; font-size: 1.15rem; overflow-wrap: anywhere; }
.sheet-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; }
.sheet-foot {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
  padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 2px solid var(--line-soft); background: var(--ink-2);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + var(--safe-b)); z-index: 400;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 24px);
  padding: 12px 16px;
  background: var(--white); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--r-ctrl);
  box-shadow: 4px 4px 0 var(--magenta);
  font-weight: 800; font-size: 0.92rem;
}
.toast { opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast:empty { padding: 0; border: 0; box-shadow: none; }
.toast.is-show { opacity: 1; pointer-events: auto; }
.toast.is-error { box-shadow: 4px 4px 0 var(--warn); }

/* ---------- Transisi pindah menu: sapuan pelat miring ---------- */
.wipe { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.wipe[hidden] { display: none; }
.wipe-bar { position: absolute; top: -10%; bottom: -10%; left: -20%; width: 140%; transform: translateX(-120%) skewX(-14deg); }
.wipe-bar.b1 { background: var(--cyan); }
.wipe-bar.b2 { background: var(--cobalt); border-left: 10px solid var(--magenta); border-right: 10px solid var(--magenta); }

@keyframes panelEnter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.is-entering { animation: panelEnter 320ms var(--ease) both; }

/* ---------- Ikon brand ---------- */
.brand-tile {
  --tile: 44px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--tile); height: var(--tile); border-radius: calc(var(--tile) * 0.24);
  color: #FFFFFF; background: var(--ink-3); overflow: hidden;
}
.brand-tile svg { width: 56%; height: 56%; }
.brand-tile.has-img { background: var(--white); }
.brand-tile img { width: 100%; height: 100%; object-fit: cover; }
/* Logo hitam (TikTok, X, Threads) diberi garis tipis supaya tepinya terlihat di latar gelap */
.brand-tile.is-tiktok, .brand-tile.is-x, .brand-tile.is-threads { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.brand-tile.is-instagram { background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%); }

/* ---------- Gerak: hormati preferensi pengguna ---------- */
@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; }
}
html[data-motion="off"] .spin-slow { animation-play-state: paused !important; }

/* ---------- Varian lembar ---------- */
.sheet-small { max-width: 460px; }
.confirm-text { color: var(--white); font-weight: 600; }
.foot-note { flex: 1 1 100%; margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--warn); }
.sheet-light .sheet-body { padding: 10px; }

@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 620px; max-height: 88dvh; border-radius: var(--r-panel); border: 3px solid var(--ink); border-top: 3px solid var(--cyan); box-shadow: 8px 8px 0 var(--magenta); }
  .sheet-wide { max-width: 760px; }
  .sheet-small { max-width: 460px; }
}

/* ---------- Tombol tambahan ---------- */
.btn-light { --btn-bg: var(--white); --btn-fg: var(--ink); --btn-bd: var(--white); }
.btn-light:hover { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }
.btn .brand-tile { --tile: 24px; }

/* ---------- Label warna (teks selalu terbaca, arti dibawa teks) ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tone-green { background: #0E3B2E; color: #8CF5CF; border-color: #2E9C77; }
.tone-yellow { background: #3A3110; color: #FFE27A; border-color: #A88E2A; }
.tone-red { background: #3F1027; color: #FFB0CD; border-color: #B8466F; }
.tone-blue { background: #0E2A57; color: #9CD6FF; border-color: #3C7BD0; }
.tone-purple { background: #2C1452; color: #D6B8FF; border-color: #7D52C9; }
.tone-neutral { background: var(--ink-3); color: var(--muted); border-color: var(--line-soft); }

/* ---------- Daftar centang & larangan ---------- */
.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; }
.tick-list svg { flex: none; margin-top: 3px; color: var(--cyan); }
.rules { padding: 14px 16px; background: #2A0F33; border: 2px solid var(--magenta); border-radius: var(--r-panel); }
.rules-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-brand); font-weight: 400; font-size: 1.02rem; color: #FF7AB8; margin-bottom: 8px; }
.rules ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.rules li { color: var(--white); }

/* ---------- Verifikasi & jebakan bot ---------- */
.ts-slot { min-height: 65px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Layar blokir alat inspeksi ---------- */
html.is-blocked body { background: var(--ink); }
.blocked { min-height: 100dvh; display: grid; place-content: center; gap: 12px; padding: 32px 20px; text-align: center; max-width: 520px; margin: 0 auto; }
.blocked-title { font-family: var(--font-brand); font-weight: 400; font-size: 1.8rem; color: var(--warn); }
.noscript { padding: 24px; text-align: center; font-weight: 700; }
