/* ==================== BASE ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #080810;
  --card:         rgba(255,255,255,0.04);
  --card-border:  rgba(255,255,255,0.07);
  --accent1:      #7c3aed;
  --accent2:      #2563eb;
  --accent3:      #06b6d4;
  --success:      #10b981;
  --error:        #ef4444;
  --text:         #f1f5f9;
  --muted:        #64748b;
  --r:            20px;
  --ease:         cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ==================== ORBS ==================== */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.14;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: var(--accent1); top: -200px; left: -150px; }
.orb-2 { width: 500px; height: 500px; background: var(--accent2); bottom: -150px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 350px; height: 350px; background: var(--accent3); top: 45%; left: 55%; transform: translateX(-50%); animation-delay: -9s; }
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-28px) scale(1.04); }
}

/* ==================== HEADER ==================== */
.header {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(8,8,16,0.75);
  backdrop-filter: blur(16px);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent1), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: #fff; letter-spacing: 0.05em;
}
.logo-text { font-size: 1.15rem; font-weight: 300; }
.logo-text strong { font-weight: 700; color: var(--accent3); }
.header-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: rgba(124,58,237,0.15); color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
}

/* ==================== MAIN ==================== */
.main {
  position: relative; z-index: 5;
  max-width: 720px; margin: 0 auto;
  padding: 72px 24px 100px;
  display: flex; flex-direction: column; align-items: center; gap: 48px;
}

/* ==================== HERO ==================== */
.hero { text-align: center; max-width: 600px; }
.hero-eyebrow {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.12em;
  color: #a78bfa; text-transform: uppercase; margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -0.04em; margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(125deg, #a78bfa 0%, var(--accent3) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: 1.05rem; color: var(--muted); line-height: 1.75;
  max-width: 500px; margin: 0 auto;
}
.hero-sub strong { color: var(--text); }

/* ==================== UPLOAD CARD ==================== */
.upload-section { width: 100%; }

.upload-card {
  width: 100%;
  background: var(--card);
  border: 1.5px dashed var(--card-border);
  border-radius: var(--r);
  padding: 52px 40px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease),
              box-shadow .25s var(--ease);
  position: relative; overflow: hidden;
}
.upload-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.upload-card:hover,
.upload-card.drag-over {
  border-color: rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.05);
  box-shadow: 0 0 60px rgba(124,58,237,0.1);
}
.upload-card:focus-visible { outline: 2px solid var(--accent1); outline-offset: 4px; }

.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }

.upload-icon-wrap { margin-bottom: 8px; }
.upload-svg {
  width: 72px; height: 72px;
  animation: spin-slow 18s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.drop-title { font-size: 1.2rem; font-weight: 700; }
.drop-sub { font-size: 0.83rem; color: var(--muted); margin-bottom: 4px; }

.upload-divider {
  width: 100%; display: flex; align-items: center; gap: 16px;
  margin: 28px 0 24px;
  color: var(--muted); font-size: 0.8rem;
}
.upload-divider::before, .upload-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--card-border);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
  user-select: none;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); }

.btn-convert {
  width: 100%; padding: 16px 30px;
  background: linear-gradient(135deg, var(--accent1) 0%, var(--accent2) 100%);
  color: #fff; font-size: 1rem;
  box-shadow: 0 4px 24px rgba(124,58,237,0.35);
}
.btn-convert:not(:disabled):hover {
  box-shadow: 0 6px 36px rgba(124,58,237,0.55);
}
.btn-convert.ready {
  background: linear-gradient(135deg, var(--accent1), var(--accent3));
}

.btn-secondary {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--card-border);
  font-size: 0.88rem;
}
.btn-secondary:hover:not(:disabled) {
  color: var(--text); border-color: rgba(255,255,255,0.2);
}

.btn-dl {
  width: 100%; padding: 12px 20px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.88rem;
  text-decoration: none !important;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.btn-dl:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn-dl.btn-dl-instr {
  background: rgba(6,182,212,0.08);
  border-color: rgba(6,182,212,0.2);
  color: var(--accent3);
}
.btn-dl.btn-dl-instr:hover { background: rgba(6,182,212,0.15); border-color: rgba(6,182,212,0.4); }

/* ==================== PROGRESS ==================== */
.progress-section { width: 100%; display: flex; justify-content: center; }
.progress-card {
  width: 100%; max-width: 560px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 40px 40px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
}
.progress-filename {
  font-size: 0.82rem; color: var(--muted);
  max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress-bar-outer {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent1), var(--accent3));
  border-radius: 999px;
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}
.progress-bar-inner.waiting {
  background: linear-gradient(90deg, var(--muted), var(--accent1)) !important;
  animation: pulse-waiting 1.5s ease-in-out infinite;
  width: 100% !important;
}
@keyframes pulse-waiting {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1.0; }
}
.progress-msg {
  font-size: 0.95rem; color: var(--muted); font-weight: 500;
  min-height: 1.4em;
}
.progress-dots { display: flex; gap: 6px; }
.progress-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent1); opacity: 0.5;
  animation: blink 1.4s ease-in-out infinite;
}
.progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.progress-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%,100% { opacity: 0.2; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ==================== RESULTS ==================== */
.results-section { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.results-header { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.results-check {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #059669);
  font-size: 1.5rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(16,185,129,0.4);
  animation: pop .4s var(--ease);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.results-title { font-size: 1.6rem; font-weight: 800; }
.results-sub { font-size: 0.85rem; color: var(--muted); }

.download-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dl-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; text-align: center;
}
.dl-num {
  font-size: 1.4rem; font-weight: 900;
  background: linear-gradient(135deg, var(--accent1), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dl-label { font-size: 0.82rem; color: var(--muted); }

/* ==================== ERROR ==================== */
.error-section { width: 100%; display: flex; justify-content: center; }
.error-card {
  max-width: 480px; width: 100%;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--r);
  padding: 40px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.error-icon { font-size: 2.4rem; color: #fca5a5; }
.error-msg { color: #fca5a5; font-size: 0.93rem; line-height: 1.6; }

/* ==================== FOOTER ==================== */
.footer {
  position: relative; z-index: 5;
  text-align: center; padding: 24px;
  border-top: 1px solid var(--card-border);
  font-size: 0.8rem; color: var(--muted);
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
  .header { padding: 14px 18px; }
  .main { padding: 48px 16px 80px; }
  .upload-card { padding: 36px 20px 28px; }
  .progress-card { padding: 28px 20px; }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .lyrics-controls { flex-direction: column; }
}

/* ==================== LYRICS SECTION ==================== */
.lyrics-section {
  position: relative; z-index: 5;
  max-width: 720px; margin: 0 auto;
  padding: 0 24px 100px;
  display: flex; flex-direction: column; align-items: center; gap: 40px;
}

.section-divider {
  width: 100%; display: flex; align-items: center; gap: 20px;
  padding: 20px 0;
}
.divider-line { flex: 1; height: 1px; background: var(--card-border); }
.divider-icon { color: var(--accent1); font-size: 1rem; flex-shrink: 0; }

.lyrics-header { text-align: center; max-width: 540px; }
.lyrics-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -0.03em; margin: 12px 0 16px;
}
.lyrics-sub { font-size: 1rem; color: var(--muted); line-height: 1.7; }

.lyrics-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  padding: 36px 36px 32px;
  display: flex; flex-direction: column; gap: 20px;
}

.lyrics-controls {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.ctrl-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.ctrl-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.ctrl-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  appearance: none;
  cursor: pointer;
  transition: border-color .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.ctrl-select:focus { outline: none; border-color: var(--accent1); }
.ctrl-select option { background: #1a1a2e; }

.lyrics-area-wrap { display: flex; flex-direction: column; gap: 8px; }
.lyrics-area-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.lyrics-area {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Inter', monospace;
  font-size: 0.92rem;
  line-height: 1.75;
  padding: 16px 18px;
  resize: vertical;
  transition: border-color .2s;
}
.lyrics-area:focus { outline: none; border-color: var(--accent1); }
.lyrics-area::placeholder { color: var(--muted); opacity: 0.6; }
.lyrics-area-output {
  background: rgba(16,185,129,0.04);
  border-color: rgba(16,185,129,0.2);
  min-height: 160px;
}
.lyrics-area-output:focus { border-color: var(--success); }

.lyrics-result { display: flex; flex-direction: column; gap: 14px; }
.lyrics-result-header { display: flex; align-items: center; gap: 10px; }
.result-check-sm {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.lyrics-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-copy {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff; font-size: 0.9rem;
  padding: 11px 24px;
  box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}
.btn-copy:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(16,185,129,0.45); }

.copy-confirm {
  font-size: 0.82rem; color: var(--success);
  font-weight: 600; text-align: center;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Beta notice ── */
.beta-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 0.82rem; color: #fcd34d;
  line-height: 1.6; text-align: left;
}
.beta-badge {
  flex-shrink: 0;
  background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.4);
  color: #fbbf24;
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 7px; border-radius: 4px;
  margin-top: 2px;
}


