/* =====================================================================
 * Carrossel Top — estilos do app
 * Regra de ouro Elite: SÓ tokens (var(--…)) — nada de cores cruas.
 * Herda os 3 temas (light/dark/elite-sacro) automaticamente.
 * ===================================================================== */

/* ---------- Auth (split Elite: painel de marca + formulário) ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  background: var(--bg-primary);
}
@media (min-width: 920px) {
  .auth-shell { grid-template-columns: minmax(380px, 44%) 1fr; }
}

/* Painel de marca (gradiente composto só com tokens) */
.auth-brand {
  display: none;
  flex-direction: column;
  padding: 40px 44px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 110%, rgba(255,255,255,0.10) 0%, transparent 55%),
    linear-gradient(160deg, var(--accent-primary), var(--accent-purple));
}
@media (min-width: 920px) { .auth-brand { display: flex; } }

.auth-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.auth-logo-badge {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  display: grid; place-items: center;
}
.auth-wordmark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
}
.auth-wordmark b { font-weight: 800; }
.auth-wordmark i {
  font-style: normal; font-size: 12px; font-weight: 700;
  vertical-align: super; margin-left: 2px;
  opacity: 0.85; letter-spacing: 0.06em;
}

.auth-brand-body { margin: auto 0; padding: 48px 0; }
.auth-brand-body h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px); font-weight: 800;
  line-height: 1.2; margin-bottom: 26px;
}
.auth-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-checks li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 15px; line-height: 1.5; color: rgba(255,255,255,0.92);
}
.auth-checks svg { flex-shrink: 0; margin-top: 3px; }
.auth-brand-foot { font-size: 13px; color: rgba(255,255,255,0.75); }

/* Lado do formulário */
.auth-side {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-6) var(--space-4);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800; color: var(--text-primary);
  margin-bottom: 6px;
}
.auth-head p { font-size: 14px; }
.auth-alt {
  text-align: center; margin-top: 22px;
  font-size: 14px; color: var(--text-muted);
}
.auth-alt a { color: var(--accent-primary); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-legal {
  margin-top: 18px; font-size: 12px; color: var(--text-muted);
  text-align: center; max-width: 420px;
}

/* Logo mobile: sem painel lateral, a marca aparece acima do card */
.auth-logo-mobile {
  display: none;
  align-items: center; gap: 10px;
  margin-bottom: 22px; text-decoration: none;
  color: var(--text-primary);
}
.auth-logo-mobile .auth-logo-badge {
  background: var(--accent-primary);
  border: none; color: #fff;
}
@media (max-width: 919px) { .auth-logo-mobile { display: inline-flex; } }

/* ---------- Shell / sidebar fallback ---------- */
.app-shell { min-height: 100vh; background: var(--bg-primary); }
.app-shell .sidebar {
  width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  min-height: 100vh;
}
.app-shell .sidebar-nav { flex: 1; padding: var(--space-2); }
.app-shell .nav-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.app-shell .nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.app-shell .nav-item.active { background: var(--bg-hover); color: var(--accent-primary); }
.app-shell .page-content { padding: var(--space-6); }

/* ---------- Dashboard: grid de projetos ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
.project-card { overflow: hidden; padding: 0; }
.project-thumb {
  display: block; width: 100%;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  position: relative; overflow: hidden;
}
.project-thumb.formato-4x5  { aspect-ratio: 4 / 5; }
.project-thumb.formato-1x1  { aspect-ratio: 1 / 1; }
.project-thumb.formato-9x16 { aspect-ratio: 9 / 16; max-height: 340px; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-thumb-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

/* ---------- Editor: layout ---------- */
.cp-editor-body { margin: 0; overflow: hidden; background: var(--bg-primary); }

.cp-topbar {
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-4);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative; z-index: 20;
}
.cp-title-input {
  border: 1px solid transparent; background: transparent;
  color: var(--text-primary); font-weight: 600; font-size: 15px;
  padding: 6px 10px; border-radius: var(--radius-md); min-width: 260px;
  font-family: var(--font-family);
}
.cp-title-input:hover { border-color: var(--border-default); }
.cp-title-input:focus { outline: none; border-color: var(--accent-primary); background: var(--bg-secondary); }
.cp-formato { width: 170px; padding: 8px 10px; font-size: 13px; }

.cp-main {
  display: flex; height: calc(100vh - 58px - 96px);
}

/* ---------- Painel lateral ---------- */
.cp-panel {
  width: 320px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cp-panel-tabs {
  flex-wrap: wrap; padding: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  gap: 2px;
}
.cp-panel-tabs .tab { font-size: 13px; padding: 7px 10px; }
.cp-tab-content { display: none; overflow-y: auto; padding: var(--space-4); flex: 1; }
.cp-tab-content.active { display: block; }
.cp-group { margin-bottom: 22px; }
.cp-hint { font-size: 12.5px; line-height: 1.5; }
.cp-mini-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.cp-color {
  width: 40px; height: 32px; padding: 2px;
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  background: var(--bg-secondary); cursor: pointer;
}

/* Presets de estilo */
.cp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.cp-preset {
  padding: 10px 8px; text-align: center; cursor: pointer;
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  font-size: 14px; transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.cp-preset:hover { border-color: var(--accent-primary); transform: translateY(-1px); }

/* Gradientes / swatches */
.cp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.cp-swatch {
  height: 44px; border-radius: var(--radius-md); cursor: pointer;
  border: 2px solid var(--border-subtle);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.cp-swatch:hover { transform: scale(1.05); border-color: var(--accent-primary); }

/* Biblioteca de mídia */
.cp-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.cp-media-item {
  aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  border: 2px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}
.cp-media-item:hover { border-color: var(--accent-primary); }
.cp-media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Templates */
.cp-templates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cp-template-card {
  cursor: pointer; border-radius: var(--radius-md); overflow: hidden;
  border: 2px solid var(--border-subtle);
  background: var(--bg-secondary);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.cp-template-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.cp-template-card span {
  display: block; padding: 7px 9px; font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary);
}
.cp-template-prev {
  aspect-ratio: 4 / 5; position: relative;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 6px;
}
.cp-template-card.locked { opacity: 0.75; }

/* ---------- Palco do canvas ---------- */
.cp-stage {
  flex: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
}
.cp-canvas-wrap {
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}

/* ---------- Faixa de slides ---------- */
.cp-slides-bar {
  height: 96px; display: flex; align-items: center;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}
.cp-slides-strip {
  flex: 1; display: flex; gap: var(--space-2);
  overflow-x: auto; padding: var(--space-3);
  align-items: center;
}
.cp-slide-thumb {
  position: relative; flex-shrink: 0; cursor: pointer;
  width: 54px; height: 68px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-default);
  background: var(--bg-tertiary);
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.cp-slide-thumb:hover { transform: translateY(-2px); }
.cp-slide-thumb.active { border-color: var(--accent-primary); box-shadow: var(--shadow-glow-blue); }
.cp-slide-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-slide-thumb b {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 10px; color: var(--text-muted);
  background: var(--bg-card); border-radius: 4px; padding: 0 4px;
}

/* ---------- Responsivo básico ---------- */
@media (max-width: 900px) {
  .cp-panel { width: 260px; }
  .app-shell .sidebar { width: 200px; }
}
