/* ============================================================
   lagu.or.id — Pembuat Lagu dari Teks
   ============================================================ */

:root {
  --bg: #0f1023;
  --bg2: #181a36;
  --card: #1e2142;
  --card2: #252a55;
  --line: rgba(255, 255, 255, 0.09);
  --txt: #eef0ff;
  --muted: #9aa0c8;
  --primary: #7c5cff;
  --primary2: #5ce1e6;
  --accent: #ff8fab;
  --good: #4ade80;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(800px 400px at 0% 0%, rgba(92, 225, 230, 0.14), transparent 55%),
    var(--bg);
  color: var(--txt);
  line-height: 1.6;
  min-height: 100vh;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

a { color: var(--primary2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 16, 35, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #0f1023;
  border-radius: 12px;
  font-size: 1.3rem;
}
.brand-text strong { color: #fff; }
.nav { display: flex; gap: 22px; font-size: 0.95rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: #fff; text-decoration: none; }

/* ---------------- Hero ---------------- */
.hero { text-align: center; padding: 78px 0 46px; }
.badge {
  display: inline-block;
  background: rgba(124, 92, 255, 0.16);
  color: #c9baff;
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.hero h1 em { font-style: normal; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--primary2), var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  max-width: 720px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.lead strong { color: var(--txt); }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 20px; color: var(--muted); font-size: 0.95rem; }
.hero-note u { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  color: var(--txt);
  background: var(--card2);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #0f1023;
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.35);
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--txt); }
.btn-lg { padding: 15px 26px; font-size: 1.06rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-play {
  background: linear-gradient(135deg, #2dd4bf, #38bdf8);
  color: #062a25;
  font-size: 1.05rem;
  padding: 13px 22px;
  box-shadow: 0 10px 24px rgba(45, 212, 191, 0.3);
}

/* ---------------- Studio ---------------- */
.studio { padding: 34px 0 60px; }
.grid-studio {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 26px;
  align-items: start;
}
@media (max-width: 900px) {
  .grid-studio { grid-template-columns: 1fr; }
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 1.12rem;
  margin-bottom: 14px;
  color: #fff;
}
.panel-input h2 { margin-top: 18px; }
.panel-input h2:first-child { margin-top: 0; }

/* textarea */
textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  color: var(--txt);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.7;
}
textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.input-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* fields */
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%239aa0c8' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 38px 11px 13px;
  color: var(--txt);
  font-size: 0.98rem;
  cursor: pointer;
}
select:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* result panel */
.panel-result { min-height: 420px; }
.result-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 3.4rem; margin-bottom: 12px; }
.result-empty strong { color: var(--txt); }
.song-head { margin-bottom: 8px; }
.tag {
  display: inline-block;
  background: rgba(124, 92, 255, 0.16);
  color: #cdc0ff;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}
.tag-dim { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.song-title { font-size: 1.35rem; margin: 10px 0 4px; color: #fff; }

/* tabs */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 14px 0 16px; }
.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: #fff; border-bottom-color: var(--primary); }
.tab-body { display: none; }
.tab-body.active { display: block; }
.tab-body .hint { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }

/* voice */
.voice-row { margin-top: 12px; }
#vocalWave, #instWave {
  height: 64px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 14px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.wave-bar {
  flex: 1;
  align-self: stretch;
  margin: 0 1.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary2));
  opacity: 0.15;
  transition: opacity 0.1s;
}
.wave-bar.active { opacity: 1; }

/* lyrics */
.lyrics-box {
  margin-top: 20px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  max-height: 320px;
  overflow-y: auto;
}
.lyrics-head {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lyric-line {
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  color: var(--muted);
}
.lyric-line .idx {
  display: inline-block;
  width: 26px;
  color: #5b6099;
  font-size: 0.8rem;
}
.lyric-line.current {
  background: rgba(124, 92, 255, 0.18);
  color: #fff;
}
.lyric-line.current .idx { color: var(--primary2); }

/* status bar */
.status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 22px;
}
.status.error { color: #f87171; }
.status.ok { color: var(--good); }

/* ---------------- How to ---------------- */
.howto { padding: 30px 0 70px; }
.howto h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.howto-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .howto-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .howto-grid { grid-template-columns: 1fr; } }
.howto-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.howto-card .num {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #0f1023;
  font-weight: 800;
  border-radius: 10px;
  margin-bottom: 12px;
}
.howto-card h3 { margin-bottom: 6px; font-size: 1.02rem; }
.howto-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer .brand-mark {
  width: 26px; height: 26px;
  font-size: 0.95rem;
  border-radius: 8px;
  vertical-align: middle;
}
.tiny { font-size: 0.78rem; color: var(--muted); }
.hint.tiny { margin-top: 8px; text-align: center; }

/* utility */
.hidden { display: none !important; }