/* HK Generate — tema gelap digital */
:root {
  --bg: #070a14;
  --bg2: #0b1020;
  --panel: #0e1428;
  --panel2: #131b36;
  --field: #0a0f21;
  --line: #1f2a4d;
  --line-soft: rgba(124, 140, 255, .14);
  --ink: #e9edfb;
  --muted: #8a95bd;
  --iris: #7766ff;
  --iris-d: #5d4cf0;
  --cyan: #3ad8ff;
  --amber: #ffb347;
  --ok: #4fe3a0;
  --bad: #ff6b7a;
  --r: 10px;
  --rail: 176px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(119, 102, 255, .13), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(58, 216, 255, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: auto 1fr; min-height: 100vh;
}
h1, h2, h3 { font-family: "Unbounded", "Plus Jakarta Sans", system-ui, sans-serif; margin: 0; font-weight: 500; }
::selection { background: var(--iris); color: #fff; }
a { color: var(--cyan); }

/* ---------- header ---------- */
.top {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 13, 28, .72); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { width: 28px; height: 28px; flex: none; }
h1 { font-size: 16px; letter-spacing: .01em; }
h1 small { font: 500 12px "Plus Jakarta Sans", sans-serif; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.balance {
  font-weight: 600; font-variant-numeric: tabular-nums; padding: 5px 13px; white-space: nowrap;
  border: 1px solid rgba(58, 216, 255, .35); border-radius: 999px; color: var(--cyan);
  background: rgba(58, 216, 255, .07); font-size: 14px;
}

/* ---------- navigasi ---------- */
.rail { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line-soft); }
.rail button {
  display: flex; align-items: center; gap: 11px; text-align: left; font: inherit; font-weight: 500; padding: 10px 12px;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer;
  transition: color .18s, background .18s, border-color .18s;
}
.rail svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail button:hover { color: var(--ink); background: rgba(124, 140, 255, .08); }
.rail button.on { color: #fff; background: rgba(119, 102, 255, .16); border-color: rgba(119, 102, 255, .45); box-shadow: inset 3px 0 0 var(--iris); }
.rail button.on svg { stroke: var(--cyan); }

/* ---------- area kerja ---------- */
.bay { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; padding: 24px; align-items: start; min-width: 0; }
.controls, .panel, .stat, .hist li {
  background: linear-gradient(180deg, rgba(19, 27, 54, .78), rgba(14, 20, 40, .78));
  border: 1px solid var(--line-soft); border-radius: 14px;
}
.controls { padding: 20px; }
.tool { display: none; flex-direction: column; gap: 14px; }
.tool.on { display: flex; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; color: #c9d1f0; }
label[hidden] { display: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
textarea, select, input[type=file], input:not([type=file]):not([type=range]) {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--field); width: 100%;
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; }
textarea::placeholder, input::placeholder { color: #566091; }
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px rgba(119, 102, 255, .22); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; margin-right: 10px; padding: 5px 10px; border: 0; border-radius: 8px;
  background: var(--panel2); color: var(--ink); cursor: pointer;
}
input[type=range] { width: 100%; accent-color: var(--iris); }
.count { font-weight: 400; color: var(--muted); margin-left: auto; font-size: 12.5px; }
label:has(.count) { position: relative; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted);
  transition: all .18s;
}
.seg button:hover { color: var(--ink); border-color: #3a4776; }
.seg button.on { background: var(--iris); border-color: var(--iris); color: #fff; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }

.go {
  font: inherit; font-weight: 600; font-size: 15px; position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--iris); color: #fff; border: 0; border-radius: var(--r); padding: 13px 16px; cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(119, 102, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .15s, background .18s, box-shadow .18s;
}
.go::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 50%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transition: left .55s;
}
.go:hover { background: var(--iris-d); transform: translateY(-1px); }
.go:hover::after { left: 130%; }
.go:active { transform: translateY(0); }
.go:disabled { opacity: .5; cursor: progress; transform: none; }
.cost { font: 600 13px "Plus Jakarta Sans", sans-serif; opacity: .9; background: rgba(255, 255, 255, .16); padding: 2px 9px; border-radius: 999px; }
.go.tg { background: #1f9bd6; justify-content: center; box-shadow: 0 8px 24px -10px rgba(31, 155, 214, .9), inset 0 1px 0 rgba(255, 255, 255, .22); }
.go.tg:hover { background: #1784b9; }
.err {
  margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--bad); background: rgba(255, 107, 122, .1);
  color: #ffb3bb; border-radius: 0 var(--r) var(--r) 0; font-size: 14px;
}

.mini {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; cursor: pointer; color: var(--ink); text-decoration: none; transition: all .18s; white-space: nowrap;
}
.mini:hover { border-color: var(--cyan); color: var(--cyan); }
.mini.bad { color: var(--bad); }
.link { background: none; border: 0; color: var(--cyan); font: inherit; font-size: 14px; cursor: pointer; padding: 0; text-align: left; }
.link:hover { text-decoration: underline; }

/* ---------- layar hasil ---------- */
.screen {
  position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; color: var(--muted);
  border-radius: 16px; border: 1px solid rgba(124, 140, 255, .28);
  background:
    linear-gradient(rgba(124, 140, 255, .05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(124, 140, 255, .05) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 50% 40%, #121a38, #080c1a 75%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), inset 0 0 60px rgba(0, 0, 0, .35);
}
.screen::before, .screen::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; border: 2px solid var(--cyan); opacity: .75;
}
.screen::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.screen::after { right: 12px; bottom: 12px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.empty { padding: 24px; text-align: center; }
.busy { width: min(320px, 80%); text-align: center; position: relative; padding-top: 74px; }
.busy::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%;
  border: 2px solid rgba(124, 140, 255, .25); border-top-color: var(--cyan); border-right-color: var(--iris);
  animation: spin 1.1s linear infinite; box-shadow: 0 0 24px rgba(58, 216, 255, .25);
}
.busy::after {
  content: ""; position: absolute; top: 20px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 18px var(--cyan); animation: pulse 1.6s ease-in-out infinite;
}
.busy p { margin: 14px 0 0; font-size: 14px; }
.bar { height: 3px; background: rgba(124, 140, 255, .18); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, var(--iris), var(--cyan)); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(.6); opacity: .6; } 50% { transform: scale(1); opacity: 1; } }
.out { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 16px; }
.out video, .out img { max-width: 100%; max-height: 560px; display: block; border-radius: 8px; }
.out audio { width: min(420px, 90%); margin-top: 20px; }
.out .acts { display: flex; gap: 8px; }
.out a { color: #fff; background: var(--iris); padding: 7px 16px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; }
.out a:hover { background: var(--iris-d); }
.note { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }

.hist-h { font-size: 14px; margin: 24px 0 10px; color: #c9d1f0; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hist li {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; cursor: pointer;
  border-radius: var(--r); padding: 9px 13px; font-size: 14px; transition: border-color .18s;
}
.hist li:hover { border-color: var(--iris); }
.hist .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .empty-li { cursor: default; color: var(--muted); }
.s { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #1b2442; color: #aab4da; white-space: nowrap; }
.s.done, .s.approved, .hist .s.done { background: rgba(79, 227, 160, .14); color: var(--ok); }
.s.failed, .hist .s.failed { background: rgba(255, 107, 122, .14); color: var(--bad); }
.s.processing, .s.queued, .s.pending, .s.claimed { background: rgba(255, 179, 71, .14); color: var(--amber); }
.s.rejected, .s.expired, .s.cancelled { background: #1b2442; color: #8a95bd; }

/* ---------- saldo, akun, admin ---------- */
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.qris { max-width: min(320px, 100%); border-radius: 12px; display: block; margin: 0 0 10px; background: #fff; padding: 8px; }
#tp-pay { display: flex; flex-direction: column; gap: 12px; }
#tp-pay[hidden] { display: none; }
#tp-pay p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack[hidden] { display: none; }
#f-acct p { margin: 0; }
#a-otp, #ac-otp { letter-spacing: .35em; font-size: 18px; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 13px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat b { display: block; font: 500 19px "Unbounded", sans-serif; font-variant-numeric: tabular-nums; color: var(--cyan); }
.stat span { color: var(--muted); font-size: 13px; }
.panel { padding: 18px; overflow-x: auto; }
.admin { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 16px; padding: 24px; max-width: 1000px; }
.admin[hidden] { display: none; }

/* ---------- gerbang login ---------- */
.gate {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow: auto; padding: 20px;
  background: radial-gradient(900px 600px at 20% 30%, #121a3d 0%, #070a14 70%);
  transition: opacity .6s ease, transform .6s ease, filter .6s ease;
}
.gate[hidden] { display: none; }
.gate.leaving { opacity: 0; transform: scale(1.08); filter: blur(6px); pointer-events: none; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.gate::after {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
}
.gate-wrap {
  position: relative; z-index: 1; width: min(980px, 100%); display: grid; grid-template-columns: 1fr 380px;
  align-items: center; gap: 56px;
}
.brand { min-width: 0; }
.brand svg { width: 54px; height: 54px; margin-bottom: 22px; filter: drop-shadow(0 0 14px rgba(58, 216, 255, .45)); }
.wm { font: 500 clamp(34px, 6vw, 66px)/1.02 "Unbounded", sans-serif; letter-spacing: -.02em; margin: 0 0 18px; min-height: 2.04em; }
.wm span { display: inline-block; }
.wm .x { color: var(--cyan); opacity: .8; }
.tag { margin: 0; max-width: 34ch; color: #aab4da; font-size: 17px; line-height: 1.6; }
.sub { margin: 18px 0 0; font: 500 13px "Plus Jakarta Sans", sans-serif; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sub i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2s ease-in-out infinite; }

@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.card {
  position: relative; border-radius: 18px; padding: 26px; width: 100%; display: flex; flex-direction: column; gap: 14px;
  background: rgba(12, 17, 36, .72); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(124, 140, 255, .2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0 70%, var(--cyan) 85%, var(--iris) 95%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: orbit 5s linear infinite;
}
@keyframes orbit { to { --a: 360deg; } }
.card h2 { font-size: 20px; }
.card .sep { display: flex; align-items: center; gap: 12px; text-align: center; }
.card .sep::before, .card .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.radar { position: relative; width: 64px; height: 64px; margin: 4px auto 0; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; animation: ping 2.2s ease-out infinite; }
.radar i:nth-child(2) { animation-delay: .7s; }
.radar i:nth-child(3) { animation-delay: 1.4s; }
.radar b { position: absolute; inset: 25px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
@keyframes ping { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
.steps { margin: 0; padding-left: 18px; color: #aab4da; font-size: 14px; }
.steps li { margin: 3px 0; }

/* ---------- responsif ---------- */
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding-bottom: 72px; }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line-soft);
    background: rgba(9, 13, 28, .92); backdrop-filter: blur(14px);
  }
  .rail button { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; text-align: center; border-radius: 12px; }
  .rail button.on { box-shadow: none; }
  .bay { grid-template-columns: 1fr; padding: 14px; gap: 16px; }
  .top { padding: 10px 14px; }
  .muted { display: none; }
  .gate { place-items: start center; }
  .gate-wrap { grid-template-columns: 1fr; gap: 22px; padding: 18px 0 28px; }
  .brand svg { width: 40px; height: 40px; margin-bottom: 12px; }
  .wm { min-height: 0; margin-bottom: 10px; }
  .tag { font-size: 15px; }
  .sub { display: none; }
  .card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar i { animation: none; width: 60%; }
  .busy::before, .busy::after, .card::before, .radar i, .sub i { animation: none; }
  .radar i { opacity: .5; }
  .gate { transition: none; }
}
