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

/* ===========================
   Meta Ads Bulk Upload - Style System
   Dark glassmorphism — design system Trustwise AI (Ads Analyst)
   =========================== */

/* ===========================
   1. CSS VARIABLES
   =========================== */
:root {
  /* Cores Primárias (navy escuro — dark único) */
  --primary-dark: #0a1520;
  --primary-medium: #13294a;
  --primary-light: #1f4a7a;
  --accent-cyan: #4f8ef7;
  --accent-teal: #6ba3ff;

  /* Gradientes - Navy profundo / glass */
  --gradient-primary: linear-gradient(160deg, #0c1a2e 0%, #0a1520 40%, #08101c 100%);
  --gradient-card: linear-gradient(135deg, rgba(15,28,46,0.7), rgba(10,21,32,0.55));
  --gradient-glow: radial-gradient(circle, rgba(79,142,247,0.2) 0%, transparent 70%);

  /* Cores de Suporte */
  --text-primary: #f0f2f5;
  --text-secondary: #94a8b8;
  --text-muted: #6b8399;
  --bg-main: #0a1520;
  --bg-card: rgba(13, 28, 50, 0.82);
  --border-light: rgba(79, 142, 247, 0.18);

  /* Cores de Estado */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #f87171;
  --info: #6ba3ff;
  --whatsapp: #25d366;

  /* Sombras e Glows */
  --shadow-sm: 0 2px 8px rgba(5,15,35,0.25);
  --shadow-md: 0 4px 16px rgba(5,15,35,0.35);
  --shadow-lg: 0 8px 32px rgba(5,15,35,0.50);
  --glow-cyan: 0 0 24px rgba(79,142,247,0.35);
  --glow-cyan-strong: 0 0 36px rgba(79,142,247,0.55);

  /* Espaçamento */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;

  /* Raios de Borda */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Tipografia */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Tamanhos de Fonte */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 40px;

  /* Pesos de Fonte */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* ── Tokens dark (design system Analyst) ── */
  --bg-2: #0c1a2e;
  --bg-gradient: linear-gradient(160deg, #0c1a2e 0%, #0a1520 40%, #08101c 100%);
  --glass: rgba(10, 26, 52, 0.82);
  --glass-border: rgba(79, 142, 247, 0.18);
  --glass-hover: rgba(20, 50, 100, 0.55);
  --surface: rgba(10, 26, 52, 0.78);
  --surface-2: rgba(35, 80, 150, 0.14);
  --border: rgba(79, 142, 247, 0.14);
  --text: #f0f2f5;
  --text-dim: #94a8b8;
  --accent: #4f8ef7;
  --accent-hover: #6ba3ff;
  --accent-active: #2563eb;
  --accent-glow: rgba(79, 142, 247, 0.35);
  --accent-2: #a78bfa;
  --gradient-action: linear-gradient(135deg, #4f8ef7, #2563eb);
  --glow-accent: 0 0 24px rgba(79, 142, 247, 0.35);
  --blur: 16px;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===========================
   2. RESET & BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--text);
  /* Navy dark — design system Analyst */
  background: var(--bg-gradient);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  /* will-change removido — auto é o padrão e não otimiza nada */
}

/* Textura sutil — gradiente puro, sem feTurbulence (GPU heavy) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 65% 55% at 60% 15%, rgba(100,160,255,0.13) 0%, transparent 70%),
              radial-gradient(ellipse 55% 50% at 80% 75%, rgba(59,130,246,0.10) 0%, transparent 65%),
              radial-gradient(ellipse 45% 40% at 55% 45%, rgba(180,215,255,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Orbs removidos - agora são desenhados no canvas como nebulosas */

/* ===========================
   3. TYPOGRAPHY
   =========================== */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
}

h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-2);
}

code {
  font-family: var(--font-mono);
  background: rgba(79, 142, 247, 0.12);
  color: var(--text);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

small {
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-weight: var(--font-medium);
}

.subtitle {
  color: var(--text-dim);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.help-text {
  color: var(--text-dim);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  line-height: 1.5;
  font-weight: var(--font-medium);
}

/* Help text dentro de cards e headers — texto legível */
.card .help-text,
.ad-preview-card .help-text,
.review-header .help-text {
  color: var(--text-dim) !important;
  text-shadow: none !important;
}

/* Textareas de anúncios - garantir texto claro e legível */
.ad-preview-card .editable-text,
.card .editable-text {
  color: var(--text) !important;
  text-shadow: none !important;
}

/* ===========================
   4. LAYOUT & CONTAINERS
   =========================== */
.container {
  max-width: calc(100vw - 240px - 80px); /* Largura total - sidebar - padding lateral */
  width: 100%;
  margin: 0 auto;
  padding: var(--space-3);
  position: relative;
  z-index: 1;
}

/* Em mobile (sem sidebar) permitir largura total */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
  }
}

/* Segunda nebulosa - desenhada no canvas */

/* Container transparente - apenas cards tem fundo */
body:not(.login-page) .container {
  background: transparent;
  min-height: 100vh;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  animation: fadeInContainer 0.6s ease-out;
}

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

/* ===========================
   5. COMPONENTS - BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-family: var(--font-primary);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-action);
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-accent);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: #0e9e6f;
}

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

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* Botão secundário em fundo navy - contraste com accent */
body:not(.login-page) .btn-secondary {
  background: rgba(79, 142, 247, 0.10);
  color: var(--accent-hover);
  border: 2px solid rgba(79, 142, 247, 0.40);
  font-weight: var(--font-semibold);
}

body:not(.login-page) .btn-secondary:hover {
  background: rgba(79, 142, 247, 0.20);
  border-color: rgba(79, 142, 247, 0.60);
  color: #fff;
  box-shadow: var(--glow-accent);
}

/* Botão secundário dentro de cards glass */
body:not(.login-page) .card .btn-secondary {
  background: var(--surface-2);
  color: var(--accent-hover);
  border: 2px solid rgba(79, 142, 247, 0.40);
  font-weight: var(--font-semibold);
}

body:not(.login-page) .card .btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent);
  background: rgba(79, 142, 247, 0.12);
}

.btn-remove:hover {
  color: var(--error);
  background: rgba(248, 113, 113, 0.12);
}

.btn-copy {
  font-size: var(--text-sm);
}

/* ===========================
   5. COMPONENTS - CARDS
   =========================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.card:hover {
  transform: translateY(-2px); /* Reduzido de -4px para -2px */
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 142, 247, 0.30);
}

/* Cards na página principal - efeito flutuante mais forte */
body:not(.login-page) .card {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
}

.card-glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}

.card-session {
  background: var(--gradient-card);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.session-icon {
  font-size: 48px;
  color: var(--accent);
  min-width: 64px;
  text-align: center;
}

.session-content {
  flex: 1;
}

.session-id-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.session-id-display code {
  flex: 1;
  padding: var(--space-1) var(--space-2);
  background: rgba(79, 142, 247, 0.12);
  border-radius: var(--radius-sm);
}

.offers-summary {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.section-card {
  position: relative;
}

.section-card h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-card h3 i {
  color: var(--accent);
}

/* ===========================
   5. COMPONENTS - INPUTS
   =========================== */
.input-wrapper {
  position: relative;
  margin-bottom: var(--space-3);
}

.input-field {
  width: 100%;
  padding: var(--space-2);
  border: 1.5px solid rgba(79, 142, 247, 0.22);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-primary);
  background: rgba(12, 30, 62, 0.55);
  color: var(--text);
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.14);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-wrapper i.input-icon-left {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrapper .input-field {
  padding-left: var(--space-5);
}

textarea.input-field {
  min-height: 200px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ===========================
   5. COMPONENTS - SELECTS
   =========================== */
.select-wrapper {
  position: relative;
  margin-bottom: var(--space-3);
}

.select-icon {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
  z-index: 1;
}

.select-arrow {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  transition: transform 0.3s ease;
}

.select-modern {
  width: 100%;
  padding: var(--space-2) var(--space-5);
  padding-left: var(--space-6);
  border: 1.5px solid rgba(79, 142, 247, 0.22);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-primary);
  background: rgba(12, 30, 62, 0.55);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s ease;
}

.select-modern:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.14);
}

.select-modern:focus + .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Opções do dropdown nativo — fundo navy legível */
.select-modern option {
  background: var(--bg-2);
  color: var(--text);
}

label {
  display: block;
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
  color: var(--text);
  font-size: var(--text-base);
}

/* Labels dentro de cards — texto claro legível */
.card label,
.ad-preview-card label {
  color: var(--text) !important;
  text-shadow: none !important;
}

/* ===========================
   5. COMPONENTS - BADGES
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.badge-cadastro {
  background: rgba(79, 142, 247, 0.18);
  color: var(--accent-hover);
  border: 1px solid rgba(79, 142, 247, 0.30);
}

.badge-count {
  background: var(--accent);
  color: #fff;
  min-width: 24px;
  height: 24px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-type {
  background: rgba(79, 142, 247, 0.12);
  color: var(--accent-hover);
}

/* Status Badges */
.badge-status-active {
  background: var(--success);
  color: #fff;
}

.badge-status-paused {
  background: rgba(148, 168, 184, 0.25);
  color: var(--text-dim);
}

/* Container de múltiplos badges */
.adset-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===========================
   5. COMPONENTS - STATUS
   =========================== */
.status {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  display: none;
  animation: slideUp 0.3s ease-out;
}

.status.show {
  display: block;
}

.status-success,
.status.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--success);
  color: #6ee7b7;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.status-error,
.status.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid var(--error);
  color: #fca5a5;
  animation: slideUp 0.3s ease-out, shake 0.5s ease-out;
}

.status-processing,
.status.processing {
  background: rgba(4, 14, 30, 0.75);
  border: 1px solid rgba(79, 142, 247, 0.16);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: rgba(255,255,255,0.85);
  /* Linha de acento no topo */
  background-image:
    radial-gradient(circle at 70% 20%, rgba(79, 142, 247, 0.04) 0%, transparent 50%);
}

.status-box {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
}

.success-icon {
  font-size: 64px;
  color: var(--success);
  margin-bottom: var(--space-2);
  animation: scaleIn 0.5s ease-out;
}

.success-summary {
  margin: var(--space-3) 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-dim);
}

/* ===========================
   5. COMPONENTS - SKELETON LOADERS
   =========================== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(35, 80, 150, 0.10) 0%,
    rgba(79, 142, 247, 0.22) 50%,  /* Toque de azul */
    rgba(35, 80, 150, 0.10) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 48px;
  width: 100%;
}

.skeleton-text {
  height: 20px;
  width: 60%;
  margin-bottom: var(--space-1);
}

.loading {
  text-align: center;
  padding: var(--space-5);
  color: var(--text-dim);
}

.spinner {
  border: 3px solid rgba(79, 142, 247, 0.15);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-2);
}

/* ===========================
   6. PAGE-SPECIFIC - LOGIN
   =========================== */
body.login-page {
  background: var(--gradient-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-3);
  position: relative;
  overflow: hidden;
}

/* Efeito de textura/noise chaviscado + Glow background */
body.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(79, 142, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(79, 142, 247, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body.login-page::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: var(--gradient-glow);
  bottom: 15%;
  right: 15%;
  filter: blur(30px);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.login-icon {
  text-align: center;
  margin-bottom: var(--space-3);
  font-size: 48px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Logo redonda com máscara circular */
.login-logo img {
  border-radius: 12px;
  background: #000;
  padding: 8px;
  transition: transform 0.3s ease;
}

.login-logo img:hover {
  transform: scale(1.05);
}

.login-container h1 {
  color: var(--text);
  text-align: center;
  font-weight: var(--font-bold);
}

.login-container .subtitle {
  text-align: center;
  color: var(--text-dim);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.error.show {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  border: 1px solid var(--error);
}

/* ===========================
   6. PAGE-SPECIFIC - UPLOAD
   =========================== */
.upload-area {
  border: 2px dashed rgba(79, 142, 247, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  background: rgba(79, 142, 247, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover {
  background: rgba(79, 142, 247, 0.10);
  transform: scale(1.01);
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

.upload-area svg,
.upload-area i {
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.creative-list {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}

.creative-card {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  transition: all 0.3s ease;
  animation: fadeInUp 0.3s ease-out backwards;
}

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

.creative-preview {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.creative-preview img,
.creative-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creative-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.creative-card:hover .creative-overlay {
  opacity: 1;
}

.btn-preview {
  background: white;
  color: var(--primary-dark);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.creative-footer {
  padding: var(--space-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(79, 142, 247, 0.06);
}

/* ===========================
   Breadcrumb com Barra de Progresso
   =========================== */
.breadcrumb-progress {
  margin-bottom: var(--space-4);
  position: relative;
}

.progress-bar {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  z-index: 0;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-action);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(79, 142, 247, 0.5), 0 0 24px rgba(79, 142, 247, 0.25);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.breadcrumb-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(20, 40, 65, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.step-label {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  font-weight: var(--font-medium);
  transition: all 0.3s ease;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: transparent;
  margin: 0 var(--space-1);
  position: relative;
  top: -12px;
}

/* Step completed (checkmark) */
.step.completed .step-circle {
  background: var(--gradient-action);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.5);
}

.step.completed .step-label {
  color: #fff;
  font-weight: var(--font-semibold);
}

/* Step active (pulsing glow) */
.step.active .step-circle {
  background: var(--gradient-action);
  border-color: var(--accent);
  color: #fff;
  box-shadow:
    0 0 20px rgba(79, 142, 247, 0.6),
    0 0 40px rgba(79, 142, 247, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.2);
  animation: pulse-step 2s ease-in-out infinite;
  transform: scale(1.1);
}

.step.active .step-label {
  color: #fff;
  font-weight: var(--font-bold);
  text-shadow: 0 0 10px rgba(79, 142, 247, 0.5);
}

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

/* Responsive */
@media (max-width: 640px) {
  .step-label {
    font-size: var(--text-xs);
  }

  .step-circle {
    width: 40px;
    height: 40px;
    font-size: var(--text-base);
  }

  .step-connector {
    margin: 0 4px;
  }
}

/* Legacy breadcrumb (fallback) */
.breadcrumb {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

body:not(.login-page) .breadcrumb {
  color: rgba(255, 255, 255, 0.8);
}

/* ===========================
   6. PAGE-SPECIFIC - SELECT AD SETS
   =========================== */
.section {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.section:last-child {
  border-bottom: none;
}

/* ===========================
   7. ANIMATIONS
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

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

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
  /* Removido box-shadow animado para performance */
}

@keyframes glow-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(30px, -30px) scale(1.1);
    opacity: 0.8;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Animações de background */
@keyframes oceanGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes textureShift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(15px, -15px) scale(1.03);
    opacity: 0.8;
  }
}

/* Constellation canvas */
#constellationCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  /* will-change removido — contents não é valor válido para canvas */
}

/* ===========================
   7.5 SIDEBAR MENU
   =========================== */
.sidebar-menu {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: calc(100vh / 0.70);
  zoom: 0.70;
  background: rgba(9, 14, 24, 0.98);
  border-right: 1px solid rgba(100, 150, 200, 0.10);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  height: 40px;
  filter: drop-shadow(0 2px 8px rgba(79, 142, 247, 0.3));
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(79, 142, 247, 0.12);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-weight: var(--font-medium);
  font-size: 13px;
  position: relative;
  white-space: normal;
  line-height: 1.3;
}

.sidebar-link:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-link.active {
  /* Alinhado ao .nav-item.active do Ads Analyst (padrão): tom sutil + texto
     accent, em vez do preenchimento gradiente cheio. "Parecer um app só". */
  background: rgba(79, 142, 247, 0.10);
  color: var(--accent);
  font-weight: var(--font-semibold);
  box-shadow: none;
  border-left: 3px solid var(--accent);
}

.sidebar-link.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-link-bottom {
  margin-top: auto;
  font-size: 12px;
  opacity: 0.65;
}

.sidebar-link-bottom:hover {
  opacity: 1;
}

.sidebar-link-bottom i {
  font-size: 15px !important;
}

.badge-soon {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  margin-left: auto;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-2);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: transparent;
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: rgba(255, 107, 107, 0.9);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: var(--font-medium);
}

.btn-logout:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* Ajustar conteúdo principal */
.main-content {
  margin-left: 168px;
  transition: margin-left 0.3s ease;
}

/* Botão hamburger mobile - escondido no desktop */
.mobile-menu-toggle {
  display: none;
}

/* Mobile: esconder sidebar por padrão */
@media (max-width: 768px) {
  .sidebar-menu {
    transform: translateX(-100%);
  }

  .sidebar-menu.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  /* Mostrar botão hamburger flutuante */
  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    background: var(--primary-dark);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-menu-toggle:hover {
    background: var(--primary-medium);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
}

/* ===========================
   8. UTILITIES
   =========================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

.w-full { width: 100%; }

/* ===========================
   9. RESPONSIVE
   =========================== */
@media (max-width: 640px) {
  :root {
    --text-2xl: 24px;
    --text-xl: 20px;
    --text-lg: 16px;
  }

  .container {
    padding: var(--space-2);
  }

  .card {
    padding: var(--space-3);
  }

  .creative-list {
    grid-template-columns: repeat(2, 1fr);
  }

  textarea.input-field {
    min-height: 120px;
  }

  .card-session {
    flex-direction: column;
    text-align: center;
  }

  .session-icon {
    font-size: 32px;
  }

  .offers-summary {
    justify-content: center;
  }

  .login-container {
    padding: var(--space-3);
  }

  .login-icon {
    font-size: 32px;
  }
}

/* ===========================
   9.5. HIERARCHICAL SELECTION (Campaigns → Ad Sets)
   =========================== */

/* Layout de 2 colunas */
.selection-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
  min-height: 500px;
}

.campaigns-column,
.adsets-column {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
}

.column-header {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--glass-border);
}

.column-header h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1) 0;
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.column-header h3 i {
  font-size: var(--text-xl);
  color: var(--accent);
}

.column-header .help-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-dim);
}

/* Campanhas: Card List */
.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

.campaigns-list::-webkit-scrollbar {
  width: 6px;
}

.campaigns-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.campaigns-list::-webkit-scrollbar-thumb {
  background: rgba(79, 142, 247, 0.30);
  border-radius: 3px;
}

.campaign-card {
  position: relative;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.campaign-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.campaign-card.selected {
  background: linear-gradient(135deg,
    rgba(79, 142, 247, 0.18),
    rgba(37, 99, 235, 0.08));
  border-color: var(--accent);
  border-width: 3px;
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.3);
  padding-left: calc(var(--space-3) - 1px); /* Compensar border mais grosso */
}

.campaign-card.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.campaign-name {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.4;
}

.campaign-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.campaign-adset-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.campaign-adset-count i {
  font-size: var(--text-xs);
  color: var(--accent);
}

/* Filtros de objetivo */
.objective-filters {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.filter-checkbox {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.filter-checkbox:hover {
  background: rgba(79, 142, 247, 0.08);
}

.filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Breadcrumb de conexão visual */
.campaign-breadcrumb {
  background: linear-gradient(90deg,
    rgba(79, 142, 247, 0.14),
    transparent);
  border-left: 4px solid var(--accent);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text);
}

.campaign-breadcrumb i {
  color: var(--accent);
}

.btn-clear-campaign {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-campaign:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
}

/* Ad Sets: Lista com scroll */
.adsets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.adsets-list::-webkit-scrollbar {
  width: 6px;
}

.adsets-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.adsets-list::-webkit-scrollbar-thumb {
  background: rgba(79, 142, 247, 0.30);
  border-radius: 3px;
}

.adset-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-2);
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.adset-checkbox-item:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.adset-checkbox-item.checked {
  background: rgba(79, 142, 247, 0.14);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79, 142, 247, 0.2);
}

.adset-checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.adset-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0; /* Para permitir text-overflow */
}

.adset-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.adset-id {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  opacity: 0.5;
}

.empty-state p {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  margin: 0;
}

/* Contador de seleção */
.selection-summary {
  margin-top: var(--space-3);
  padding: var(--space-2);
  background: rgba(79, 142, 247, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  text-align: center;
  color: var(--text-dim);
}

.selection-summary strong {
  color: var(--text);
  font-weight: var(--font-semibold);
}

/* Animações */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.campaign-card {
  animation: slideInLeft 0.3s ease-out backwards;
}

.adset-checkbox-item {
  animation: slideInRight 0.3s ease-out backwards;
}

/* Loading states */
.loading-campaigns,
.loading-adsets {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-secondary);
}

.loading-campaigns .spinner,
.loading-adsets .spinner {
  margin-bottom: var(--space-2);
}

/* Responsivo Mobile */
@media (max-width: 768px) {
  .selection-container {
    grid-template-columns: 1fr;
  }

  .campaigns-column {
    max-height: 300px;
  }

  .campaigns-list {
    max-height: 250px;
  }

  .adsets-list {
    max-height: 300px;
  }

  .campaign-card:hover {
    transform: none; /* Remover translateX em mobile */
  }
}

/* ===========================
   10. ACCESSIBILITY
   =========================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Placement Badges */
.badge-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-feed {
  background: rgba(79, 142, 247, 0.18);
  color: #93b8fb;
}

.badge-stories {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
}

.badge-reels {
  background: rgba(244, 114, 182, 0.18);
  color: #f9a8d4;
}

.badge-placement {
  background: rgba(148, 168, 184, 0.16);
  color: var(--text-dim);
}

/* ===========================
   11. TOAST NOTIFICATIONS
   =========================== */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(8, 28, 50, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: all;
  min-width: 280px;
  max-width: 400px;
  cursor: pointer;
  user-select: none;
  animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.leaving {
  animation: toastSlideOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast i {
  font-size: 16px;
  flex-shrink: 0;
}

.toast span {
  flex: 1;
  line-height: 1.4;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success i { color: var(--success); }

.toast-error { border-left: 4px solid var(--error); }
.toast-error i { color: var(--error); }

.toast-info { border-left: 4px solid var(--accent-cyan); }
.toast-info i { color: var(--accent-cyan); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning i { color: var(--warning); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
}

/* ===========================
   12. MICRO-INTERACTIONS
   =========================== */

/* Botão: press feedback */
.btn:active:not(:disabled) {
  transform: scale(0.97) translateY(1px) !important;
  transition: transform 0.08s ease !important;
}

/* Ícone flutuante (empty states) */
@keyframes iconFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.icon-float {
  animation: iconFloat 3s ease-in-out infinite;
  display: inline-block;
}

/* Badge pulse quando atualiza */
@keyframes badgePulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.badge-pulse {
  animation: badgePulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================
   13. STAGGER ENTRANCE
   =========================== */
.stagger-children > * {
  animation: fadeInUp 0.4s ease-out both;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0ms;   }
.stagger-children > *:nth-child(2)  { animation-delay: 60ms;  }
.stagger-children > *:nth-child(3)  { animation-delay: 120ms; }
.stagger-children > *:nth-child(4)  { animation-delay: 180ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 240ms; }
.stagger-children > *:nth-child(6)  { animation-delay: 300ms; }
.stagger-children > *:nth-child(7)  { animation-delay: 360ms; }
.stagger-children > *:nth-child(8)  { animation-delay: 420ms; }
.stagger-children > *:nth-child(9)  { animation-delay: 480ms; }
.stagger-children > *:nth-child(10) { animation-delay: 540ms; }
.stagger-children > *:nth-child(n+11) { animation-delay: 600ms; }

/* ===========================
   14. SKELETON CARDS (dashboard)
   =========================== */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(35, 80, 150, 0.10) 0%,
    rgba(79, 142, 247, 0.22) 50%,
    rgba(35, 80, 150, 0.10) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-img {
  background: linear-gradient(
    90deg,
    rgba(35, 80, 150, 0.10) 0%,
    rgba(79, 142, 247, 0.22) 50%,
    rgba(35, 80, 150, 0.10) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ===========================
   15. GLOBAL SCROLLBAR
   =========================== */
html {
  scroll-behavior: smooth;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 142, 247, 0.15) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(79, 142, 247, 0.15);
  border-radius: 4px;
  transition: background 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 142, 247, 0.30);
}

/* ===========================
   16. UPLOAD DRAG OVER ENHANCED
   =========================== */
.upload-area.drag-over {
  background: rgba(79, 142, 247, 0.10) !important;
  border-color: var(--accent) !important;
  border-style: solid !important;
  box-shadow: var(--glow-cyan), inset 0 0 40px rgba(79, 142, 247, 0.05) !important;
  transform: scale(1.015) !important;
}

.upload-area.drag-over i {
  color: var(--accent);
  animation: iconFloat 0.8s ease-in-out infinite;
}

/* ===========================
   17. PASSWORD TOGGLE BUTTON
   =========================== */
.btn-password-toggle {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-password-toggle:hover {
  color: var(--accent);
  background: rgba(79, 142, 247, 0.10);
}

/* Input with password toggle: não sobrepor com padding da direita */
.input-wrapper.has-toggle .input-field {
  padding-right: var(--space-6);
}

/* ===========================
   18. CARD HOVER — SUBTLE BACKGROUND SHIFT
   =========================== */
.card:hover {
  background: linear-gradient(135deg, rgba(20,40,70,0.85), rgba(12,26,44,0.70));
}

/* ===========================
   19. ORB NEURAL — AI LOADING OVERLAY
   =========================== */
.ai-loading-overlay {
  position: fixed;
  top: 0;
  left: 240px; /* Respeitar sidebar */
  right: 0;
  bottom: 0;
  background: rgba(4, 14, 30, 0.85);
  /* Gradientes ambiente sutis (sem grid) */
  background-image:
    radial-gradient(circle at 28% 38%, rgba(79,142,247, 0.05) 0%, transparent 52%),
    radial-gradient(circle at 75% 68%, rgba(107,163,255, 0.04) 0%, transparent 48%);
  background-size: 100% 100%, 100% 100%;
  border-left: 1px solid rgba(79,142,247, 0.10);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 40px 24px;
  animation: overlayFadeIn 0.4s ease-out forwards;
}

/* Linha de acento no topo */
.ai-loading-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(79,142,247,0.5) 30%, rgba(107,163,255,0.6) 70%, transparent 100%);
  pointer-events: none;
}

/* Mobile: cobrir tela toda (sem sidebar) */
@media (max-width: 768px) {
  .ai-loading-overlay {
    left: 0;
    border-left: none;
  }
}

.ai-loading-overlay.leaving {
  animation: overlayFadeOut 0.5s ease-in forwards;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes overlayFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.98); }
}

/* ── Energy Card — Animated Border (cross-browser) ── */
.ai-energy-card-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Glow ambiente estático */
.ai-energy-card-wrap::before {
  content: '';
  position: absolute;
  inset: -60px;
  border-radius: 40px;
  background: radial-gradient(circle, rgba(79,142,247,0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.ai-energy-card {
  position: relative;
  padding: 28px 32px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgb(4,14,30), rgb(8,22,50));
  border: 1px solid rgba(79,142,247,0.06);
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 100%;
  z-index: 1;
}

/* Done state — borda teal estática, arcos somem */
.ai-energy-card.done {
  border-color: rgba(107,163,255,0.4);
  box-shadow: 0 0 40px rgba(107,163,255,0.25), 0 24px 64px rgba(0,0,0,0.55);
}
@keyframes doneGlow {
  to { opacity: 0; }
}

/* Ícone central (substitui o orb) */
.ai-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent-cyan);
  box-shadow: 0 0 24px rgba(79,142,247,0.12);
  flex-shrink: 0;
}
.ai-card-icon.done {
  background: rgba(107,163,255,0.15);
  border-color: rgba(107,163,255,0.4);
  color: var(--accent-teal);
}

/* Thinking text */
.ai-thinking-text {
  font-size: 12px;
  color: rgba(79,142,247,0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  text-align: center;
  min-height: 20px;
  transition: opacity 0.3s ease;
}
.ai-thinking-text.fade-out {
  opacity: 0;
}

/* Steps v2 */
.ai-steps-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.ai-step-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.ai-step-v2::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.ai-step-v2.pending {
  opacity: 0.24;
}
.ai-step-v2.active {
  opacity: 1;
  background: rgba(79,142,247,0.05);
  border-color: rgba(79,142,247,0.16);
  box-shadow: 0 2px 12px rgba(79,142,247,0.06);
}
.ai-step-v2.active::before {
  background: linear-gradient(180deg, var(--accent-cyan), rgba(79,142,247,0.4));
  animation: leftBarPulse 1.5s ease-in-out infinite;
}
.ai-step-v2.completed {
  opacity: 1;
  background: rgba(107,163,255,0.05);
  border-color: rgba(107,163,255,0.12);
}
.ai-step-v2.completed::before {
  background: var(--accent-teal);
}

@keyframes leftBarPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(79,142,247,0.4); }
  50%       { box-shadow: 0 0 16px rgba(79,142,247,0.8); }
}

/* Step number */
.ai-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.4s ease;
}
.ai-step-v2.pending  .ai-step-num { border: 2px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.25); }
.ai-step-v2.active   .ai-step-num { border: 2px solid var(--accent-cyan); color: var(--accent-cyan); background: rgba(79,142,247,0.08); animation: numRing 1.5s ease-in-out infinite; }
.ai-step-v2.completed .ai-step-num { background: var(--accent-teal); border: 2px solid var(--accent-teal); color: white; }

@keyframes numRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,142,247,0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(79,142,247,0.08); }
}

/* Step info */
.ai-step-info { flex: 1; min-width: 0; }
.ai-step-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
}
.ai-step-v2.pending .ai-step-title { color: rgba(255,255,255,0.28); }
.ai-step-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.ai-step-v2.active .ai-step-subtitle { color: rgba(79,142,247,0.65); }

/* Step status icon */
.ai-step-status { width: 20px; text-align: center; font-size: 13px; flex-shrink: 0; }
.ai-step-v2.pending   .ai-step-status { color: rgba(255,255,255,0.12); }
.ai-step-v2.active    .ai-step-status { color: var(--accent-cyan); }
.ai-step-v2.completed .ai-step-status { color: var(--accent-teal); }

/* ===========================
   20. MISSION CONTROL — CREATE ADS PROGRESS
   =========================== */
.mission-control {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Header */
.mc-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mc-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(79,142,247,0.12);
  border: 1px solid rgba(79,142,247,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--accent-cyan);
  animation: mcIconSpin 3s linear infinite;
  flex-shrink: 0;
}
@keyframes mcIconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.mc-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  flex: 1;
}
.mc-elapsed {
  font-size: 11px;
  color: rgba(255,255,255,0.32);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Counter */
.mc-counter {
  display: flex;
  align-items: baseline;
  gap: 0;
  justify-content: center;
  padding: 4px 0;
}
.mc-count-current {
  font-size: 52px;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mc-count-current.bump {
  animation: counterBump 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes counterBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.mc-count-sep {
  font-size: 26px;
  color: rgba(255,255,255,0.25);
  margin: 0 6px;
  padding-bottom: 4px;
}
.mc-count-total {
  font-size: 34px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  line-height: 1;
}
.mc-count-label {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-left: 10px;
  align-self: flex-end;
  padding-bottom: 6px;
}

/* Progress bar */
.mc-progress-track {
  position: relative;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  height: 7px;
  overflow: hidden;
}
.mc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
  border-radius: 99px;
  transition: width 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}
.mc-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -80px;
  width: 80px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: mcShimmer 1.8s linear infinite;
}
@keyframes mcShimmer {
  from { transform: translateX(0); }
  to   { transform: translateX(600px); }
}
.mc-progress-pct {
  text-align: right;
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* Ad items list */
.mc-ads-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 130px;
  overflow: hidden;
  position: relative;
}
.mc-ads-list::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(to bottom, rgba(10,25,50,0.6), transparent);
  z-index: 1;
  pointer-events: none;
}
.mc-ad-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  animation: mcAdIn 0.3s ease-out;
  flex-shrink: 0;
}
@keyframes mcAdIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.mc-ad-item.success { background: rgba(16,185,129,0.12); color: rgba(255,255,255,0.72); }
.mc-ad-item.success i { color: var(--success); font-size: 12px; }
.mc-ad-item.processing { background: rgba(79,142,247,0.07); color: var(--accent-cyan); }
.mc-ad-item.processing i { color: var(--accent-cyan); font-size: 12px; }
.mc-ad-item.error { background: rgba(255,107,107,0.1); color: rgba(255,180,180,0.85); }
.mc-ad-item.error i { color: var(--error); font-size: 12px; }
.mc-ad-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pre-launch state */
.mc-prelaunch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.mc-prelaunch-icon {
  font-size: 36px;
  color: rgba(79,142,247,0.55);
  animation: prelaunchPulse 1.8s ease-in-out infinite;
}
@keyframes prelaunchPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%       { opacity: 0.85; transform: scale(1.08); }
}
.mc-prelaunch-text {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.mc-prelaunch-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

/* ===========================
   20b. CREATE ADS OVERLAY — Redesigned Mission Control
   =========================== */

/* Counter (small, below orb) */
.mc-overlay-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  margin-top: -4px;
}
.mc-overlay-count-current {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mc-overlay-count-current.bump {
  animation: counterBump 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mc-overlay-count-sep {
  font-size: 18px;
  color: rgba(255,255,255,0.25);
  margin: 0 4px;
}
.mc-overlay-count-total {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255,255,255,0.40);
  line-height: 1;
}
.mc-overlay-count-label {
  font-size: 11px;
  color: rgba(255,255,255,0.30);
  margin-left: 8px;
  align-self: flex-end;
  padding-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Progress bar inside card */
.mc-overlay-progress {
  width: 100%;
  max-width: 340px;
}
.mc-overlay-progress-track {
  position: relative;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
}
.mc-overlay-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
  border-radius: 99px;
  transition: width 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}
.mc-overlay-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -80px;
  width: 80px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: mcShimmer 1.8s linear infinite;
}
.mc-overlay-progress-pct {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Ad list inside card (compact, secondary) */
.mc-overlay-ads {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 100px;
  overflow: hidden;
  position: relative;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.mc-overlay-ad-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  animation: mcAdIn 0.3s ease-out;
  flex-shrink: 0;
}
.mc-overlay-ad-item.success { color: rgba(255,255,255,0.55); }
.mc-overlay-ad-item.success i { color: var(--accent-teal); font-size: 10px; }
.mc-overlay-ad-item.processing { color: rgba(79,142,247,0.75); }
.mc-overlay-ad-item.processing i { color: var(--accent-cyan); font-size: 10px; }
.mc-overlay-ad-item.error { color: rgba(255,180,180,0.70); }
.mc-overlay-ad-item.error i { color: var(--error); font-size: 10px; }

/* Elapsed timer badge (top-right of card) */
.mc-overlay-elapsed {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* ── Neural Orb — CSS-only AI icon ── */
.neural-orb {
  position: relative;
  width: 48px;
  height: 48px;
}
.neural-orb.sm {
  width: 32px;
  height: 32px;
}

/* Core — bright pulsing center (slow, ethereal) */
.neural-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 30%; height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,142,247,1) 0%, rgba(79,142,247,0.4) 60%, transparent 100%);
  box-shadow: 0 0 12px rgba(79,142,247,0.7), 0 0 24px rgba(79,142,247,0.3);
  animation: neuralPulse 3.5s ease-in-out infinite;
}
@keyframes neuralPulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 0.7; }
  50%      { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
}

/* Ring — dashed circle rotating (slow) */
.neural-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px dashed rgba(79,142,247,0.32);
  animation: neuralSpin 10s linear infinite;
}
@keyframes neuralSpin {
  to { transform: rotate(360deg); }
}

/* Second ring — larger, weaker, rotates counter-clockwise */
.neural-ring-2 {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(79,142,247,0.16);
  animation: neuralSpinReverse 15s linear infinite;
}
.neural-orb.sm .neural-ring-2 {
  inset: -4px;
  border-width: 0.8px;
}
@keyframes neuralSpinReverse {
  to { transform: rotate(-360deg); }
}

/* Orbiting dots — 3 neurons (slow, ethereal) */
.neural-dot {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(79,142,247,0.6);
  top: 50%; left: 50%;
  animation: neuralOrbit 5.5s linear infinite;
}
.neural-dot:nth-child(4) { /* dot 1 — após neural-core, neural-ring, neural-ring-2 */
  animation-delay: 0s;
  --orbit-radius: 44%;
}
.neural-dot:nth-child(5) { /* dot 2 */
  animation-delay: -1.8s;
  --orbit-radius: 44%;
  background: var(--accent-teal);
  box-shadow: 0 0 6px rgba(107,163,255,0.6);
}
.neural-dot:nth-child(6) { /* dot 3 */
  animation-delay: -3.6s;
  --orbit-radius: 44%;
  width: 4px; height: 4px;
  opacity: 0.7;
}
@keyframes neuralOrbit {
  from { transform: translate(-50%,-50%) rotate(0deg) translateX(var(--orbit-radius)) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg) translateX(var(--orbit-radius)) rotate(-360deg); }
}

/* Wave ripple — pulso de onda que passa pelos anéis e se expande para o espaço externo */
.neural-wave {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(79,142,247, 0.55);
  pointer-events: none;
  opacity: 0;                           /* invisível antes da animação começar — evita flash estático */
  animation: waveRipple 9s ease-out infinite;
}
.neural-wave:last-child {
  animation-delay: 4.5s;
  border-color: rgba(79,142,247, 0.38);
}

@keyframes waveRipple {
  /* Onda parte do núcleo, passa pelos anéis, expande além — fica mais fraca com a distância */
  0%   { transform: translate(-50%, -50%) scale(0.25); opacity: 0; }
  6%   { opacity: 0.72; }                                              /* Flash de energia */
  100% { transform: translate(-50%, -50%) scale(3.2);  opacity: 0; }  /* Expande 3× além do orbe */
}

/* Small variant adjustments */
.neural-orb.sm .neural-core { box-shadow: 0 0 8px rgba(79,142,247,0.6); }
.neural-orb.sm .neural-dot { width: 3px; height: 3px; }
.neural-orb.sm .neural-ring { border-width: 1px; }

/* ── Orb Field — Orb + SVG energy absorption tendrils ── */
.orb-field {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb-field.lg {
  width: 200px;
  height: 200px;
}

/* The neural orb inside orb-field is larger */
.orb-field > .neural-orb {
  width: 52px;
  height: 52px;
  z-index: 2;
}
.orb-field.lg > .neural-orb {
  width: 60px;
  height: 60px;
}

/* SVG tendrils layer */
.orb-tendrils {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  animation: tendrilSpin 1000s linear infinite;
}

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

/* Individual tendril path */
.tendril {
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 55 700;
  stroke-dashoffset: 700;  /* posição inicial: traço fora do path (invisível antes da animation) */
  opacity: 0;              /* invisível antes da animation ser aplicada — evita flash no 1º frame */
  animation: tendrilFlowFar 8s linear infinite;
}

/* Dois anéis orbitais: Far (anel externo, D=700) e Mid (anel interno, D=560) */
/* Durações bem diferentes (11-28s) para velocidades distintas — nunca sincronizam */
/* t1: Far, anel externo, CW E→S→W→N, 18s */
.t1 { stroke-dasharray: 75 700; animation-duration: 18s;   animation-delay: 0s;     stroke-width: 1.7; }
/* t2: Mid, anel interno, CCW N→W→S→E, 11s — rápido */
.t2 { stroke-dasharray: 55 700; animation-duration: 11s;   animation-delay: -3s;    stroke-width: 1.3; animation-name: tendrilFlowMid; }
/* t3: Far, anel externo, CW S→W→N→E, 24s — lento */
.t3 { stroke-dasharray: 65 700; animation-duration: 24s;   animation-delay: -17s;   stroke-width: 1.5; }
/* t4: Mid, anel interno, CW W→N→E→S, 16s */
.t4 { stroke-dasharray: 85 700; animation-duration: 16s;   animation-delay: -5s;    stroke-width: 1.2; animation-name: tendrilFlowMid; }
/* t5: Far, anel externo, CW N→E→S→W, 15s — médio-rápido */
.t5 { stroke-dasharray: 70 700; animation-duration: 15s;   animation-delay: -27s;   stroke-width: 1.6; }
/* t6: Mid, anel interno, CCW E→N→W→S, 28s — muito lento, majestoso */
.t6 { stroke-dasharray: 45 700; animation-duration: 28s;   animation-delay: -11s;   stroke-width: 1.1; animation-name: tendrilFlowMid; }
/* t7: Far, anel externo, CW SW→N→E→S, 13s — rápido */
.t7 { stroke-dasharray: 95 700; animation-duration: 13s;   animation-delay: -8s;    stroke-width: 1.8; }
/* t8: Mid, anel interno, CW NE→E→S→W, 20s */
.t8 { stroke-dasharray: 60 700; animation-duration: 20s;   animation-delay: -44s;   stroke-width: 1.4; animation-name: tendrilFlowMid; }

/* Glow via stroke opacity (drop-shadow em elementos animados causa recompositing constante) */
.t1, .t3, .t5, .t7 { stroke-opacity: 0.85; }
.t2, .t4, .t6, .t8 { stroke-opacity: 0.75; }

/* ── 4 níveis de aparecimento — distâncias diferentes do orbe ──────────────── */
/* Princípio: brilha muito pouco enquanto orbitando longe; aumenta dramaticamente */
/* conforme se aproxima do evento de captura (últimos 30-40% da animação)        */

@keyframes tendrilFlowFar {
  /* D=700: orbital dim até 90%; puxão exponencial 90→93% (dobra a cada 1%); absorção 93→97% */
  0%   { stroke-dashoffset: 700; opacity: 0; }
  8%   { stroke-dashoffset: 678; opacity: 0.13; }   /* aparece — tênue mas visível */
  25%  { stroke-dashoffset: 630; opacity: 0.14; }   /* orbitando lento */
  45%  { stroke-dashoffset: 570; opacity: 0.16; }
  62%  { stroke-dashoffset: 510; opacity: 0.20; }
  74%  { stroke-dashoffset: 462; opacity: 0.24; }
  83%  { stroke-dashoffset: 422; opacity: 0.30; }
  87%  { stroke-dashoffset: 404; opacity: 0.36; }   /* bem perto do orbe, ainda orbitando */
  90%  { stroke-dashoffset: 380; opacity: 0.46; }   /* sentindo o puxão — brilha levemente */
  91%  { stroke-dashoffset: 364; opacity: 0.62; }   /* puxão: 16 u/% */
  92%  { stroke-dashoffset: 332; opacity: 0.80; }   /* puxão: 32 u/% */
  93%  { stroke-dashoffset: 268; opacity: 0.88; }   /* PICO: 64 u/% */
  94%  { stroke-dashoffset: 178; opacity: 0.48; }   /* ABSORÇÃO */
  95%  { stroke-dashoffset: 78;  opacity: 0.12; }
  97%  { stroke-dashoffset: 6;   opacity: 0.02; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}

@keyframes tendrilFlowMid {
  /* D=560: mesmo padrão — orbital dim até 90%, puxão exponencial */
  0%   { stroke-dashoffset: 560; opacity: 0; }
  8%   { stroke-dashoffset: 542; opacity: 0.11; }
  25%  { stroke-dashoffset: 502; opacity: 0.12; }
  45%  { stroke-dashoffset: 446; opacity: 0.14; }
  62%  { stroke-dashoffset: 392; opacity: 0.18; }
  74%  { stroke-dashoffset: 356; opacity: 0.22; }
  83%  { stroke-dashoffset: 322; opacity: 0.28; }
  87%  { stroke-dashoffset: 308; opacity: 0.34; }
  90%  { stroke-dashoffset: 290; opacity: 0.44; }   /* sentindo o puxão */
  91%  { stroke-dashoffset: 274; opacity: 0.60; }
  92%  { stroke-dashoffset: 244; opacity: 0.78; }
  93%  { stroke-dashoffset: 188; opacity: 0.86; }   /* PICO */
  94%  { stroke-dashoffset: 118; opacity: 0.48; }   /* ABSORÇÃO */
  95%  { stroke-dashoffset: 50;  opacity: 0.12; }
  97%  { stroke-dashoffset: 4;   opacity: 0.02; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}

@keyframes tendrilFlowNear {
  /* D=440: mesmo padrão */
  0%   { stroke-dashoffset: 440; opacity: 0; }
  8%   { stroke-dashoffset: 424; opacity: 0.10; }
  25%  { stroke-dashoffset: 390; opacity: 0.11; }
  45%  { stroke-dashoffset: 344; opacity: 0.13; }
  62%  { stroke-dashoffset: 298; opacity: 0.16; }
  74%  { stroke-dashoffset: 268; opacity: 0.20; }
  83%  { stroke-dashoffset: 240; opacity: 0.26; }
  87%  { stroke-dashoffset: 228; opacity: 0.32; }
  90%  { stroke-dashoffset: 212; opacity: 0.42; }   /* sentindo o puxão */
  91%  { stroke-dashoffset: 198; opacity: 0.58; }
  92%  { stroke-dashoffset: 170; opacity: 0.76; }
  93%  { stroke-dashoffset: 116; opacity: 0.84; }   /* PICO */
  94%  { stroke-dashoffset: 60;  opacity: 0.44; }   /* ABSORÇÃO */
  95%  { stroke-dashoffset: 20;  opacity: 0.10; }
  97%  { stroke-dashoffset: 2;   opacity: 0.02; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}

@keyframes tendrilFlowClose {
  /* D=360: já perto — tênue no início, capturado e absorvido rapidamente */
  0%   { stroke-dashoffset: 360; opacity: 0; }
  4%   { stroke-dashoffset: 357; opacity: 0.06; }
  14%  { stroke-dashoffset: 349; opacity: 0.20; }
  28%  { stroke-dashoffset: 338; opacity: 0.45; }
  44%  { stroke-dashoffset: 326; opacity: 0.72; }   /* entra na captura */
  50%  { stroke-dashoffset: 314; opacity: 0.84; }
  54%  { stroke-dashoffset: 300; opacity: 0.91; }
  58%  { stroke-dashoffset: 282; opacity: 0.95; }
  62%  { stroke-dashoffset: 259; opacity: 0.98; }
  66%  { stroke-dashoffset: 228; opacity: 1.00; }
  70%  { stroke-dashoffset: 185; opacity: 1.00; }
  74%  { stroke-dashoffset: 130; opacity: 0.86; }
  78%  { stroke-dashoffset: 70;  opacity: 0.62; }
  83%  { stroke-dashoffset: 22;  opacity: 0.30; }
  90%  { stroke-dashoffset: 3;   opacity: 0.10; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}

@keyframes tendrilFlowRing2 {
  /* r=75 anel interno (~353px path). Janela visível: D∈[700, 432] */
  /* "Horizonte de eventos": orbita lentamente, velocidade cresce exponencialmente */
  /* ao aproximar do limiar (D=432), flash de luz e absorção instantânea          */
  0%   { stroke-dashoffset: 700; opacity: 0; }
  5%   { stroke-dashoffset: 698; opacity: 0.01; }   /* fantasma distante */
  15%  { stroke-dashoffset: 694; opacity: 0.04; }
  25%  { stroke-dashoffset: 688; opacity: 0.08; }
  35%  { stroke-dashoffset: 677; opacity: 0.12; }   /* ghost orbit muito lento */
  45%  { stroke-dashoffset: 663; opacity: 0.18; }
  55%  { stroke-dashoffset: 640; opacity: 0.29; }   /* puxão começa a se sentir */
  64%  { stroke-dashoffset: 610; opacity: 0.44; }
  72%  { stroke-dashoffset: 574; opacity: 0.60; }   /* aceleração visível */
  78%  { stroke-dashoffset: 544; opacity: 0.72; }
  82%  { stroke-dashoffset: 515; opacity: 0.81; }   /* puxão forte */
  86%  { stroke-dashoffset: 482; opacity: 0.90; }
  88%  { stroke-dashoffset: 463; opacity: 0.96; }   /* quase no horizonte */
  89%  { stroke-dashoffset: 453; opacity: 0.99; }
  90%  { stroke-dashoffset: 443; opacity: 1.00; }
  91%  { stroke-dashoffset: 432; opacity: 1.00; }   /* HORIZONTE — brilho total */
  92%  { stroke-dashoffset: 424; opacity: 0;   }    /* ABSORVIDO — desaparece */
  100% { stroke-dashoffset: 0;   opacity: 0; }
}

/* ===========================
   21. AURORA + LIGHT BEAM (fundo atmosférico animado)
   =========================== */
.light-beam {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(25deg, transparent 0%, transparent 33%, rgba(180,200,230,0.03) 40%, rgba(210,225,245,0.06) 44%, rgba(200,220,240,0.07) 46%, rgba(210,225,245,0.06) 48%, rgba(180,200,230,0.03) 52%, transparent 59%, transparent 100%);
  animation: beamDrift 25s ease-in-out infinite alternate;
}
@keyframes beamDrift {
  0%   { opacity: .6; transform: translateX(-3vw); }
  50%  { opacity: 1;  transform: translateX(0); }
  100% { opacity: .7; transform: translateX(2vw); }
}

.aurora-layer {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .5;
  will-change: transform;
}
.aurora-1 {
  width: 70vw; height: 55vh; top: -10%; right: -5%;
  background: radial-gradient(ellipse, rgba(100,160,255,0.14) 0%, transparent 70%);
  animation: aurora1 40s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 55vw; height: 50vh; bottom: -5%; right: -10%;
  background: radial-gradient(ellipse, rgba(59,130,246,0.11) 0%, transparent 65%);
  animation: aurora2 50s ease-in-out infinite alternate;
}
.aurora-3 {
  width: 45vw; height: 40vh; top: 20%; left: 35%;
  background: radial-gradient(ellipse, rgba(180,215,255,0.06) 0%, transparent 50%);
  animation: aurora3 55s ease-in-out infinite alternate;
}
@keyframes aurora1 {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-5vw,8vh) scale(1.08); }
  100% { transform: translate(3vw,4vh) scale(.95); }
}
@keyframes aurora2 {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(6vw,-6vh) scale(1.1); }
  100% { transform: translate(-4vw,-3vh) scale(.96); }
}
@keyframes aurora3 {
  0%   { transform: translate(0,0) scale(1); opacity: .8; }
  50%  { transform: translate(4vw,5vh) scale(1.12); opacity: 1; }
  100% { transform: translate(-3vw,-4vh) scale(.92); opacity: .7; }
}

/* Conteúdo principal acima das camadas de fundo */
.sidebar-menu { z-index: 1000; }
.main-content,
.container { position: relative; z-index: 1; }

/* Guardrails de performance */
@media (prefers-reduced-motion: reduce) {
  .aurora-layer, .light-beam { animation: none !important; }
}
body.bg-anim-paused .aurora-layer,
body.bg-anim-paused .light-beam,
body.bg-anim-paused [class*="shimmer"],
body.bg-anim-paused [class*="drift"],
body.bg-anim-paused [class*="pulse"] { animation-play-state: paused !important; }
