/* ============================================================
   PRELOADER INSTITUCIONAL - SIRENAPER
   SIN CSS VARIABLES
   Compatible con navegadores antiguos y modernos.
   ============================================================ */

.preloader-institucional {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    z-index: 2147483647 !important;

    overflow: hidden !important;

    background: rgba(255,255,255,0.48);

    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    user-select: none;
    -webkit-user-select: none;

    touch-action: none;

    transition: opacity 0.45s ease, visibility 0.45s ease;

    isolation: isolate;
}

.preloader-institucional.oculto {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.preloader-institucional.ocultando {
    opacity: 0 !important;
    visibility: visible !important;
    pointer-events: none !important;
}

.preloader-bloqueo {
    position: absolute;

    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(255,255,255,0.18);

    pointer-events: auto;
}

html.preloader-bloqueado,
body.preloader-bloqueado {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
}

.preloader-contenedor {
    position: relative;
    z-index: 10;

    width: 270px;
    height: 300px;

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

    text-align: center;

    box-sizing: border-box;
}

.preloader-brillo {
    position: absolute;

    width: 240px;
    height: 240px;

    border-radius: 50%;

    background:
        radial-gradient(
        circle,
        rgba(0,107,60,0.15) 0%,
        rgba(0,107,60,0.08) 35%,
        rgba(212,160,23,0.04) 52%,
        transparent 72%
        );

    animation: preloader-brillo 2.5s ease-in-out infinite;
}

.preloader-halo {
    position: absolute;

    width: 190px;
    height: 190px;

    border-radius: 50%;

    border: 1px solid rgba(0,107,60,0.12);

    box-shadow: 0 0 25px rgba(0,107,60,0.08);

    animation: preloader-halo 2.2s ease-in-out infinite;
}

.preloader-animacion {
    position: absolute;

    width: 165px;
    height: 165px;

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

    box-sizing: border-box;
}

.preloader-logo {
    position: absolute;

    width: 100px;
    height: 100px;

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

    z-index: 30;
}

.preloader-logo-contenedor {
    position: relative;

    width: 88px;
    height: 88px;

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

    border-radius: 50%;

    background: rgba(255,255,255,0.97);

    box-shadow:
        0 5px 18px rgba(0,0,0,0.14),
        0 0 0 1px rgba(0,107,60,0.10);

    overflow: hidden;

    animation: preloader-logo-pulso 2.2s ease-in-out infinite;
}

.preloader-logo-brillo {
    position: absolute;

    top: -50%;
    left: -80%;

    width: 50%;
    height: 200%;

    transform: rotate(25deg);

    background:
        linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.85),
        transparent
        );

    animation: preloader-logo-brillo 2.5s ease-in-out infinite;

    pointer-events: none;
}

.preloader-logo img {
    position: relative;
    z-index: 2;

    width: 72px;
    height: 72px;

    object-fit: contain;

    display: block;
}

.preloader-mensaje {
    position: absolute;

    top: 220px;
    left: 50%;

    transform: translateX(-50%);

    width: 350px;
    max-width: 90vw;

    text-align: center;

    color: #006b3c;

    font-size: 14px;
    line-height: 20px;

    font-weight: 600;

    letter-spacing: 0.2px;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.preloader-indicador {
    position: absolute;

    top: 250px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;
}

.preloader-indicador span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #006b3c;

    animation: preloader-puntos 1.2s ease-in-out infinite;
}

.preloader-indicador span:nth-child(2) {
    animation-delay: 0.15s;
}

.preloader-indicador span:nth-child(3) {
    animation-delay: 0.30s;
}

.preloader-submensaje {
    position: absolute;
    top: 273px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgba(0,0,0,0.48);
    letter-spacing: 0.9px;
}

.preloader-punto {
    position: absolute;
    display: block;
    border-radius: 50%;
}

.punto-1 {
    width: 10px;
    height: 10px;

    top: 3px;
    left: 50%;

    transform: translateX(-50%);

    background: #d4a017;

    box-shadow: 0 0 10px rgba(212,160,23,0.45);
}

.punto-2 {
    width: 7px;
    height: 7px;

    right: 6px;
    bottom: 38px;

    background: #006b3c;
}

.punto-3 {
    width: 6px;
    height: 6px;

    left: 12px;
    bottom: 50px;

    background: #d4a017;
}

.preloader-orbita-punto {
    position: absolute;

    width: 12px;
    height: 12px;

    top: -6px;
    left: 50%;

    margin-left: -6px;

    border-radius: 50%;

    background: #d4a017;
}

/* ============================================================
   MODELOS 1 - 8
   ============================================================ */

.modelo-1 {
    border-radius: 50%;

    border: 8px solid rgba(0,107,60,0.12);

    border-top-color: #006b3c;
    border-right-color: #006b3c;

    animation: preloader-girar 1s linear infinite;
}

.modelo-2 {
    border-radius: 50%;

    border: 6px solid transparent;

    border-top-color: #006b3c;
    border-bottom-color: #006b3c;

    animation: preloader-girar 1.2s linear infinite;
}

.modelo-2::after {
    content: "";

    position: absolute;

    top: 15px;
    right: 15px;
    bottom: 15px;
    left: 15px;

    border-radius: 50%;

    border: 4px solid transparent;

    border-left-color: #d4a017;
    border-right-color: #d4a017;

    animation: preloader-girar-inverso 1s linear infinite;
}

.modelo-3 {
    border-radius: 50%;

    border: 7px dotted #006b3c;

    animation: preloader-girar 1.6s linear infinite;
}

.modelo-4 {
    border-radius: 50%;

    border: 7px solid #006b3c;

    animation: preloader-pulso 1.4s ease-in-out infinite;
}

.modelo-5 {
    border-radius: 50%;

    border: 8px dashed #006b3c;

    animation: preloader-girar 1.8s linear infinite;
}

.modelo-6 {
    width: 170px;
    height: 105px;

    border-radius: 50%;

    border: 5px solid #006b3c;

    transform: rotate(-25deg);

    animation: preloader-orbita 1.5s linear infinite;
}

.modelo-6::after {
    content: "";

    position: absolute;

    width: 15px;
    height: 15px;

    top: -10px;
    left: 50%;

    margin-left: -7px;

    border-radius: 50%;

    background: #d4a017;
}

.modelo-7 {
    border-radius: 50%;

    border: 7px solid #006b3c;

    animation: preloader-ondas 1.5s ease-out infinite;
}

.modelo-8 {
    border-radius: 50%;

    border: 8px solid rgba(0,107,60,0.12);

    border-top-color: #006b3c;

    animation: preloader-girar 1s linear infinite;
}

.modelo-8::before {
    content: "";

    position: absolute;

    width: 14px;
    height: 14px;

    top: -11px;
    left: 50%;

    margin-left: -7px;

    border-radius: 50%;

    background: #d4a017;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */

@keyframes preloader-girar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes preloader-girar-inverso {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes preloader-pulso {
    0% {
        transform: scale(0.90);
        opacity: 0.70;

        box-shadow:
            0 0 0 0 rgba(0,107,60,0.30);
    }

    50% {
        transform: scale(1.08);
        opacity: 1;

        box-shadow:
            0 0 0 18px rgba(0,107,60,0);
    }

    100% {
        transform: scale(0.90);
        opacity: 0.70;

        box-shadow:
            0 0 0 0 rgba(0,107,60,0);
    }
}

@keyframes preloader-orbita {
    from {
        transform:
            rotate(-25deg)
            rotate(0deg);
    }

    to {
        transform:
            rotate(-25deg)
            rotate(360deg);
    }
}

@keyframes preloader-ondas {
    0% {
        transform: scale(0.72);
        opacity: 0.25;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.15);
        opacity: 0.15;
    }
}

@keyframes preloader-brillo {
    0%,
    100% {
        transform: scale(0.90);
        opacity: 0.45;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes preloader-halo {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.35;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.75;
    }
}

@keyframes preloader-logo-pulso {
    0%,
    100% {
        transform: scale(0.97);
    }

    50% {
        transform: scale(1.03);
    }
}

@keyframes preloader-logo-brillo {
    0% {
        left: -80%;
    }

    50% {
        left: 130%;
    }

    100% {
        left: 130%;
    }
}

@keyframes preloader-puntos {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ============================================================
   MÓVIL
   ============================================================ */

@media (max-width: 600px) {

    .preloader-contenedor {
        width: 230px;
        height: 270px;
    }

    .preloader-animacion {
        width: 145px;
        height: 145px;
    }

    .preloader-logo {
        width: 84px;
        height: 84px;
    }

    .preloader-logo-contenedor {
        width: 76px;
        height: 76px;
    }

    .preloader-logo img {
        width: 62px;
        height: 62px;
    }

    .preloader-mensaje {
        top: 200px;
        width: 290px;
        font-size: 13px;
    }

    .preloader-indicador {
        top: 230px;
    }

    .preloader-submensaje {
        top: 252px;
    }
}

@media (max-height: 500px) {

    .preloader-contenedor {
        transform: scale(0.82);
    }
}

@media (prefers-reduced-motion: reduce) {

    .preloader-institucional *,
    .preloader-institucional *::before,
    .preloader-institucional *::after {
        animation: none !important;
        transition: none !important;
    }
}
