/* ==========================================================================
   TUWEBEXPRESS · ESTILOS GENERALES Y ASISTENTE
   ========================================================================== */

:root {
  --font-main: 'Poppins', system-ui, -apple-system, sans-serif;
  
  /* Paleta Cálida y Moderna */
  --bg-app: #0c1424;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-focus: #f59b22;
  
  --primary: #f59b22;       /* Naranja cálido de acción */
  --primary-hover: #e08812;
  --primary-glow: rgba(245, 155, 34, 0.35);
  
  --secondary: #1d3557;     /* Azul institucional */
  --secondary-hover: #2b4c7e;
  
  --success: #25d366;       /* WhatsApp / Éxito */
  --success-glow: rgba(37, 211, 102, 0.3);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 12px 32px var(--primary-glow);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Navegación Superior
   -------------------------------------------------------------------------- */
.app-header {
  height: 64px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(12, 20, 36, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-wrap {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.brand i {
  color: var(--primary);
  font-size: 1.4rem;
}

.brand strong {
  color: var(--primary);
}

.badge-demo {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(245, 155, 34, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 155, 34, 0.3);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}

/* --------------------------------------------------------------------------
   Layout Principal: Asistente + Simulador
   -------------------------------------------------------------------------- */
.app-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 40px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Panel del Asistente (Wizard)
   -------------------------------------------------------------------------- */
.wizard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  position: relative;
}

/* Barra de Progreso */
.progress-bar-container {
  margin-bottom: 32px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ffc107);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Pasos del Wizard */
.step-card {
  display: none;
  animation: fadeIn 0.35s ease;
}

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

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

.step-header {
  margin-bottom: 24px;
}

.step-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.step-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Formularios e Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 {
  flex: 1;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(245, 155, 34, 0.15);
}

.hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Selector de Rubros (Tarjetas Táctiles) */
.rubro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.rubro-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.rubro-btn i {
  font-size: 2rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.rubro-btn span {
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.rubro-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
}

.rubro-btn.selected {
  border-color: var(--primary);
  background: rgba(245, 155, 34, 0.12);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.rubro-btn.selected i {
  transform: scale(1.15);
}

/* Selector de Plantillas */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.template-option input {
  display: none;
}

.template-card {
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.03);
}

.tpl-preview {
  height: 120px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tpl-preview.dark-theme {
  background: #081329;
  border: 1px solid rgba(255,255,255,0.1);
}

.tpl-preview.light-theme {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.tpl-preview .tpl-bar {
  height: 16px;
  width: 60%;
  border-radius: 4px;
  background: var(--primary);
}

.tpl-preview .tpl-body {
  flex: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
}

.template-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.template-card small {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.template-option input:checked + .template-card {
  border-color: var(--primary);
  background: rgba(245, 155, 34, 0.08);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* Propuestas de IA */
.ia-proposals-container {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-card);
}

.section-title {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 14px;
}

.proposals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proposal-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.proposal-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.proposal-item.selected {
  border-color: var(--primary);
  background: rgba(245, 155, 34, 0.1);
}

.proposal-item h4 {
  font-size: 0.85rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.proposal-item strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.proposal-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Editor de Servicios */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.service-row input:first-child {
  flex: 2;
}

.service-row input:last-child {
  flex: 1;
}

/* Subida de Fotos y Miniaturas */
.upload-dropzone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 10px;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: rgba(245, 155, 34, 0.05);
}

.upload-dropzone i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 8px;
  display: block;
}

.upload-dropzone span {
  font-size: 0.9rem;
  font-weight: 500;
  color: #cbd5e1;
}

.photos-preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-top: 14px;
  padding-bottom: 8px;
}

.photo-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-card);
  flex-shrink: 0;
}

/* Paso de Publicación & Slug */
.slug-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.slug-domain {
  padding: 0 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

.slug-input-wrapper input {
  border: none;
  background: transparent;
  padding: 14px 16px 14px 0;
}

.slug-input-wrapper input:focus {
  box-shadow: none;
}

.slug-feedback {
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 20px;
}

.slug-feedback.ok { color: var(--success); }
.slug-feedback.error { color: #ef4444; }

.publish-card {
  margin-top: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.publish-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.publish-actions {
  margin-top: 20px;
}

.publish-result {
  margin-top: 24px;
  text-align: center;
  padding: 30px;
  background: rgba(37, 211, 102, 0.08);
  border: 1.5px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-md);
}

.success-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 12px;
}

.link-box {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.link-box input {
  background: rgba(0, 0, 0, 0.3);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-dark);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-publish {
  width: 100%;
  font-size: 1.1rem;
  padding: 16px;
}

.btn-payment {
  width: 100%;
  background: var(--secondary);
  color: #fff;
  padding: 16px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: #fff;
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.9rem;
  background: var(--primary);
  color: var(--text-dark);
}

.w-100 { width: 100%; }
.mt-4 { margin-top: 24px; }

/* Pie del Wizard */
.wizard-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Simulador de Celular (Columna Derecha)
   -------------------------------------------------------------------------- */
.preview-panel {
  position: sticky;
  top: 96px;
  display: flex;
  justify-content: center;
}

.mobile-device {
  width: 375px;
  height: 740px;
  background: #000;
  border-radius: 46px;
  border: 10px solid #202634;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.device-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 24px;
  background: #202634;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}

.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #fff;
}

.device-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Responsividad Móvil
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .preview-panel {
    display: none; /* En celular el asistente ocupa la pantalla completa */
  }
}

@media (max-width: 640px) {
  .wizard-panel {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .rubro-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .wizard-footer {
    flex-direction: column-reverse;
    gap: 12px;
  }
  
  .wizard-footer .btn {
    width: 100%;
  }
}