/* ═══════════════════════════════════════════
   IAVideo — Glassmorphism Dark Theme
   ═══════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --bg-base: #07060f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(167, 139, 250, 0.5);
  --border-hover: rgba(255, 255, 255, 0.15);

  --purple-400: #A78BFA;
  --purple-500: #8B5CF6;
  --purple-600: #7C3AED;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --green-400: #34D399;
  --red-400: #F87171;
  --amber-400: #FBBF24;

  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-purple: 0 0 32px rgba(124, 58, 237, 0.25);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --grad-brand: linear-gradient(135deg, #7C3AED 0%, #3B82F6 100%);
  --grad-text: linear-gradient(135deg, #A78BFA 0%, #60A5FA 100%);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Animated Background ─── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orbFloat 12s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #7C3AED, transparent 70%);
  top: -200px; left: -100px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3B82F6, transparent 70%);
  top: 30%; right: -150px;
  animation-delay: -4s;
}

.bg-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #A78BFA, transparent 70%);
  bottom: -100px; left: 30%;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ─── App Wrapper ─── */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Header ─── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 36px;
  height: 36px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-400);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-dot--green {
  background: var(--green-400);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}

.stat-dot--purple {
  background: var(--purple-400);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Main Layout ─── */
.app-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Card ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ─── Upload Zone ─── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-md);
}

.upload-zone:hover,
.upload-zone:focus,
.upload-zone.drag-over {
  border-color: var(--purple-500);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
  outline: none;
}

.upload-zone.drag-over::before {
  opacity: 0.04;
}

.upload-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 50%;
  margin-bottom: 16px;
  transition: transform var(--transition);
}

.upload-zone:hover .upload-icon-wrap {
  transform: translateY(-4px);
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-browse {
  color: var(--purple-400);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── Upload Preview ─── */
.upload-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  border: none;
  max-height: 360px;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-sm);
}

.upload-preview:hover .preview-overlay {
  opacity: 1;
}

.preview-change-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  font-family: inherit;
}

.preview-change-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.preview-info {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Settings Grid ─── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-400);
  background: rgba(124, 58, 237, 0.12);
  padding: 1px 8px;
  border-radius: 100px;
  text-transform: none;
  letter-spacing: 0;
}

.form-select,
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  width: 100%;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-select optgroup { color: var(--text-secondary); }
.form-select option { background: #1a1730; color: var(--text-primary); }

.form-select:hover,
.form-input:hover {
  border-color: var(--border-hover);
  background: var(--bg-input-focus);
}

.form-select:focus,
.form-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.form-select--sm { width: auto; min-width: 100px; flex-shrink: 0; }

.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  transition: all var(--transition);
  outline: none;
  width: 100%;
  line-height: 1.6;
}

.form-textarea:hover { border-color: var(--border-hover); }
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.form-textarea::placeholder,
.form-input::placeholder { color: var(--text-muted); }

/* ─── Range Slider ─── */
.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--purple-600) 0%, var(--blue-500) 50%, var(--border) 50%);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--purple-500);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  transition: box-shadow var(--transition);
}

.form-range::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.35);
}

.form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--purple-500);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── API Key Manager ─── */
.key-count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-400);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 2px 10px;
  border-radius: 100px;
}

.add-key-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-row--key { position: relative; }

.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
}

.btn-add-key {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-add-key:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

.btn-add-key:active { transform: translateY(0); }

/* ─── Key List ─── */
.key-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}

.key-list::-webkit-scrollbar { width: 4px; }
.key-list::-webkit-scrollbar-track { background: transparent; }
.key-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}

.key-list-empty {
  text-align: center;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.key-list-empty p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.text-muted { color: var(--text-muted) !important; font-size: 12px !important; }

/* ─── Key Item ─── */
.key-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.key-item.key-item--active {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.04);
}

.key-item.key-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--green-400);
  border-radius: 3px 0 0 3px;
}

.key-item.key-item--exhausted {
  border-color: rgba(251, 191, 36, 0.3);
  opacity: 0.7;
}

.key-item.key-item--dead {
  border-color: rgba(248, 113, 113, 0.3);
  opacity: 0.5;
}

.key-item-info {
  flex: 1;
  min-width: 0;
}

.key-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.key-provider-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 100px;
}

.key-provider-badge.badge-replicate {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.key-provider-badge.badge-fal {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber-400);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.key-alias {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.key-value-display {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
  white-space: nowrap;
}

.key-status-badge.status-active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--green-400);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.key-status-badge.status-exhausted {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber-400);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.key-status-badge.status-dead {
  background: rgba(248, 113, 113, 0.1);
  color: var(--red-400);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.key-status-badge.status-rotating {
  background: rgba(167, 139, 250, 0.1);
  color: var(--purple-400);
  border: 1px solid rgba(167, 139, 250, 0.2);
  animation: badgePulse 1s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-delete-key {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-delete-key:hover { color: var(--red-400); }

/* ─── Rotation Info ─── */
.rotation-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.rotation-info-icon {
  width: 28px;
  height: 28px;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rotation-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-400);
  margin-bottom: 2px;
}

.rotation-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Log ─── */
.btn-clear-log {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear-log:hover {
  border-color: var(--red-400);
  color: var(--red-400);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
}

.log-list::-webkit-scrollbar { width: 3px; }
.log-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

.log-item {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.log-item--info { color: var(--text-secondary); }
.log-item--success { color: var(--green-400); background: rgba(52, 211, 153, 0.05); }
.log-item--warn { color: var(--amber-400); background: rgba(251, 191, 36, 0.05); }
.log-item--error { color: var(--red-400); background: rgba(248, 113, 113, 0.05); }
.log-item--rotate { color: var(--purple-400); background: rgba(167, 139, 250, 0.05); }

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
}

/* ─── Generate Section ─── */
.generate-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.generate-btn-wrap {
  display: flex;
  justify-content: center;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-xl);
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 56px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  letter-spacing: -0.3px;
  position: relative;
  overflow: hidden;
  min-width: 220px;
}

.btn-generate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 1;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-generate:active:not(:disabled) {
  transform: translateY(0);
}

.btn-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate-content,
.btn-generate-loading {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Spinner ─── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Progress Section ─── */
.progress-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  backdrop-filter: blur(20px);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-key {
  font-size: 12px;
  color: var(--purple-400);
  font-weight: 500;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 7px;
  left: calc(50% + 10px);
  right: calc(-50% + 10px);
  height: 1.5px;
  background: var(--border);
  transition: background var(--transition-slow);
}

.step.step--done:not(:last-child)::after { background: var(--purple-500); }

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid transparent;
  transition: all var(--transition-slow);
  position: relative;
  z-index: 1;
}

.step.step--active .step-dot {
  background: var(--purple-500);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
  animation: dotGlow 1s ease-in-out infinite;
}

.step.step--done .step-dot {
  background: var(--green-400);
  border-color: rgba(52, 211, 153, 0.4);
}

.step.step--active { color: var(--purple-400); }
.step.step--done { color: var(--green-400); }

@keyframes dotGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(139, 92, 246, 0.6); }
  50% { box-shadow: 0 0 16px rgba(139, 92, 246, 0.9); }
}

/* ─── Result Section ─── */
.result-card {
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.08);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green-400);
}

.result-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.result-video-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
}

.result-video-wrap video {
  width: 100%;
  max-height: 500px;
  display: block;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-brand);
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

.btn-generate-again {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--purple-400);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-generate-again:hover {
  border-color: var(--border-focus);
  background: rgba(124, 58, 237, 0.08);
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(20, 15, 40, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--text-primary);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all var(--transition);
}

.toast.toast--success { border-color: rgba(52, 211, 153, 0.3); }
.toast.toast--error { border-color: rgba(248, 113, 113, 0.3); }
.toast.toast--warn { border-color: rgba(251, 191, 36, 0.3); }
.toast.toast--rotate { border-color: rgba(167, 139, 250, 0.3); }

.toast.toast--out {
  opacity: 0;
  transform: translateX(20px);
}

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-msg { flex: 1; line-height: 1.5; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ─── Admin Dashboard Modal & Controls ─── */
.admin-btn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #C4B5FD;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.admin-btn-pill:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(167, 139, 250, 0.5);
  color: #ECE9FE;
  transform: translateY(-1px);
}

.admin-btn-pill.admin-logged-in {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34D399;
}

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 40px rgba(124, 58, 237, 0.2);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.admin-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--purple-400);
}

.admin-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Utilities ─── */
[hidden] { display: none !important; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .panel--right { order: -1; }

  .header-stats {
    display: none;
  }

  .app-wrapper {
    padding: 16px 16px 40px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .form-group--full { grid-column: 1; }

  .result-actions {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .brand-badge { display: none; }
  .form-row { flex-wrap: wrap; }
  .form-select--sm { width: 100%; }
}
