/* ═══════════════════════════════════════════════════════════════
   CONFIGURADOR COLABORATIVO — ARANTES TECNOLOGIA
   configurator.css — Layout em 3 Colunas (Etapas, Preview, Colaboração)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cfg-bg: #030312;
  --cfg-surface: #080820;
  --cfg-panel: rgba(14, 14, 40, 0.7);
  --cfg-border: rgba(255, 255, 255, 0.1);
  --cfg-purple: #7B2FFF;
  --cfg-gold: #D4AF37;
  --text-primary: #FFFFFF;
  --text-muted: #94A3B8;
}

body.configurator-body {
  background-color: var(--cfg-bg);
  color: #E2E8F0;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
}

/* ── Top Header ─────────────────────────────────────────────── */
.cfg-header {
  height: 60px;
  background: var(--cfg-surface);
  border-bottom: 1px solid var(--cfg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.cfg-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cfg-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFF;
}

.cfg-header-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--cfg-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.cfg-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Status de Sincronização */
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}
.sync-status.saved { color: #10B981; }
.sync-status.saving { color: #F59E0B; }
.sync-status.conflict { color: #EF4444; }

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ── 3 Columns Layout ───────────────────────────────────────── */
.cfg-layout {
  display: grid;
  grid-template-columns: 340px 1fr 300px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ── COLUNA 1: ETAPAS & FORMULÁRIOS ─────────────────────────── */
.cfg-steps-col {
  background: var(--cfg-surface);
  border-right: 1px solid var(--cfg-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.steps-nav-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cfg-border);
}

.progress-bar-wrap {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.08);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--cfg-purple), var(--cfg-gold));
  height: 100%;
  width: 16%;
  transition: width 0.3s ease;
}

.steps-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.step-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #FFF;
}

.step-nav-item.active {
  background: rgba(123, 47, 255, 0.15);
  border: 1px solid rgba(123, 47, 255, 0.3);
  color: #FFF;
}

.step-nav-item.completed .step-num {
  background: #10B981;
  color: #000;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-nav-item.active .step-num {
  background: var(--cfg-gold);
  color: #000;
}

/* Área de formulário da etapa ativa */
.step-form-body {
  overflow-y: auto;
  flex: 2;
  padding: 20px;
  border-top: 1px solid var(--cfg-border);
  background: rgba(5, 5, 20, 0.4);
}

.step-pane {
  display: none;
  animation: fadeInStep 0.25s ease;
}

.step-pane.active {
  display: block;
}

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

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #E2E8F0;
  margin-bottom: 6px;
}

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--cfg-border);
  border-radius: 6px;
  padding: 8px 12px;
  color: #FFF;
  font-family: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.form-field textarea {
  resize: vertical;
  min-height: 70px;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--cfg-purple);
  outline: none;
}

/* ── COLUNA 2: PREVIEW INTERATIVO ───────────────────────────── */
.cfg-preview-col {
  background: #02020a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.preview-toolbar {
  height: 48px;
  background: rgba(10, 10, 30, 0.8);
  border-bottom: 1px solid var(--cfg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.preview-modes {
  display: flex;
  gap: 8px;
}

.btn-device {
  background: transparent;
  border: 1px solid var(--cfg-border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}

.btn-device.active {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  border-color: var(--cfg-gold);
}

.preview-stage {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* Container do Mockup do Site em Preview */
.live-website-mock {
  width: 100%;
  max-width: 860px;
  min-height: 540px;
  background: var(--preview-bg, #05051A);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  color: #E2E8F0;
}

.live-website-mock.mobile-view {
  max-width: 375px;
  min-height: 640px;
}

/* Elementos do Preview */
.mock-nav {
  height: 50px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.3);
}

.mock-nav-logo {
  font-family: var(--preview-font, 'Manrope'), sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--preview-gold, #D4AF37);
  letter-spacing: 0.06em;
}

.mock-nav-links {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: #94A3B8;
}

.mock-hero {
  padding: 40px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mock-hero h2 {
  font-family: var(--preview-font, 'Manrope'), sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 10px;
  line-height: 1.25;
}

.mock-hero p {
  font-size: 0.85rem;
  color: #94A3B8;
  max-width: 500px;
  margin: 0 auto 18px;
}

.mock-btn {
  display: inline-block;
  background: var(--preview-primary, #7B2FFF);
  color: #FFF;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 50px;
  text-decoration: none;
}

.mock-areas-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mock-area-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.78rem;
  color: #CBD5E1;
}

/* ── COLUNA 3: COLABORAÇÃO & HISTÓRICO ──────────────────────── */
.cfg-collab-col {
  background: var(--cfg-surface);
  border-left: 1px solid var(--cfg-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.collab-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cfg-border);
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFF;
}

.collab-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cfg-border);
}

.collab-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.collaborators-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.collaborator-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--cfg-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.collab-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFF;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
}

.collab-role-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(123, 47, 255, 0.2);
  color: #C4B5FD;
}

/* Feed de Alterações */
.changes-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.change-item {
  font-size: 0.78rem;
  border-left: 2px solid var(--cfg-purple);
  padding-left: 10px;
}

.change-author {
  font-weight: 600;
  color: #FFF;
}

.change-field {
  color: var(--cfg-gold);
}

.change-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── CONFLITO DE VERSÃO (MODAL DE ALERTA) ───────────────────── */
.conflict-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  place-items: center;
  padding: 20px;
}

.conflict-modal-overlay.active {
  display: grid;
}

.conflict-card {
  background: #0E0E2E;
  border: 1px solid #EF4444;
  border-radius: 12px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
}

.conflict-card h3 {
  color: #EF4444;
  margin-bottom: 10px;
  font-size: 1.2rem;
}
