:root {
    --bg: #030305;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-solid: rgba(20, 20, 23, 0.95);
    --border: rgba(0, 243, 255, 0.2); /* Borde cian sutil */
    --primary: #00f3ff; /* Cian Neón */
    --accent: #8b5cf6;
    --text: #ffffff;
    --text-muted: #94a3b8;
    --safe-area-bottom: env(safe-area-inset-bottom);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; }

body { background-color: var(--bg); color: var(--text); overflow-x: hidden; height: 100vh; }

/* LUCES DE FONDO (GALAXIA ANIMADA) */
.ambient-light {
    position: fixed; width: 100vw; height: 100vh; z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 243, 255, 0.1) 0%, transparent 40%),
        #030305; /* Fondo negro profundo */
    animation: galaxyPulse 15s infinite alternate ease-in-out;
}

@keyframes galaxyPulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* NAVEGACIÓN */
.glass-nav {
    display: flex; justify-content: space-between; align-items: center; padding: 15px 5%;
    background: rgba(3, 3, 5, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: fixed; width: 100%; top: 0; z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo { font-weight: 800; font-size: 1.2rem; }
.highlight { color: var(--primary); text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.menu { display: flex; gap: 20px; }
.menu a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.btn-login { border: 1px solid var(--border); padding: 6px 15px; border-radius: 50px; }

@media (max-width: 768px) { .menu a:not(.btn-login) { display: none; } }

/* HERO INPUT */
.hero-container {
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 100px 20px 20px;
}
.hero-content h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 15px; font-weight: 800; }

/* TEXTO NEÓN */
.text-gradient { 
    background: linear-gradient(90deg, #fff, #00f3ff); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.4));
}

.hero-content p { font-size: 1rem; color: var(--text-muted); max-width: 500px; margin: 0 auto 30px; }
.badge-ai {
    display: inline-block; padding: 5px 12px; border-radius: 20px;
    background: rgba(0, 243, 255, 0.1); border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--primary); font-size: 0.8rem; font-weight: 600; margin-bottom: 15px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

/* MAGIC INPUT BOX (Glassmorphism Espacial) */
.magic-input-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 243, 255, 0.3); /* Borde neón */
    padding: 15px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 243, 255, 0.05);
}

@media (min-width: 769px) {
    .magic-input-box { flex-direction: row; max-width: none; width: auto; padding: 10px; align-items: center; gap: 0; }
    .hero-content h1 { font-size: 4.5rem; }
}

.input-group { display: flex; flex-direction: column; text-align: left; padding: 0 10px; width: 100%; }
@media (min-width: 769px) { .input-group { width: auto; border-right: 1px solid rgba(255,255,255,0.1); } .input-group:last-of-type { border-right: none; } }

.input-group label { font-size: 0.7rem; color: var(--primary); text-transform: uppercase; font-weight: 700; margin-bottom: 5px; text-shadow: 0 0 5px rgba(0, 243, 255, 0.5); }
.input-group input, .input-group select {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border); 
    color: white; font-size: 1rem; outline: none; width: 100%; 
    padding: 12px; border-radius: 8px;
}
@media (min-width: 769px) { 
    .input-group input, .input-group select { background: transparent; border: none; padding: 0; width: 200px; border-radius: 0; }
}

.input-group select option { background: #111; }

.btn-magic {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border: none; color: #000; padding: 15px; border-radius: 12px;
    font-weight: 800; font-size: 1rem; cursor: pointer; width: 100%;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-magic:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(0, 243, 255, 0.6); }
@media (min-width: 769px) { .btn-magic { width: auto; padding: 15px 30px; } }

/* RESTO DEL EDITOR (Igual que antes pero ajustado a oscuro) */
.editor-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: #000; z-index: 200;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.editor-overlay.active { transform: translateY(0); }

.preview-area {
    flex: 1; background: #050505;
    display: flex; align-items: center; justify-content: center;
    position: relative; width: 100%; height: 100%; overflow: hidden;
    background-image: radial-gradient(#222 1px, transparent 1px);
    background-size: 20px 20px;
}

.device-mockup {
    width: 100%; height: 100%; background: white; border: none; overflow: hidden;
}

iframe { width: 100%; height: 100%; border: none; display: block; }

.editor-sidebar {
    background: rgba(10, 10, 12, 0.95);
    border-top: 1px solid var(--border);
    padding: 20px;
    display: flex; flex-direction: column; gap: 20px;
    z-index: 30;
    position: absolute; bottom: 0; left: 0; width: 100%;
    height: auto; max-height: 75vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(110%);
    transition: transform 0.3s ease;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
}

.editor-sidebar.mobile-open { transform: translateY(0); }

@media (min-width: 769px) {
    .editor-overlay { flex-direction: row; }
    .editor-sidebar {
        position: relative; width: 350px; height: 100%; max-height: none;
        border-top: none; border-right: 1px solid var(--border);
        border-radius: 0; transform: none; box-shadow: none;
    }
    .preview-area { padding: 40px; }
    .device-mockup {
        width: 100%; height: 100%; max-width: 1400px;
        border-radius: 12px; border: 1px solid #333;
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }
}

.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.close-btn { background: none; border: none; color: white; font-size: 1.5rem; padding: 5px; cursor: pointer; }

.template-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.template-item {
    background: #151515; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
    padding: 10px; cursor: pointer; text-align: center; transition: 0.3s;
}
.template-item.active { border-color: var(--primary); background: rgba(0, 243, 255, 0.1); box-shadow: 0 0 15px rgba(0, 243, 255, 0.15); }
.template-item.locked { opacity: 0.5; }

.sidebar-footer { 
    margin-top: auto; padding-top: 20px; 
    padding-bottom: calc(20px + var(--safe-area-bottom)); 
}
.btn-primary.full { width: 100%; background: var(--primary); color: black; border: none; padding: 15px; border-radius: 12px; font-weight: 700; margin-bottom: 10px; font-size: 1rem; cursor: pointer; box-shadow: 0 0 15px rgba(0, 243, 255, 0.3); }

/* BOTÓN FLOTANTE MÓVIL */
.mobile-toggle-btn {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    background: var(--primary); color: black; border: none;
    padding: 12px 18px; border-radius: 999px; font-weight: 800;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    z-index: 9999; display: inline-flex; align-items: center; gap: 8px;
    transition: 0.2s; cursor: pointer; white-space: nowrap;
}
.mobile-toggle-btn:active { transform: translateX(-50%) scale(0.96); }
@media (min-width: 769px) { .mobile-toggle-btn { display: none; } }

/* =========================================
   EFECTOS GALÁCTICOS AVANZADOS
   ========================================= */

/* 1. EL CYBER-PLANETA */
.cyber-planet {
    position: fixed;
    z-index: -1; /* Detrás de todo, pero delante del fondo negro */
    border-radius: 50%;
    opacity: 0.6;
    background: radial-gradient(circle at 30% 30%, rgba(0, 243, 255, 0.8), rgba(139, 92, 246, 0.4), transparent 70%);
    box-shadow: 
        0 0 60px rgba(0, 243, 255, 0.2),
        inset -20px -20px 60px rgba(0, 0, 0, 0.9);
    animation: planetFloat 20s infinite ease-in-out alternate;
}

/* Ubicación: Esquina superior derecha */
.planet-1 {
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
}

/* Ubicación: Esquina inferior izquierda */
.planet-2 {
    bottom: 10%;
    left: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.8), transparent 60%);
    opacity: 0.4;
    animation-duration: 25s; 
}

@keyframes planetFloat {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(20px) rotate(5deg); }
}

/* 2. METEORITOS (Shooting Stars) */
.meteor {
    position: fixed; top: 50%; left: 50%; height: 2px;
    background: linear-gradient(90deg, #fff, transparent);
    opacity: 0; z-index: -1; border-radius: 100%; box-shadow: 0 0 10px #fff; pointer-events: none;
    animation: meteorShoot 3s linear infinite;
}
.meteor::before {
    content: ''; position: absolute; top: 50%; transform: translateY(-50%);
    width: 4px; height: 4px; background: #fff; border-radius: 50%;
    box-shadow: 0 0 15px #00f3ff;
}

@keyframes meteorShoot {
    0% { transform: rotate(-45deg) translateX(0); opacity: 1; width: 0; }
    10% { opacity: 1; }
    70% { opacity: 0; width: 200px; }
    100% { transform: rotate(-45deg) translateX(-1000px); opacity: 0; width: 0; }
}

/* =========================================
   EXTRAS ALUCINANTES (GLITCH)
   ========================================= */

/* TEXTO HOLOGRÁFICO (Glitch Effect) */
.glitch-text { position: relative; display: inline-block; }
.glitch-text::before, .glitch-text::after {
    content: attr(data-text); position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; background: #030305;
}
.glitch-text::before {
    left: 2px; text-shadow: -1px 0 #00f3ff; clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px; text-shadow: 1px 0 #8b5cf6; clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); } 100% { clip-path: inset(30% 0 20% 0); }
}
@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); } 100% { clip-path: inset(5% 0 80% 0); }
}

/* =========================================
   EXPERIENCIA MÓVIL "WOOW" (Portal & Touch)
   ========================================= */

/* 1. PORTAL DE ENERGÍA (Detrás del formulario) */
.energy-portal {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 120%; height: 120%; border-radius: 50%; z-index: -1;
    background: conic-gradient(from 0deg, transparent 0%, var(--primary) 20%, transparent 40%, var(--accent) 60%, transparent 100%);
    opacity: 0.3; filter: blur(30px);
    animation: portalSpin 10s linear infinite; pointer-events: none;
}

@keyframes portalSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 2. ONDAS DE CHOQUE (TOUCH RIPPLE) */
.touch-ripple {
    position: absolute; border: 2px solid #00f3ff; border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none;
    animation: rippleExpand 0.6s linear forwards; z-index: 9999;
    box-shadow: 0 0 10px #00f3ff, inset 0 0 10px #00f3ff;
}

@keyframes rippleExpand {
    0% { width: 0px; height: 0px; opacity: 1; border-width: 5px; }
    100% { width: 150px; height: 150px; opacity: 0; border-width: 0px; }
}

/* 3. OPTIMIZACIÓN MÓVIL */
@media (max-width: 768px) {
    .energy-portal { width: 300px; height: 300px; opacity: 0.5; filter: blur(40px); }
}