/* =====================================================
   ✨ RUBIKU ABILITY - PORTAL DE ESENCIA v8.0 (FINAL)
   Consolidado: Centrado Pro, Capas WebGL y Estabilidad UI
   ===================================================== */


:root {
    --essence-purple: #8e44ad;
    --essence-blue: #3498db;
    --essence-lilac: #a29bfe;
    /* 🖼️ Tu nueva imagen de fondo */
    --bg-photo: url('https://images.unsplash.com/photo-1620121692029-d088224ddc74?q=80&w=2664&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    --photo-dimmer: rgb(255 6 126);
    /* ✨ Un poco más oscuro para la textura */
    --glass: rgba(0, 0, 0, 0.671);
    --glass-border: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    /* ✨ QUITAMOS EL BACKGROUND-COLOR PARA QUE SE VEA EL ::BEFORE */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    background: #030305;
    /* Fondo base muy profundo */
}

/* 🎞️ EL ESCENARIO: Foto + Textura de Grano */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    /* ✨ Mezclamos la foto con una capa de ruido para la textura */
    background:
        linear-gradient(var(--photo-dimmer), var(--photo-dimmer)),
        url('https://grainy-gradients.vercel.app/noise.svg'),
        var(--bg-photo);
    background-size: cover, 200px, cover;
    background-position: center;
    background-blend-mode: multiply, overlay, normal;
    z-index: -10;
    animation: backgroundLanding 1.5s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

/* 🌌 Canvas de Partículas (Entre la foto y el texto) */
#essence-canvas-container {
    position: fixed;
    inset: 0;
    z-index: -5;
    /* ✨ Detrás de la UI, sobre el fondo */
    pointer-events: none;
}




/* Pulso de luz ambiental */
.pulse-background {
    position: fixed;
    inset: 0;
    z-index: -6;
    background: radial-gradient(circle at 50% 50%, rgba(142, 68, 173, 0.1) 0%, transparent 70%);
}

/* 🌸 2. AMBIENTE (Pétalos) */
.petal-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.petal {
    position: absolute;
    fill: rgba(255, 255, 255, 0.15);
    filter: blur(1.5px);
    animation: petalBurst 0.8s forwards, floatPetalDown 18s 0.8s infinite linear;
}

/* 🎸 3. INSTRUMENTOS DE FONDO (Visibilidad Sutil) */
.bg-instruments-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.instrument-essence {
    position: absolute;
    color: white;
    opacity: 0.1;
    filter: blur(1.5px);
}

.inst-guitar {
    top: 5%;
    left: -2%;
    font-size: 25rem;
    --base-rot: -15deg;
    animation: floatingInst 22s infinite ease-in-out;
}

.inst-piano {
    bottom: 2%;
    right: 2%;
    font-size: 22rem;
    --base-rot: 12deg;
    animation: floatingInst 28s infinite ease-in-out reverse;
}

.inst-drum {
    top: 40%;
    right: -2%;
    font-size: 18rem;
    --base-rot: 20deg;
    animation: floatingInst 25s infinite ease-in-out;
}

/* 🛰️ 4. PORTAL MASTER (El ancla estable) */
.portal-master {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    z-index: 10;
    padding: 20px;
    position: relative;
    flex-shrink: 0;
    /* ✨ Evita que el contenedor se deforme */
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 🎬 5. IDENTIDAD (Logo) */
.brand-intro {
    text-align: center;
    margin-bottom: 30px;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
    animation: smokeEntrance 1.5s forwards;
}

.logo-text {
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -4px;
    color: white;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

.tagline {
    color: rgb(255, 255, 255);
    font-size: 0.8rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.6;
}

/* Efecto Elevación (Controlado por JS) */
.reveal-interface-active .brand-intro {
    transform: scale(0.65) translateY(-15px);
    opacity: 0.95;
}

/* 🌫️ 6. INTERFAZ (Humo) */
.gateway-interface {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    filter: blur(25px);
    transform: translateY(30px);
    pointer-events: none;
}

.reveal-interface {
    animation: smokeEntrance 1s 0.8s forwards;
    pointer-events: all;
}

/* ☁️ 7. BOTONES & CARDS PREMIUM */
.btn-essence,
.login-card {
    width: 100%;
}

.btn-essence {
    background: var(--glass);
    border: 1px solid var(--glass);
    backdrop-filter: blur(12px);
    padding: 18px 25px;
    border-radius: 18px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-essence:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--essence-lilac);
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ⌨️ INPUTS */
.input-essence {
    position: relative;
    width: 100%;
}

.input-essence i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--essence-lilac);
}

.input-essence input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    outline: none;
}

.btn-action {
    width: 100%;
    padding: 16px;
    background: var(--essence-purple);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

/* ⚠️ 8. AVISO DE GOOGLE (Independiente del Flujo) */
.google-mini-hint {
    position: fixed;
    /* ✨ Clave para no mover el contenido */
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(142, 68, 173, 0.9);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;

}

/* 🏁 9. ANIMACIONES */
@keyframes backgroundLanding {
    0% {
        transform: scale(1.1);
        filter: brightness(2) blur(10px);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        filter: brightness(1) blur(0px);
        opacity: 1;
    }
}

@keyframes smokeEntrance {
    to {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

@keyframes petalBurst {
    0% {
        transform: translateY(-50vh) scale(3);
        opacity: 0;
    }

    100% {
        transform: translateY(10vh) scale(1);
        opacity: 0.7;
    }
}

@keyframes floatPetalDown {
    0% {
        transform: translateY(10vh) rotate(0deg);
    }

    100% {
        transform: translateY(115vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatingInst {

    0%,
    100% {
        transform: translateY(0) rotate(var(--base-rot));
    }

    50% {
        transform: translateY(-40px) translateX(20px) rotate(calc(var(--base-rot) + 5deg));
    }
}

/* UTILS */
.hidden {
    display: none !important;
}

.divider-essence {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 5px 0;
}



/* 🎸 3. INSTRUMENTOS DE FONDO (Visibilidad 0.1) */
.bg-instruments-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.instrument-essence {
    position: absolute;
    color: white;
    opacity: 0.1;
    filter: blur(1.5px);
}

.inst-guitar {
    top: 5%;
    left: -2%;
    font-size: 25rem;
    --base-rot: -15deg;
    animation: floatingInst 22s infinite ease-in-out;
}

.inst-piano {
    bottom: 2%;
    right: 2%;
    font-size: 22rem;
    --base-rot: 12deg;
    animation: floatingInst 28s infinite ease-in-out reverse;
}

.inst-drum {
    top: 40%;
    right: -2%;
    font-size: 18rem;
    --base-rot: 20deg;
    animation: floatingInst 25s infinite ease-in-out;
}

@keyframes floatingInst {

    0%,
    100% {
        transform: translateY(0) rotate(var(--base-rot));
    }

    50% {
        transform: translateY(-40px) translateX(20px) rotate(calc(var(--base-rot) + 5deg));
    }
}

/* 🛰️ 4. PORTAL MASTER (El ancla que une todo) */
.portal-master {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    z-index: 10;
    padding: 20px;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 🎬 5. IDENTIDAD (Logo) */
.brand-intro {
    text-align: center;
    margin-bottom: 30px;
    /* Espacio con la interfaz */
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
    animation: smokeEntrance 1.5s forwards;
}

.logo-text {
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -4px;
    color: white;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

/* ✨ Efecto Elevación Coherente (Activado por JS) */
.reveal-interface-active .brand-intro {
    transform: scale(0.65);
    margin-bottom: 10px;
}

/* 🌫️ 6. INTERFAZ (Humo) */
.gateway-interface {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    filter: blur(25px);
    transform: translateY(30px);
    pointer-events: none;
}

.reveal-interface {
    animation: smokeEntrance 1s 0.8s forwards;
    pointer-events: all;
}

@keyframes smokeEntrance {
    to {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

/* ☁️ 7. BOTONES PREMIUM (Cristalinos) */
.choice-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 50px;
    width: 100%;
}



/* 🎬 8. FORMULARIO & GOOGLE */
.login-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-essence {
    position: relative;
    width: 100%;
}

.input-essence i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--essence-lilac);
}

.input-essence input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    outline: none;
}

.btn-action {
    width: 100%;
    padding: 16px;
    background: var(--essence-purple);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.btn-google-essence {
    width: 100%;
    padding: 15px;
    background: white;
    color: #111;
    border-radius: 14px;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

/* 🏁 UTILS */
.hidden {
    display: none !important;
}

.divider-essence {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 10px 0;
}

.slide-out {
    animation: smokeExit 0.6s forwards;
}

@keyframes smokeExit {
    to {
        opacity: 0;
        filter: blur(30px);
        transform: translateY(-40px);
    }
}