/* ========================================
   SPINNER DE CARGA - ESCUDO PERÚ
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 30px;
}

.spinner-shield {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: pulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.spinner-ring {
position: absolute;
top: 50%;
left: 50%;
width: 110px;
height: 110px;
margin: -55px 0 0 -55px;
border: 3px solid transparent;
    border-top-color: #c8102e;
    border-right-color: rgba(200, 16, 46, 0.3);
    border-radius: 50%;
    animation: spin 1.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring::before {
content: '';
position: absolute;
top: 4px;
left: 4px;
right: 4px;
bottom: 4px;
border: 2px solid transparent;
    border-top-color: #0d3b52;
    border-left-color: rgba(13, 59, 82, 0.3);
    border-radius: 50%;
    animation: spin 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
}

.spinner-ring::after {
content: '';
position: absolute;
top: 8px;
left: 8px;
right: 8px;
bottom: 8px;
border: 2px solid transparent;
    border-top-color: rgba(200, 16, 46, 0.5);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loading-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.5px;
    animation: fadeInOut 2s ease-in-out infinite;
}

.loading-subtext {
    font-size: 15px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    font-weight: 400;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(200, 16, 46, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c8102e, #0d3b52, #c8102e);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progressBar 1.5s ease-in-out infinite;
}

/* Animaciones */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.92;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes progressBar {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

/* Efecto de shimmer en el escudo */
.spinner-shield-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.spinner-shield-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
.loading-spinner {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
}
    
.spinner-ring {
    width: 90px;
    height: 90px;
    margin: -45px 0 0 -45px;
    border-width: 2px;
}
    
.spinner-ring::before {
    border-width: 2px;
}
    
.spinner-ring::after {
    border-width: 1px;
}
    
    .loading-text {
        font-size: 18px;
    }
    
    .loading-subtext {
        font-size: 13px;
    }
    
    .loading-progress {
        width: 160px;
    }
}

@media (max-width: 480px) {
.loading-spinner {
    width: 60px;
    height: 60px;
}
    
.spinner-ring {
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
}
    
    .loading-text {
        font-size: 16px;
    }
    
    .loading-subtext {
        font-size: 12px;
    }
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-overlay {
    animation: fadeIn 0.3s ease-in;
}

/* Efecto de brillo en los anillos */
.spinner-ring {
    box-shadow: 0 0 20px rgba(200, 16, 46, 0.2);
}

.spinner-ring::before {
    box-shadow: 0 0 15px rgba(13, 59, 82, 0.2);
}
