/* ==========================================================================
   🔥 PALETA ONSATECH SAAS (app.css) UNIFICADA
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&family=Space+Grotesk:wght@500;700;800&display=swap');

:root { 
    /* Colores heredados del Landing */
    --primary: #8b2fc9;        
    --primary-light: #c084fc; 
    --primary-dark: #581c87;
    --accent: #25D366; 
    --gradient-text: linear-gradient(135deg, #a855f7 0%, #d946ef 100%);
    --gradient-btn: linear-gradient(90deg, #7c3aed 0%, #d946ef 100%);
    --bg-body: #030305;        
    --bg-glass: rgba(20, 20, 25, 0.6);        
    --border: rgba(255, 255, 255, 0.08);
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    
    /* Colores funcionales del SaaS */
    --danger: #ef4444; 
    --success: #10b981; 
    --surface-hover: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   1. BASE Y TIPOGRAFÍA
   ========================================================================== */
body { 
    margin: 0; 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-white); 
    display: flex; 
    min-height: 100vh; /* min-height en vez de height para permitir scroll */
    flex-direction: row; /* Layout por defecto para el Panel */
    
    /* Malla de fondo sutil inyectada directamente */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

.hidden { display: none !important; }

h1, h2, h3, .brand-name { font-family: 'Space Grotesk', sans-serif; color: var(--text-white); margin-top: 0; }
h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
p { color: var(--text-gray); line-height: 1.5; }

/* ==========================================================================
   2. COMPONENTES GENERALES (Botones e Inputs)
   ========================================================================== */
.btn { padding: 12px 24px; border-radius: 50px; border: none; cursor: pointer; font-weight: 600; color: white; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s ease; font-family: 'Poppins', sans-serif; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gradient-btn); box-shadow: 0 0 15px rgba(139, 47, 201, 0.3); }
.btn-primary:hover { box-shadow: 0 0 25px rgba(139, 47, 201, 0.6); transform: translateY(-2px); }
.btn-danger { background: var(--danger); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2); border-radius: 12px; }

input, textarea, select { width: 100%; padding: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-white); border-radius: 12px; margin-top: 5px; box-sizing: border-box; resize: vertical; transition: border-color 0.3s; font-family: 'Poppins', sans-serif; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary-light); background: rgba(255,255,255,0.08); box-shadow: 0 0 0 3px rgba(139, 47, 201, 0.1); }

/* ==========================================================================
   3. ESTILOS DEL PANEL DE CONTROL
   ========================================================================== */
.sidebar { width: 260px; background: rgba(3, 3, 5, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 20px; display: flex; flex-direction: column; border-right: 1px solid var(--border); z-index: 10; }
.main-content { flex: 1; padding: 30px; overflow-y: auto; position: relative; z-index: 5; }

.card { background: var(--bg-glass); border-radius: 20px; padding: 30px; margin-bottom: 20px; border: 1px solid var(--border); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); box-shadow: 0 15px 35px rgba(0,0,0,0.4); }

.status-badge { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; letter-spacing: 0.5px; font-family: 'Space Grotesk', sans-serif; }
.nav-item { padding: 12px 16px; margin-bottom: 8px; border-radius: 12px; cursor: pointer; transition: all 0.3s; color: var(--text-gray); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav-item i { font-size: 1.2rem; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-white); }
.nav-item.active { background: rgba(139, 47, 201, 0.15); color: var(--primary-light); border: 1px solid rgba(139, 47, 201, 0.3); }

.tenant-banner { background: rgba(255,255,255,0.03); border: 1px solid var(--border); padding: 15px; border-radius: 12px; margin-bottom: 30px; font-size: 0.85rem; text-align: center; color: var(--text-gray); backdrop-filter: blur(5px); }
.tenant-banner strong { color: var(--primary-light); font-size: 1.1rem; display: block; margin-top: 4px; font-family: 'Space Grotesk', sans-serif; }

.tabs-container { display: flex; gap: 5px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn { background: transparent; color: var(--text-gray); border: none; padding: 12px 20px; font-weight: 600; cursor: pointer; border-radius: 12px 12px 0 0; transition: 0.3s; margin-bottom: -1px; border-bottom: 2px solid transparent; font-family: 'Poppins', sans-serif; }
.tab-btn:hover { color: var(--text-white); background: var(--surface-hover); }
.tab-btn.active { color: var(--text-white); border-bottom: 2px solid var(--primary-light); background: rgba(139, 47, 201, 0.1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Botones específicos del Panel */
#btn-encender-bot { background-color: #22c55e; color: #ffffff !important; border: none; padding: 12px 28px; border-radius: 50px; font-weight: 700; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 20px auto 0; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); }
#btn-encender-bot:hover { background-color: #16a34a; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4); }
#btn-encender-bot:active { transform: translateY(0); }
#btn-generar-qr { background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%); color: white !important; border: none; padding: 12px 30px; border-radius: 8px; font-weight: 600; letter-spacing: 0.5px; box-shadow: 0 4px 14px 0 rgba(147, 51, 234, 0.39); transition: all 0.3s ease; }
#btn-generar-qr:hover { box-shadow: 0 6px 20px rgba(147, 51, 234, 0.23); transform: scale(1.02); }
.btn-reanudar { background-color: #3b82f6; color: white !important; border: none; padding: 10px 20px; border-radius: 50px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; }
.btn-reanudar:hover { background-color: #2563eb; transform: scale(1.05); }
.btn-desvincular { background-color: transparent; color: #ef4444 !important; border: 1px solid #ef4444; padding: 10px 20px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.btn-desvincular:hover { background-color: rgba(239, 68, 68, 0.1); }

/* ==========================================================================
   4. AUTENTICACIÓN (LOGIN Y REGISTRO)
   ========================================================================== */
.login-container { position: fixed; inset: 0; background-color: transparent; display: flex; justify-content: center; align-items: center; z-index: 1000; }
.login-container::before { content: ''; position: absolute; width: 400px; height: 400px; background: var(--primary); border-radius: 50%; filter: blur(120px); opacity: 0.2; top: -100px; right: -100px; pointer-events: none; }
.login-card { background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 45px 40px; border-radius: 24px; border: 1px solid var(--border); width: 100%; max-width: 420px; box-shadow: 0 25px 50px rgba(0,0,0,0.6); text-align: center; position: relative; }

.registro-wrapper { position: relative; width: 100%; max-width: 440px; z-index: 2; margin: 0 auto; display: flex; justify-content: center; align-items: center; min-height: 100vh;}
.registro-wrapper::after { content: ''; position: absolute; width: 500px; height: 500px; background: #4c1d95; border-radius: 50%; filter: blur(120px); opacity: 0.2; bottom: -100px; left: -100px; pointer-events: none; z-index: -1; }
.registro-card { background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 45px 40px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 25px 50px rgba(0,0,0,0.6); position: relative; overflow: hidden; width: 100%;}

.header-brand { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-size: 2.2rem; margin: 0 0 8px 0; font-weight: 700; letter-spacing: -1px; text-align: center; }
.subtitle { color: var(--text-gray); text-align: center; margin: 0 0 35px 0; font-size: 0.95rem; line-height: 1.5; }
.step { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0; transform: translateX(20px); pointer-events: none; position: absolute; top: 0; left: 0; right: 0; visibility: hidden; }
.step.active { opacity: 1; transform: translateX(0); pointer-events: auto; position: relative; visibility: visible; }
.step.previous { transform: translateX(-20px); }

label { display: block; font-size: 0.9rem; font-weight: 500; color: var(--text-gray); margin-bottom: 8px; text-align: left; }
.registro-card .btn { padding: 15px 16px; width: 100%; }
.btn-social { background: transparent; border: 1px solid var(--border); color: var(--text-white); margin-bottom: 12px; border-radius: 12px; }
.btn-social:hover { background: var(--surface-hover); border-color: #3f3f46; }

.divider { display: flex; align-items: center; text-align: center; margin: 25px 0; color: var(--border); }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider:not(:empty)::before { margin-right: 15px; }
.divider:not(:empty)::after { margin-left: 15px; }
.divider span { color: var(--text-gray); font-size: 0.85rem; font-weight: 500; }

.back-btn { position: absolute; top: 30px; left: 30px; background: transparent; border: none; color: var(--text-gray); cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 0.9rem; padding: 5px; border-radius: 6px; transition: 0.3s; z-index: 10; font-family: 'Poppins', sans-serif;}
.back-btn:hover { color: var(--text-white); background: var(--surface-hover); }
.footer-link { text-align: center; margin-top: 30px; font-size: 0.9rem; color: var(--text-gray); }
.footer-link a { color: var(--primary-light); text-decoration: none; font-weight: 600; transition: color 0.3s; }
.footer-link a:hover { color: white; }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* ==========================================================================
   5. PLANES Y PRECIOS
   ========================================================================== */
.header { text-align: center; margin-bottom: 60px; position: relative; z-index: 2; padding-top: 40px; }
.header h1 { font-size: 3.5rem; margin-bottom: 15px; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -2px; }
.header p { color: var(--text-gray); font-size: 1.15rem; max-width: 600px; margin: 0 auto; line-height: 1.6; }

.pricing-grid { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; position: relative; z-index: 2; padding-bottom: 60px; }
.plan-card { background: var(--bg-glass); border: 1px solid var(--border); border-radius: 24px; padding: 40px 30px; width: 100%; max-width: 340px; display: flex; flex-direction: column; position: relative; transition: transform 0.4s ease, border-color 0.4s ease; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.plan-card:hover { transform: translateY(-10px); border-color: var(--primary-light); }
.plan-card.popular { border: 1px solid rgba(139, 47, 201, 0.5); box-shadow: 0 15px 40px rgba(139, 47, 201, 0.2); background: linear-gradient(180deg, rgba(20,20,25,0.8), rgba(139, 47, 201, 0.05)); }

.badge-popular { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--gradient-btn); color: white; padding: 6px 16px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(139, 47, 201, 0.4); white-space: nowrap; }
.plan-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; color: var(--primary-light); font-family: 'Space Grotesk', sans-serif; }
.plan-price { font-size: 3.5rem; font-weight: 800; margin-bottom: 25px; letter-spacing: -2px; font-family: 'Space Grotesk', sans-serif; }
.plan-price span { font-size: 1.1rem; color: var(--text-gray); font-weight: 400; letter-spacing: normal; font-family: 'Poppins', sans-serif; }

.feature-list { list-style: none; padding: 0; margin: 0 0 35px 0; flex-grow: 1; border-top: 1px solid var(--border); padding-top: 25px; }
.feature-list li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; color: var(--text-gray); font-size: 0.95rem; line-height: 1.5; }
.feature-list i { color: var(--accent); font-size: 1.3rem; margin-top: 2px; }

.btn-outline { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: white; width: 100%; }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }
.back-link { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; color: var(--text-gray); text-decoration: none; font-weight: 500; transition: color 0.3s; position: relative; z-index: 2;}
.back-link:hover { color: white; }

/* ==========================================================================
   📱 BLOQUE MAESTRO DE CELULARES (SAAS + LANDING COMPATIBILITY)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* --- ARREGLOS DEL PANEL DE CONTROL (DASHBOARD) --- */
    body { flex-direction: column !important; height: auto !important; }
    
    /* La barra lateral se vuelve horizontal arriba o colapsa */
    .sidebar { 
        width: 100% !important; 
        border-right: none !important; 
        border-bottom: 1px solid var(--border); 
        padding: 15px; 
        height: auto !important; 
    }
    
    .main-content { padding: 15px !important; overflow-y: visible !important; }
    .card { padding: 20px !important; margin-bottom: 15px !important; }
    
    /* Las pestañas del menú se apilan en móvil para no desbordarse */
    .tabs-container { flex-direction: column; gap: 5px; border-bottom: none; }
    .tab-btn { 
        border-radius: 8px; 
        border-bottom: none !important; 
        border-left: 2px solid transparent; 
        text-align: left; 
    }
    .tab-btn.active { 
        border-left: 2px solid var(--primary-light) !important; 
        background: rgba(139, 47, 201, 0.15) !important; 
    }

    /* --- ARREGLOS DE LOGIN, REGISTRO Y PLANES --- */
    .login-card, .registro-card { padding: 30px 20px !important; width: 95% !important; margin: 20px auto !important; }
    .header h1 { font-size: 2.2rem !important; }
    .header p { padding: 0 15px; }
    .pricing-grid { flex-direction: column; align-items: center; gap: 40px; padding: 0 15px 40px 15px; }
    .plan-card { max-width: 100% !important; }
    .back-btn { top: 15px; left: 15px; }

    /* --- COMPATIBILIDAD CON LANDING Y CELULAR MOCKUP --- */
    #nav-list { position: absolute; top: 70px; left: 0; width: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 0 30px 0; display: none; flex-direction: column; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
    #nav-list.active { display: flex; }
    #nav-list ul { display: flex; flex-direction: column !important; gap: 25px; padding: 0; margin: 0; width: 100%; text-align: center; }
    #nav-list li { width: 100%; }
    #nav-list a { display: block; font-size: 1.2rem; padding: 10px 20px; }
    /* Fuerza al botón de Servicios a centrarse en el celular */
    #nav-list .dropbtn {
        justify-content: center !important;
    }
    
    .dropdown-content { position: static !important; background: rgba(0, 0, 0, 0.2) !important; box-shadow: none !important; border: none !important; display: none; flex-direction: column; width: 100%; margin-top: 15px; padding: 10px 0; }
    .dropdown.abierto .dropdown-content { display: flex !important; }
    .dropdown-content a { padding: 12px 20px; font-size: 1rem; color: #cbd5e1; }

    .features-scroll-section { padding: 40px 15px !important; }
    .scroll-container { flex-direction: column; gap: 20px !important; }
    .star-product-header { margin-bottom: 40px !important; text-align: center; }
    .star-product-header h2 { font-size: 2.2rem !important; line-height: 1.2 !important; }
    .star-product-header p { font-size: 1rem !important; max-width: 100% !important; margin: 0 auto; }
    .text-content { padding: 0 !important; order: 2; }
    .visual-content { position: relative !important; top: 0 !important; height: auto !important; order: 1; width: 100%; margin-bottom: 30px; }
    .phone-mockup { width: 100% !important; max-width: 320px; margin: 0 auto; height: 550px !important; }
    .feature-step { min-height: auto !important; padding: 20px 0 30px 25px !important; margin-left: 15px !important; opacity: 1 !important; transform: translateY(0) !important; }
    .feature-icon { width: 40px !important; height: 40px !important; font-size: 1.2rem !important; left: -20px !important; }
    .feature-step h3 { font-size: 1.6rem !important; }
    .feature-step p { font-size: 1rem !important; }
}