﻿/* ===== MODALES DINÁMICOS PREMIUM (VERSIÓN UX MEJORADA Y ESTABLE) ===== */
.dynamic-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65); /* leve mejora visual */
    backdrop-filter: blur(5px); /* 🎨 difuminado premium */
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    padding: 15px;
}

    .dynamic-modal.show {
        display: flex;
    }

/* Bloquea el scroll del fondo de la página de forma nativa (solo CSS) */
body:has(.dynamic-modal.show) {
    overflow: hidden;
}

/* ===== CAJA DEL MODAL ===== */
.modal-box {
    background: #fff;
    border-radius: 18px;
    width: 95%;
    max-width: 520px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* 🔥 límite visual del modal */
    overflow: hidden;
    transform: scale(0.95);
    animation: popIn 0.4s forwards;
}

/* ===== CABECERA ===== */
.modal-header {
    flex-shrink: 0;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(135deg, #2563eb, #3b82f6); /* mejora visual */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

    .modal-header i {
        margin-right: 10px;
        font-size: 1.4rem;
    }

.modal-close {
    cursor: pointer;
    font-size: 1.6rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

    .modal-close:hover {
        opacity: 1;
    }

/* ===== CUERPO ===== */
.modal-body {
    flex: 1;
    overflow-y: auto; /* 🔥 scroll interno */
    padding: 25px 24px 30px;
    color: #374151;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

    .modal-body::-webkit-scrollbar {
        width: 8px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 8px;
    }

    .modal-body p {
        margin-bottom: 15px;
        color: #4b5563;
        line-height: 1.5;
    }

    .modal-body ul {
        list-style: none;
        padding-left: 0;
        margin-bottom: 20px;
    }

        .modal-body ul li {
            padding: 8px 0;
            border-bottom: 1px solid #f1f5f9;
            display: flex;
            align-items: flex-start;
            gap: 8px;
            line-height: 1.4;
        }

            .modal-body ul li i {
                color: #16a34a;
                margin-top: 3px;
            }

    /* ===== CAMPOS ===== */
    .modal-body input,
    .modal-body textarea {
        width: 100%;
        padding: 12px 14px;
        border-radius: 10px;
        border: 1px solid #d1d5db;
        margin-bottom: 14px;
        transition: all 0.3s ease;
        font-size: 0.95rem;
    }

        .modal-body input:focus,
        .modal-body textarea:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
            outline: none;
        }

    /* 🔥 Textarea más grande */
    .modal-body textarea {
        min-height: 120px;
        resize: vertical;
    }

    /* ===== BOTONES ===== */
    .modal-body button {
        border-radius: 10px;
        font-weight: 600;
        padding: 10px 22px;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

        .modal-body button:hover {
            transform: translateY(-2px);
        }

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
