/* ============================================================
   AiCloneVox — Design System v2
   Modern dark, glassmorphism, Inter + Syne display font
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Base palette */
  --bg:        #060a0f;
  --bg-1:      #0a0f16;
  --bg-2:      #0e1520;
  --bg-3:      #12192a;
  --surface:   rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.055);
  --surface-3: rgba(255,255,255,0.08);

  /* Borders */
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --border-3:  rgba(255,255,255,0.18);

  /* Text */
  --text:      #f0f4f8;
  --text-2:    #9ba8b8;
  --text-3:    #5a6478;

  /* Accent — electric orange */
  --accent:       #ff6b35;
  --accent-2:     #ff8c5a;
  --accent-glow:  rgba(255,107,53,0.20);
  --accent-line:  rgba(255,107,53,0.40);
  --accent-bg:    rgba(255,107,53,0.10);

  /* Status */
  --green:  #22d3a0;
  --green-bg: rgba(34,211,160,0.10);
  --red:    #ff5757;
  --red-bg: rgba(255,87,87,0.10);
  --blue:   #60a5fa;
  --blue-bg: rgba(96,165,250,0.10);
  --yellow: #fbbf24;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #ff6b35, #ff3d68);
  --grad-surface: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);

  /* Shape */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);
  --shadow-accent: 0 8px 32px rgba(255,107,53,0.25);

  /* Fonts */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-ui:      'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1200px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,107,53,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(96,165,250,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Atmosphere: faint scanlines + grain, matching the app's
   "analog studio console" backdrop. Fixed, non-interactive, subtle. ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
}
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4 { line-height: 1.15; letter-spacing: -0.025em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Brand ───────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}
.eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 20px; }
.eq i {
  width: 3px; border-radius: 3px;
  background: var(--grad-accent);
  height: 40%;
  animation: eq 1.2s ease-in-out infinite;
}
.eq i:nth-child(2) { height: 90%; animation-delay: .18s; }
.eq i:nth-child(3) { height: 55%; animation-delay: .36s; }
.eq i:nth-child(4) { height: 100%; animation-delay: .10s; }
.eq i:nth-child(5) { height: 65%; animation-delay: .28s; }
@keyframes eq { 0%,100%{ transform:scaleY(.35); } 50%{ transform:scaleY(1); } }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--border-2);
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  background: var(--surface-2); color: var(--text);
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
  opacity: 0; transition: opacity .18s;
}
.btn:hover::before { opacity: 1; }
.btn:hover { border-color: var(--border-3); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-accent);
  border: none; color: #fff;
  box-shadow: var(--shadow-accent);
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 40px rgba(255,107,53,0.4); }

.btn-ghost { background: transparent; border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-3); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--red-bg); border-color: rgba(255,87,87,0.3); color: var(--red); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--grad-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

/* ── Pill / Badge ────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-line);
}
.pill-green  { background: var(--green-bg);  color: var(--green);  border-color: rgba(34,211,160,0.3); }
.pill-red    { background: var(--red-bg);    color: var(--red);    border-color: rgba(255,87,87,0.3); }
.pill-blue   { background: var(--blue-bg);   color: var(--blue);   border-color: rgba(96,165,250,0.3); }
.pill-yellow { background: rgba(251,191,36,0.1); color: var(--yellow); border-color: rgba(251,191,36,0.3); }

.tag { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }

/* ── Forms ───────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 600; letter-spacing: 0.01em; }

.input, textarea, select {
  width: 100%; padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; cursor: pointer; }

.note { font-size: 13px; color: var(--text-3); }

.error-box {
  background: var(--red-bg); border: 1px solid rgba(255,87,87,0.3);
  color: #ffaaaa; padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 14px;
}
.ok-box {
  background: var(--green-bg); border: 1px solid rgba(34,211,160,0.3);
  color: #a7f3d0; padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 14px;
}

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(14,21,32,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 9999; box-shadow: var(--shadow);
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { border-color: rgba(255,87,87,0.4); color: var(--red); }

/* ── Progress bar ────────────────────────────────────────── */
.progress {
  height: 6px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: var(--grad-accent);
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.progress > span::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{ opacity:0; } 50%{ opacity:1; } 100%{ opacity:0; } }

/* ── Data helpers ────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.credits-num { font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.02em; }
.st-completed { color: var(--green); }
.st-failed    { color: var(--red); }
.st-processing, .st-pending { color: var(--accent); }

/* ── Audio player ────────────────────────────────────────── */
audio {
  width: 100%; margin-top: 14px;
  border-radius: var(--radius-sm);
  accent-color: var(--accent);
}

/* ── Chips ───────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2);
  text-align: center; transition: all .15s;
}
.chip:hover { border-color: var(--border-3); background: var(--surface-2); }
.chip.sel { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent-line); }
.chip .chip-tag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  background: var(--grad-accent); color: #fff;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.chip .chip-name { font-weight: 700; font-size: 13px; }

/* ── Counter ─────────────────────────────────────────────── */
.counter { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.counter.over { color: var(--red); font-weight: 700; }

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