/* ============================================================
   Universe Music AI — antarmuka gelap, flat, ringan (tanpa framework)
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #111111;
  --bar: #1d1d1d;
  --panel: #1a1a1a;
  --field: #292929;
  --line: #2e2e2e;
  --line-strong: #444444;
  --text: #eeeeee;
  --muted: #aaaaaa;
  --dim: #777777;
  --accent: #92d0ff;
  --accent-hover: #b3e0ff;
  --green: #74d6a6;
  --red: #ff8a8a;
  --amber: #f2c879;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PT Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------------- Header ---------------- */

.topbar {
  background: rgba(29, 29, 29, 0.96);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 900px;
  height: 48px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--accent);
  color: #111111;
}
.brand-name b { font-weight: 700; }
.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  margin-left: 2px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid rgba(146, 208, 255, 0.4);
  vertical-align: 1px;
}
.top-nav { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.top-nav a { text-decoration: none; }
.top-nav a:hover { color: var(--accent); }

/* ---------------- Konten ---------------- */

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 16px 48px;
}

.intro { margin-bottom: 22px; }
.intro h1 {
  margin: 0 0 4px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.intro .sub { margin: 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

h2 { margin: 0 0 14px; font-size: 16px; font-weight: 650; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }

/* ---------------- Form ---------------- */

.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.urlrow { display: flex; gap: 8px; }
input[type="url"] {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="url"]::placeholder { color: #777777; }
input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(146, 208, 255, 0.12);
}

.opts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; }
.fine {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
}
.formerr {
  margin: 12px 0 0;
  color: var(--red);
  background: rgba(255, 138, 138, 0.08);
  border: 1px solid rgba(255, 138, 138, 0.28);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12.5px;
}

/* ---------------- Tombol & model ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: 5px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #101010; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: var(--field); border-color: var(--line-strong); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* ---------------- Banner ---------------- */

.banner {
  border-radius: 6px;
  padding: 10px 13px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--amber);
  background: rgba(242, 200, 121, 0.07);
  border: 1px solid rgba(242, 200, 121, 0.3);
}
.banner b { color: #ffe6b3; }

/* ---------------- Job ---------------- */

.video {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.thumb {
  position: relative;
  width: 92px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 5px;
  overflow: hidden;
  background: #222222;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { color: #666666; }
.thumb img:not([hidden]) + .thumb-ph { display: none; }
.vmeta { flex: 1; min-width: 0; }
.vtitle {
  font-weight: 600;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vsub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #262626;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.accent { color: var(--accent); border-color: rgba(146, 208, 255, 0.35); background: rgba(146, 208, 255, 0.08); }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 12px;
  padding: 0;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--dim);
}
.steps .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444444;
  flex: 0 0 auto;
}
.steps li.active { color: var(--text); }
.steps li.active .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(146, 208, 255, 0.14); animation: pulse 1.4s infinite; }
.steps li.done { color: var(--muted); }
.steps li.done .dot { background: var(--green); }
.steps li.failed { color: var(--red); }
.steps li.failed .dot { background: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.barwrap {
  height: 6px;
  border-radius: 999px;
  background: #2b2b2b;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}
.prow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.prow strong { color: var(--text); font-variant-numeric: tabular-nums; min-width: 34px; }
.spacer { flex: 1; }
.elapsed { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12px; }

.errorbox {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--red);
  background: rgba(255, 138, 138, 0.07);
  border: 1px solid rgba(255, 138, 138, 0.28);
  font-size: 12.5px;
}
.logbox { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.logbox summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.logbox pre {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 5px;
  background: #141414;
  border: 1px solid var(--line);
  color: #999999;
  font-size: 11px;
  line-height: 1.5;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- Hasil ---------------- */

.stems { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stem {
  background: #202020;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
}
.stem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.stem-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.stem audio { width: 100%; height: 34px; display: block; margin-bottom: 10px; }
.stem-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.size { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ---------------- Bantuan ---------------- */

.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.steps-grid li { background: #202020; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; }
.steps-grid b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.steps-grid span { color: var(--muted); font-size: 11.5px; }
.foot { text-align: center; color: var(--dim); font-size: 11.5px; padding: 0 16px 24px; }

/* ---------------- Responsif ---------------- */

@media (max-width: 720px) {
  .wrap { padding: 22px 12px 40px; }
  .card { padding: 14px; }
  .intro h1 { font-size: 24px; }
  .urlrow { flex-direction: column; }
  .urlrow .btn { width: 100%; }
  .stems { grid-template-columns: 1fr; }
  .steps, .steps-grid { grid-template-columns: 1fr 1fr; }
  .video { align-items: flex-start; }
  .thumb { width: 76px; height: 43px; }
  .top-nav { gap: 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
