/* === GURU Thumbnail Design System === */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --color-primary: #7C3AED;
  --color-on-primary: #FFFFFF;
  --color-secondary: #6366F1;
  --color-accent: #EC4899;
  --color-background: #FAF5FF;
  --color-foreground: #0F172A;
  --color-muted: #F7F3FD;
  --color-border: #EFE7FC;
  --color-destructive: #DC2626;
  --color-ring: #7C3AED;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-surface: #FFFFFF;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(124,58,237,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(124,58,237,0.06);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 8px 10px rgba(124,58,237,0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-foreground);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; }

p { color: #64748B; line-height: 1.7; }

/* === Layout === */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
  position: relative;
  z-index: 0;
}

/* === Navigation === */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: #94A3B8;
}

.nav-status .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  animation: pulse-dot 2s ease infinite;
}

.nav-status .dot.offline {
  background: var(--color-destructive);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* === Hero Section === */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, rgba(99,102,241,0.04) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.hero > * {
  position: relative;
}

.hero h1 {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

.hero p {
  max-width: 560px;
  margin: 0 auto var(--space-xl);
  font-size: 1.125rem;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: rgba(124,58,237,0.08);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(124,58,237,0.15);
}

/* === Generator Form === */
.generator-section {
  padding: 0 var(--space-lg) var(--space-3xl);
}

.generator-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  max-width: 720px;
  margin: 0 auto;
  transition: box-shadow 300ms ease;
}

.generator-card:hover {
  box-shadow: var(--shadow-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: var(--space-sm);
}

.form-group .helper {
  font-size: 0.78rem;
  color: #94A3B8;
  margin-top: var(--space-xs);
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-foreground);
  background: var(--color-surface);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  outline: none;
}

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

.input::placeholder {
  color: #CBD5E1;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* === Tags Input === */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 44px;
  align-items: center;
  cursor: text;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.tags-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(124,58,237,0.08);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  animation: tag-in 200ms ease;
}

@keyframes tag-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.tag button {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity 150ms ease;
}

.tag button:hover {
  opacity: 1;
}

.tags-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  flex: 1;
  min-width: 100px;
  background: transparent;
  color: var(--color-foreground);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
  line-height: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #D946EF 100%);
  color: var(--color-on-primary);
  box-shadow: 0 4px 14px rgba(236,72,153,0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(236,72,153,0.45);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: rgba(124,58,237,0.04);
}

.btn-full {
  width: 100%;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* === Progress / Status === */
.status-section {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.status-section.active {
  display: block;
  animation: fade-in 300ms ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.progress-step {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: capitalize;
}

.progress-percent {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94A3B8;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--color-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width 500ms ease;
  width: 0%;
}

.progress-message {
  text-align: center;
  color: #64748B;
  font-size: 0.9rem;
}

.progress-message .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin-right: var(--space-sm);
  vertical-align: middle;
}

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

/* === Results === */
.results-section {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-3xl);
}

.results-section.active {
  display: block;
  animation: fade-in 400ms ease;
}

.results-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.results-header h2 {
  margin-bottom: var(--space-sm);
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  font-size: 0.85rem;
  color: #94A3B8;
}

.results-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 250ms ease;
  cursor: pointer;
}

.result-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.result-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--color-muted);
}

.result-card-body {
  padding: var(--space-md);
}

.result-card-body .variant-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-actions {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-md);
}

.result-actions .btn {
  padding: 8px 14px;
  font-size: 0.8rem;
  flex: 1;
}

/* === Prompt Display === */
.prompt-display {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: #64748B;
  line-height: 1.6;
}

.prompt-display strong {
  color: var(--color-foreground);
  font-weight: 600;
}

/* === Error State === */
.error-banner {
  display: none;
  max-width: 720px;
  margin: var(--space-lg) auto;
  padding: var(--space-md) var(--space-lg);
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: var(--radius-md);
  color: var(--color-destructive);
  font-size: 0.9rem;
  animation: fade-in 200ms ease;
}

.error-banner.active {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* === Features Section === */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-lg);
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 250ms ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  background: rgba(124,58,237,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1rem;
}

.feature-card p {
  font-size: 0.85rem;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: var(--space-xl);
  border-top: 1px solid var(--color-border);
  color: #94A3B8;
  font-size: 0.8rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .hero { padding: var(--space-2xl) var(--space-md); }
  .generator-card { padding: var(--space-lg); }
}

@media (max-width: 375px) {
  .app-container { padding: var(--space-md); }
  .nav { padding: var(--space-sm) var(--space-md); }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════
   LLM Section — AI Prompt Generation
   Style: Modern Dark / Cinematic AI Tool
   (per UI Pro Max skill: Modern Dark Cinema)
════════════════════════════════════════*/

.llm-section {
  max-width: 900px;
  margin: var(--space-2xl) auto 0;
  padding: 0 var(--space-lg) var(--space-3xl);
  animation: fade-in 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.llm-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.llm-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.llm-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.llm-header h2 {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.llm-header .llm-subtitle {
  color: #94A3B8;
  font-size: 0.9rem;
}

/* Step indicator */
.llm-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  font-size: 0.8rem;
  color: #94A3B8;
}

.llm-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}
.llm-step-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
}

/* Skeleton loader */
.skeleton-card {
  height: 120px;
  background: linear-gradient(90deg, var(--color-muted) 25%, var(--color-border) 50%, var(--color-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.llm-thinking-label {
  text-align: center;
  color: #94A3B8;
  font-size: 0.87rem;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

/* Variant cards */
.variant-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.variant-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: fade-in 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.variant-card:nth-child(1) { animation-delay: 0ms; }
.variant-card:nth-child(2) { animation-delay: 80ms; }
.variant-card:nth-child(3) { animation-delay: 160ms; }

.variant-card:hover {
  border-color: rgba(124,58,237,0.4);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.variant-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12), var(--shadow-lg);
}

.variant-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(124,58,237,0.03);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.variant-card.selected .variant-card-header {
  border-bottom-color: rgba(124,58,237,0.1);
  background: rgba(124,58,237,0.05);
}

.variant-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-foreground);
}

.variant-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.variant-badge.channel { background: rgba(124,58,237,0.1); color: var(--color-primary); }
.variant-badge.professional { background: rgba(16,185,129,0.1); color: #059669; }
.variant-badge.ctr { background: rgba(236,72,153,0.1); color: var(--color-accent); }

.variant-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  flex-shrink: 0;
}

.variant-card.selected .variant-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.variant-check svg {
  display: none;
  width: 12px;
  height: 12px;
  color: white;
  stroke-width: 3;
}
.variant-card.selected .variant-check svg { display: block; }

.variant-card-body {
  padding: var(--space-md) var(--space-lg);
}

.format-block {
  margin-bottom: var(--space-md);
}

.format-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  margin-bottom: var(--space-sm);
}

.format-a-tag { color: var(--color-primary); }
.format-b-tag { color: #64748B; }

.format-a-text {
  font-size: 0.875rem;
  color: var(--color-foreground);
  line-height: 1.6;
  background: var(--color-muted);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.format-b-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
}

.format-b-toggle:hover {
  background: var(--color-muted);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.format-b-text {
  display: none;
  font-size: 0.8rem;
  color: #64748B;
  line-height: 1.7;
  background: var(--color-muted);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  margin-top: var(--space-sm);
  white-space: pre-wrap;
}

/* Prompt editor */
.prompt-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  animation: fade-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.prompt-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.prompt-editor-header label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-foreground);
}

.btn-copy {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
}

.btn-copy:hover {
  background: var(--color-muted);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.prompt-textarea {
  min-height: 100px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  background: var(--color-muted);
}

.btn-generate-images {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}

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

/* Fallback notice */
.llm-fallback-notice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem;
  color: #92400E;
  margin-bottom: var(--space-lg);
}

@media (max-width: 768px) {
  .variant-card-header { padding: var(--space-md); }
  .variant-card-body { padding: var(--space-md); }
}

/* === Variant Textarea (editable Format A inside card) === */
.variant-textarea-wrap {
  position: relative;
  margin-top: var(--space-sm);
}

.variant-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-foreground);
  background: var(--color-muted);
  resize: vertical;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.variant-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

/* Format B copy button row */
.format-b-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.btn-copy-b {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.74rem;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
  white-space: nowrap;
}

.btn-copy-b:hover {
  background: var(--color-muted);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Generate All bar */
.generate-all-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: fade-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-generate-all {
  background: linear-gradient(135deg, var(--color-primary) 0%, #6366F1 100%);
  color: white;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn-generate-all:hover {
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
  transform: translateY(-2px);
}

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

.generate-all-hint {
  font-size: 0.8rem;
  color: #94A3B8;
  margin-top: var(--space-sm);
}

/* Multi-progress indicators */
.multi-progress-wrap {
  margin-top: var(--space-lg);
}

.multi-progress-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.multi-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  width: 120px;
  flex-shrink: 0;
  color: #64748B;
}

.multi-progress-bar-track {
  flex: 1;
  height: 5px;
  background: var(--color-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.multi-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width 500ms ease;
  width: 0%;
}

.multi-progress-status {
  font-size: 0.75rem;
  color: #94A3B8;
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Auth Screen — Premium Login Page
   Glassmorphism + Animated Gradient Mesh
════════════════════════════════════════*/

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0118;
  overflow: hidden;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), visibility 600ms;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animated gradient mesh background */
.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.auth-bg::before,
.auth-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  animation: auth-float 12s ease-in-out infinite;
}

.auth-bg::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.35) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.auth-bg::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%);
  bottom: -10%;
  right: -10%;
  animation-delay: -6s;
}

.auth-bg-orb {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
  filter: blur(100px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: auth-pulse 8s ease-in-out infinite;
}

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

@keyframes auth-pulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.15); }
}

/* Noise texture overlay */
.auth-noise {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

/* Login card (glassmorphism) */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    0 0 0 1px rgba(255,255,255,0.05) inset;
  animation: auth-card-in 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  animation: auth-glow 3s ease-in-out infinite;
}

@keyframes auth-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(124,58,237,0.4); }
  50% { box-shadow: 0 4px 30px rgba(124,58,237,0.6), 0 0 60px rgba(124,58,237,0.15); }
}

.auth-logo-icon svg {
  width: 26px;
  height: 26px;
}

.auth-logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 0.9rem;
  margin-bottom: 36px;
  font-weight: 400;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-input-group {
  position: relative;
}

.auth-input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.auth-input:focus {
  border-color: rgba(124,58,237,0.6);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
  background: rgba(255,255,255,0.07);
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  bottom: 15px;
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  transition: color 200ms;
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-group:focus-within .auth-input-icon {
  color: rgba(124,58,237,0.8);
}

/* Submit button */
.auth-btn {
  position: relative;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #7C3AED 0%, #6366F1 50%, #EC4899 100%);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(124,58,237,0.3);
  animation: auth-btn-gradient 4s ease infinite;
}

@keyframes auth-btn-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.45);
}

.auth-btn:active {
  transform: translateY(0) scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Shimmer effect on button */
.auth-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: auth-shimmer 3s ease-in-out infinite;
}

@keyframes auth-shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.auth-btn .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* Error shake */
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.auth-card.shake {
  animation: auth-shake 400ms ease-in-out;
}

/* Toast notification */
.auth-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: rgba(220, 38, 38, 0.9);
  backdrop-filter: blur(20px);
  color: #fff;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10000;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* Footer text */
.auth-footer {
  text-align: center;
  margin-top: 28px;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
}

/* Navbar logout */
.btn-logout {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary, #94A3B8);
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  border-color: var(--color-destructive);
  color: var(--color-destructive);
  background: rgba(220,38,38,0.05);
}

/* App hidden during auth */
.app-hidden {
  display: none !important;
}

/* Responsive auth */
@media (max-width: 480px) {
  .auth-card {
    margin: 16px;
    padding: 36px 24px 28px;
    border-radius: 20px;
  }
  .auth-logo-text { font-size: 1.5rem; }
  .auth-logo-icon { width: 40px; height: 40px; border-radius: 12px; }
}


/* Streaming results animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error banner retry bar */
.error-banner {
  flex-direction: column;
}
.error-banner #error-retry-bar .input {
  border-radius: var(--radius-md);
}
.error-banner #btn-retry-generate {
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.error-banner #btn-retry-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
