/* ==========================================================================
   LOADER OVERLAY
   ========================================================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Por encima de todo */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 1.1rem;
    gap: 15px;
}

/* El círculo giratorio */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #006039; /* Tu color verde Landgrave */
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODAL / VENTANA FLOTANTE
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Caja blanca interna */
.modal-content {
    background-color: white;
    padding: 35px;
    border-radius: 8px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: Arial, sans-serif;
}

/* Botón de cerrar "X" superior */
.modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}
.modal-close:hover { color: #333; }

/* Icono redondo central (Éxito / Error) */
.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px auto;
    font-size: 26px;
    font-weight: bold;
}
.modal-icon.success { background-color: #e6f4ea; color: #137333; }
.modal-icon.error { background-color: #fce8e6; color: #c5221f; }

#modalMessage {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 25px;
}

/* Botón de acción inferior */
.modal-btn {
        font-family: 'Tsec';
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
}
.modal-btn:hover { opacity: 0.8; }
.modal-btn.success { background-color: #006039; } /* Tu verde corporativo */
.modal-btn.error { background-color: #c5221f; }

/* ==========================================================================
   CLASE ACTIVADORA (Controlada por JS)
   ========================================================================== */
.loader-overlay.active,
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}