/* ==========================================================================
   Elite Consent Configurator - Identity & Design System
   Paleta Elite Hub: Dark Tech, Índigo (#6366F1), Ciano (#06B6D4) e Superfícies Carbon
   ========================================================================== */

:root {
  --bg-body: #0A0D14;
  --bg-sidebar: #0F1420;
  --bg-card: #151B2B;
  --bg-input: #1C2337;
  --border-color: #242D45;
  --border-focus: #6366F1;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --accent-cyan: #06B6D4;
  --accent-gold: #F59E0B;
  --accent-emerald: #10B981;
  --accent-red: #EF4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header */
.ec-header {
  background: rgba(15, 20, 32, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ec-logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ec-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45);
}

.ec-logo-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFFFFF, #CBD5E1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ec-badge-version {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.ec-header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

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

.ec-btn-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ec-btn-nav:hover {
  background: var(--border-color);
  border-color: #3B4768;
}

/* Layout Principal */
.ec-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  height: calc(100vh - 71px);
  overflow: hidden;
}

/* Scrollbar estilizada de alta definição */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #242D45;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3B4768;
}

@media (max-width: 1024px) {
  .ec-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
}

/* Sidebar de Edição */
.ec-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Seção de Seleção de Produtos */
.ec-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ec-product-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.ec-product-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  color: var(--text-muted);
}

.ec-product-tab:hover {
  background: var(--bg-input);
  border-color: #3A476A;
  color: var(--text-main);
}

.ec-product-tab.is-active {
  background: var(--bg-input);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.ec-product-tab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ec-product-tab-name {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Cards de Configuração */
.ec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

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

.ec-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ec-form-group {
  margin-bottom: 16px;
}

.ec-form-group:last-child {
  margin-bottom: 0;
}

.ec-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.ec-input:focus, .ec-textarea:focus, .ec-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.ec-textarea {
  resize: vertical;
  min-height: 72px;
}

.ec-color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ec-color-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.ec-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.ec-color-input::-webkit-color-swatch {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.ec-preset-colors {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.ec-color-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}

.ec-color-chip:hover {
  transform: scale(1.15);
}

.ec-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ec-radio-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.ec-radio-card:hover {
  border-color: #3F4C70;
  color: var(--text-main);
}

.ec-radio-card.is-selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
}

/* Categorias no configurador */
.ec-cat-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ec-cat-item-config {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ec-cat-item-details h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ec-cat-item-details p {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Botões de Ação da Sidebar */
.ec-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ec-btn-reset {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.ec-btn-reset:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Painel Principal de Prévia e Código */
.ec-main {
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px;
  gap: 24px;
}

.ec-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ec-device-toggles {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.ec-device-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.ec-device-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.ec-preview-stage-container {
  background: radial-gradient(circle at 50% 30%, #0D1322 0%, #06080D 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.6);
}

/* Moldura Desktop e Mobile */
.ec-stage-frame {
  position: relative;
  background: #0E131F;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  height: 480px;
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s ease;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.ec-stage-frame.is-mobile {
  width: 375px;
  height: 580px;
  border-radius: 36px;
  border: 8px solid #1E293B;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.ec-frame-browser-bar {
  background: #151C2C;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.ec-frame-dots {
  display: flex;
  gap: 5px;
}

.ec-frame-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2D3748;
}

.ec-frame-url-bar {
  background: #0B0F19;
  border: 1px solid #1F293D;
  border-radius: 4px;
  padding: 2px 10px;
  flex: 1;
  color: var(--text-muted);
  font-family: monospace;
}

/* Conteúdo simulado do site de fundo */
.ec-mock-website {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
              #0B0F19;
}

.ec-mock-hero {
  max-width: 500px;
}

.ec-mock-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  margin-bottom: 10px;
}

.ec-mock-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.ec-mock-p {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Área onde o banner de prévia é injetado */
.ec-preview-mount-point {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.ec-preview-mount-point > * {
  pointer-events: auto;
}

/* Seção de Código Gerado */
.ec-code-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

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

.ec-btn-copy {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.ec-btn-copy:hover {
  background: var(--primary-hover);
}

.ec-btn-copy.copied {
  background: var(--accent-emerald);
}

.ec-code-box {
  background: #090C13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  color: #E2E8F0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.ec-instructions {
  margin-top: 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12px;
  color: #C7D2FE;
  line-height: 1.6;
}

.ec-instructions code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #fff;
}
