/**
 * Meta Suite Pro — Sistema de Diseño Google Stitch
 * Paleta Warm Ember, Charcoal Dark Mode y Glassmorphism
 */

:root {
  --bg-base: #0F141C;
  --bg-superficie: #171C24;
  --bg-tarjeta: #1B2028;
  --bg-tarjeta-alt: #252A33;
  --bg-hover: #30353E;
  --borde: rgba(255, 255, 255, 0.08);
  --borde-activo: rgba(255, 87, 34, 0.5);
  
  --primary: #FFB5A0;
  --primary-container: #FF5722;
  --on-primary: #5F1500;
  --on-primary-container: #541200;
  
  --secondary: #FFD799;
  --secondary-container: #FEB300;
  --on-secondary-container: #6A4800;
  
  --tertiary: #ADC6FF;
  --tertiary-container: #4B8EFF;
  --tertiary-fixed: #D8E2FF;
  
  --fb-azul: #4B8EFF;
  --fb-azul-grad: linear-gradient(135deg, #4B8EFF 0%, #1877F2 100%);
  --fb-azul-glow: rgba(75, 142, 255, 0.35);
  
  --ig-rosa: #FF5722;
  --ig-grad: linear-gradient(135deg, #FF5722 0%, #FEB300 50%, #FFB5A0 100%);
  --ig-glow: rgba(255, 87, 34, 0.35);
  
  --meta-ambas-grad: linear-gradient(135deg, #FF5722 0%, #FEB300 100%);
  
  --brasa-fuego: #FF5722;
  --brasa-dorado: #FEB300;
  
  --verde-exito: #10B981;
  --rojo-error: #EF4444;
  
  --txt-blanco: #DEE2EE;
  --txt-secundario: #E4BEB4;
  --txt-tenue: #AB8980;
  
  --radio-card: 20px;
  --radio-btn: 12px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg-base);
  color: var(--txt-blanco);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0 0 80px 0;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  position: relative;
  overflow-x: hidden;
}

/* ───── AMBIENT EMBER BACKDROP GLOWS ───── */
.ambient-glows-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
}
.orb-primary { top: -80px; left: 22%; width: 440px; height: 440px; background: #FF5722; }
.orb-tertiary { top: 320px; right: 6%; width: 380px; height: 380px; background: #4B8EFF; }
.orb-secondary { top: 65%; left: 8%; width: 360px; height: 360px; background: #FEB300; }

/* ───── HEADER STITCH ULTRA PREMIUM ───── */
.fb-nav-header {
  background: rgba(9, 14, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 99;
  padding: 12px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}
.fb-nav-interior {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}
.stitch-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.marca-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.logo-vintage-mini {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF5722 0%, #FEB300 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(255, 87, 34, 0.35);
}
.titulo-marca {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-1975 {
  font-family: 'Outfit', sans-serif;
  background: rgba(255, 87, 34, 0.15);
  color: #FF5722;
  border: 1px solid rgba(255, 87, 34, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-text-fill-color: initial;
}
.subtitulo-marca {
  font-size: 0.75rem;
  color: var(--txt-tenue);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.stitch-header-center {
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-chip-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.kpi-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt-secundario);
}
.kpi-chip .material-symbols-outlined { font-size: 16px; color: #FEB300; }
.stitch-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.badge-live-pulse {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 100px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10B981;
  animation: radarPulse 2s infinite ease-in-out;
}
@keyframes radarPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ───── SUBNAV BAR ───── */
.subnav-stitch-bar {
  background: rgba(15, 20, 28, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 24px;
  position: relative;
  z-index: 10;
}
.subnav-interior {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tabs-scroll-stitch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tab-stitch-btn {
  background: transparent;
  color: #94A3B8;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.tab-stitch-btn .material-symbols-outlined { font-size: 18px; }
.tab-stitch-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #F1F5F9;
}
.tab-stitch-btn.activo {
  background: rgba(255, 87, 34, 0.15);
  color: #FF5722;
  border: 1px solid rgba(255, 87, 34, 0.35);
  box-shadow: 0 0 16px rgba(255, 87, 34, 0.2);
}

/* ───── CONTENIDO PRINCIPAL ───── */
.contenedor-principal {
  max-width: 1360px;
  margin: 28px auto 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.grid-pantalla-stitch {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: start;
}

/* ───── TARJETAS STITCH ───── */
.tarjeta-stitch {
  background: rgba(23, 28, 36, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radio-card);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tarjeta-stitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.tarjeta-stitch-titulo {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #F1F5F9;
}
.tarjeta-stitch-titulo .material-symbols-outlined {
  color: #FF5722;
  font-size: 22px;
}

/* ───── SELECTORES DE CANAL Y FORMATO ───── */
.grid-canales-stitch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tarjeta-canal-stitch {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.22s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.tarjeta-canal-stitch:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
.tarjeta-canal-stitch.activo {
  background: rgba(255, 87, 34, 0.12);
  border-color: #FF5722;
  box-shadow: 0 4px 20px rgba(255, 87, 34, 0.25);
}
.tarjeta-canal-stitch .material-symbols-outlined {
  font-size: 26px;
  color: #94A3B8;
  transition: color 0.2s;
}
.tarjeta-canal-stitch.activo .material-symbols-outlined {
  color: #FF5722;
}
.tarjeta-canal-nombre {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}
.tarjeta-canal-desc {
  font-size: 0.72rem;
  color: var(--txt-tenue);
}

.grid-modos-stitch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tarjeta-modo-stitch {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.tarjeta-modo-stitch:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}
.tarjeta-modo-stitch.activo {
  background: rgba(254, 179, 0, 0.1);
  border-color: #FEB300;
  box-shadow: 0 4px 18px rgba(254, 179, 0, 0.2);
}
.tarjeta-modo-stitch .material-symbols-outlined {
  font-size: 24px;
  color: #94A3B8;
}
.tarjeta-modo-stitch.activo .material-symbols-outlined {
  color: #FEB300;
}

/* ───── CAMPOS Y TEXTAREA ───── */
.textarea-stitch {
  width: 100%;
  min-height: 130px;
  background: rgba(15, 20, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea-stitch:focus {
  outline: none;
  border-color: #FF5722;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.2);
}

.input-stitch {
  width: 100%;
  background: rgba(15, 20, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.input-stitch:focus {
  outline: none;
  border-color: #FF5722;
}

/* ───── DROPZONE ───── */
.dropzone-stitch {
  border: 2px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dropzone-stitch:hover {
  border-color: #FF5722;
  background: rgba(255, 87, 34, 0.05);
}
.dropzone-stitch .material-symbols-outlined {
  font-size: 40px;
  color: #FF5722;
}

/* ───── BOTÓN CTA WARM EMBER ───── */
.btn-stitch-primario {
  background: linear-gradient(135deg, #FF5722 0%, #FEB300 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  padding: 16px 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 87, 34, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: none;
  letter-spacing: -0.01em;
  width: 100%;
}
.btn-stitch-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 87, 34, 0.55);
}
.btn-stitch-primario:active {
  transform: translateY(1px);
}
.btn-stitch-secundario {
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-stitch-secundario:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ───── MODAL STITCH ───── */
.modal-stitch-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-stitch-backdrop.activo {
  opacity: 1;
  pointer-events: auto;
}
.modal-stitch-card {
  background: #171C24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-stitch-backdrop.activo .modal-stitch-card {
  transform: translateY(0);
}
.modal-stitch-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-stitch-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-stitch-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 1024px) {
  .grid-pantalla-stitch {
    grid-template-columns: 1fr;
  }
  .stitch-header-center {
    display: none;
  }
}
@media (max-width: 640px) {
  .grid-canales-stitch {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-modos-stitch {
    grid-template-columns: 1fr;
  }
  .fb-nav-header {
    padding: 10px 14px;
  }
  .contenedor-principal {
    padding: 0 14px;
  }
}
