/* ==========================================================================
   COINDESOCOL · Pantalla de carga de la portada
   ========================================================================== */

/* CONTENEDOR PRINCIPAL */
#coindesocol-loader{
    position:fixed;
    inset:0;
    width:100%;
    height:100%;
    min-height:100vh;
    z-index:999999999;

    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;

    padding:25px;
    box-sizing:border-box;
    overflow:hidden;

    background:
        radial-gradient(circle at 20% 20%, rgba(129,199,132,.45) 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(96,125,139,.35) 0%, transparent 38%),
        linear-gradient(135deg, #e8f5e9 0%, #b7d8bd 28%, #78967f 58%, #56635b 78%, #37443d 100%);

    transition:
        opacity .8s ease,
        visibility .8s ease,
        transform .8s ease;
}

/* FIGURAS SUAVES DEL FONDO */
#coindesocol-loader::before,
#coindesocol-loader::after{
    content:"";
    position:absolute;
    border-radius:50%;
    filter:blur(8px);
    pointer-events:none;
}

#coindesocol-loader::before{
    width:320px;
    height:320px;
    top:-110px;
    left:-100px;
    background:rgba(76,175,80,.22);
    animation:flotarFondo 6s ease-in-out infinite alternate;
}

#coindesocol-loader::after{
    width:380px;
    height:380px;
    right:-140px;
    bottom:-150px;
    background:rgba(189,195,199,.25);
    animation:flotarFondo 7s ease-in-out infinite alternate-reverse;
}

/* OCULTAR PRELOADER */
#coindesocol-loader.hide{
    opacity:0;
    visibility:hidden;
    transform:scale(1.04);
    pointer-events:none;
}

/* CONTENIDO CENTRAL */
.coindesocol-contenido{
    position:relative;
    z-index:2;
    width:100%;
    max-width:850px;
    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    text-align:center;
}

/* TEXTO COINDESOCOL */
.coindesocol-logo{
    position:relative;
    display:inline-block;
    max-width:100%;
    padding:4px 8px;
    font-family:"Trebuchet MS", Arial, sans-serif;
    font-size:clamp(25px, 5.3vw, 48px);
    font-weight:900;
    letter-spacing:clamp(2px, .8vw, 7px);
    line-height:1.2;
    white-space:nowrap;
    color:#f8fff9;

    text-shadow:
        0 2px 3px rgba(0,0,0,.20),
        0 0 8px rgba(255,255,255,.30),
        0 0 18px rgba(46,125,50,.45);

    clip-path:inset(0 100% 0 0);

    animation:
        escribirCoindesocol 2.6s steps(11,end) forwards,
        brilloCoindesocol 2.5s ease-in-out infinite;
}

/* CURSOR DE ESCRITURA */
.coindesocol-logo::after{
    content:"";
    position:absolute;
    top:8%;
    right:-5px;
    width:3px;
    height:84%;
    border-radius:10px;
    background:#d8f3dc;
    box-shadow:
        0 0 8px rgba(216,243,220,.9),
        0 0 16px rgba(76,175,80,.8);
    animation:
        cursorParpadeo .65s infinite,
        ocultarCursor .2s forwards 3s;
}

/* LÍNEA INFERIOR */
.coindesocol-linea{
    position:relative;
    width:min(310px, 68vw);
    height:4px;
    margin-top:24px;
    overflow:hidden;
    border-radius:50px;
    background:rgba(255,255,255,.28);
    box-shadow:
        0 3px 12px rgba(0,0,0,.12),
        inset 0 1px 2px rgba(255,255,255,.35);
}

/* BRILLO QUE RECORRE LA LÍNEA */
.coindesocol-linea::before{
    content:"";
    position:absolute;
    top:0;
    left:-50%;
    width:50%;
    height:100%;
    border-radius:50px;
    background:linear-gradient(90deg, transparent, #f1f8f2, #81c784, #455a4d, transparent);
    animation:moverLinea 1.8s ease-in-out infinite;
}

/* PUNTOS DECORATIVOS */
.coindesocol-puntos{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    margin-top:16px;
}

.coindesocol-puntos span{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#e8f5e9;
    box-shadow:0 0 10px rgba(76,175,80,.65);
    animation:pulsoPuntos 1.2s ease-in-out infinite;
}

.coindesocol-puntos span:nth-child(2){ animation-delay:.2s; }
.coindesocol-puntos span:nth-child(3){ animation-delay:.4s; }


/* ANIMACIONES */

@keyframes escribirCoindesocol{
    from{ clip-path:inset(0 100% 0 0); }
    to{ clip-path:inset(0 0 0 0); }
}

@keyframes brilloCoindesocol{
    0%, 100%{
        text-shadow:
            0 2px 3px rgba(0,0,0,.20),
            0 0 8px rgba(255,255,255,.25),
            0 0 16px rgba(46,125,50,.35);
    }
    50%{
        text-shadow:
            0 2px 3px rgba(0,0,0,.18),
            0 0 12px rgba(255,255,255,.55),
            0 0 28px rgba(102,187,106,.75);
    }
}

@keyframes cursorParpadeo{
    0%, 45%{ opacity:1; }
    46%, 100%{ opacity:0; }
}

@keyframes ocultarCursor{
    to{ opacity:0; visibility:hidden; }
}

@keyframes moverLinea{
    from{ left:-55%; }
    to{ left:110%; }
}

@keyframes pulsoPuntos{
    0%, 100%{ transform:scale(.7); opacity:.45; }
    50%{ transform:scale(1.15); opacity:1; }
}

@keyframes flotarFondo{
    from{ transform:translate(0,0) scale(1); }
    to{ transform:translate(30px,25px) scale(1.12); }
}


/* TABLETS Y MÓVILES */
@media(max-width:768px){

    #coindesocol-loader{
        padding:20px 14px;
    }

    .coindesocol-logo{
        font-size:clamp(22px, 7vw, 34px);
        letter-spacing:clamp(1px, .9vw, 4px);
    }

    .coindesocol-linea{
        width:min(240px, 64vw);
        margin-top:20px;
    }
}

/* MÓVILES MUY PEQUEÑOS */
@media(max-width:380px){

    .coindesocol-logo{
        font-size:21px;
        letter-spacing:1.5px;
    }

    .coindesocol-linea{
        width:190px;
    }
}

/* PANTALLAS HORIZONTALES DE POCA ALTURA */
@media(max-height:500px){

    .coindesocol-logo{
        font-size:clamp(22px, 6vw, 38px);
    }

    .coindesocol-linea{
        margin-top:15px;
    }

    .coindesocol-puntos{
        margin-top:11px;
    }
}

/* ACCESIBILIDAD: REDUCIR MOVIMIENTO */
@media(prefers-reduced-motion:reduce){

    .coindesocol-logo,
    .coindesocol-linea::before,
    .coindesocol-puntos span,
    #coindesocol-loader::before,
    #coindesocol-loader::after{
        animation:none !important;
    }

    .coindesocol-logo{
        clip-path:none;
    }

    .coindesocol-logo::after{
        display:none;
    }
}
