/* =====================================================
   MINIALFA
   FORMULARIO DE EMPLEADOS
===================================================== */


/* =====================================================
   MODAL
===================================================== */

.employee-modal {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    place-items: center;

    padding: 20px;
}


.employee-modal.show,
.employee-modal.is-open {
    display: grid;
}


/* =====================================================
   FONDO
===================================================== */

.employee-modal-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(8, 25, 37, 0.72);

    backdrop-filter:
        blur(3px);

    -webkit-backdrop-filter:
        blur(3px);
}


.employee-modal.show
.employee-modal-backdrop {
    animation:
        employeeBackdropIn
        0.18s ease-out;
}


/* =====================================================
   TARJETA PRINCIPAL
===================================================== */

.employee-modal-card {
    position: relative;

    z-index: 1;

    width:
        min(100%, 780px);

    max-height:
        calc(100vh - 40px);

    overflow-y: auto;

    background:
        var(--surface);

    border:
        1px solid
        rgba(214, 222, 229, 0.8);

    border-radius:
        18px;

    box-shadow:
        0 28px 80px
        rgba(0, 0, 0, 0.30);

    scrollbar-width: thin;

    scrollbar-color:
        #bcc9d2
        transparent;
}


.employee-modal.show
.employee-modal-card {
    animation:
        employeeModalIn
        0.22s ease-out;
}


/* =====================================================
   ENCABEZADO
===================================================== */

.employee-modal-header {
    padding:
        22px 24px;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 18px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfcfd 100%
        );

    border-bottom:
        1px solid
        var(--border);
}


.employee-modal-title {
    min-width: 0;
}


.employee-modal-title > span {
    color:
        var(--accent-dark);

    font-size:
        0.72rem;

    font-weight: 800;

    letter-spacing:
        0.10em;

    text-transform:
        uppercase;
}


.employee-modal-header h2 {
    margin:
        4px 0 4px;

    color:
        var(--brand-dark);

    font-size:
        1.35rem;

    line-height:
        1.2;
}


.employee-modal-header p {
    margin: 0;

    color:
        var(--muted);

    font-size:
        0.85rem;

    line-height:
        1.45;
}


/* =====================================================
   BOTÓN CERRAR
===================================================== */

.employee-modal-close {
    width: 42px;

    height: 42px;

    padding: 0;

    display: grid;

    place-items: center;

    flex: 0 0 auto;

    color:
        var(--brand);

    background:
        #ffffff;

    border:
        1px solid
        var(--border);

    border-radius:
        11px;

    box-shadow:
        0 3px 10px
        rgba(23, 33, 43, 0.04);

    transition:
        color 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}


.employee-modal-close:hover {
    color:
        var(--danger);

    background:
        var(--danger-soft);

    border-color:
        #e5a49f;

    box-shadow:
        0 6px 15px
        rgba(180, 35, 24, 0.10);

    transform:
        translateY(-1px);
}


.employee-modal-close:active {
    transform:
        scale(0.94);
}


/* =====================================================
   FORMULARIO
===================================================== */

.employee-form {
    padding:
        24px;
}


/* =====================================================
   GRID
===================================================== */

.employee-form-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap:
        18px 20px;
}


/* =====================================================
   CAMPOS
===================================================== */

.form-field {
    min-width: 0;

    display: grid;

    align-content: start;

    gap: 7px;
}


.form-field label {
    display: flex;

    align-items: center;

    gap: 7px;

    color:
        var(--text);

    font-size:
        0.81rem;

    font-weight:
        750;
}


.optional-label {
    color:
        var(--muted);

    font-size:
        0.68rem;

    font-weight:
        650;
}


/* =====================================================
   INPUTS Y SELECTS
===================================================== */

.form-field input,
.form-field select {
    width: 100%;

    min-height: 46px;

    padding:
        10px 13px;

    color:
        var(--text);

    background:
        #ffffff;

    border:
        1px solid
        var(--border);

    border-radius:
        10px;

    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}


.form-field input::placeholder {
    color:
        #8a98a6;
}


.form-field input:hover,
.form-field select:hover {
    border-color:
        #b8c6d0;
}


.form-field input:focus,
.form-field select:focus {
    background:
        #ffffff;

    border-color:
        var(--accent);

    outline:
        none;

    box-shadow:
        0 0 0 3px
        rgba(8, 122, 131, 0.13);
}


/* =====================================================
   SELECT PERSONALIZADO
===================================================== */

.select-wrapper {
    position: relative;
}


.select-wrapper select {
    padding-right:
        42px;

    appearance:
        none;

    -webkit-appearance:
        none;

    cursor:
        pointer;
}


/* Flecha */

.select-wrapper::after {
    content: "";

    position: absolute;

    top: 50%;

    right: 16px;

    width: 7px;

    height: 7px;

    border-right:
        2px solid
        var(--muted);

    border-bottom:
        2px solid
        var(--muted);

    pointer-events:
        none;

    transform:
        translateY(-65%)
        rotate(45deg);

    transition:
        border-color 0.16s ease;
}


.select-wrapper:focus-within::after {
    border-color:
        var(--accent-dark);
}


/* =====================================================
   NOTA INFORMATIVA
===================================================== */

.employee-form-note {
    margin-top:
        20px;

    padding:
        12px 14px;

    display: flex;

    align-items: flex-start;

    gap: 10px;

    color:
        #075985;

    background:
        #edf7fb;

    border:
        1px solid
        #cfe4ee;

    border-radius:
        11px;
}


.employee-form-note svg {
    margin-top:
        1px;

    flex:
        0 0 auto;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.8;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}


.employee-form-note span {
    font-size:
        0.78rem;

    line-height:
        1.45;
}


/* =====================================================
   ACCIONES
===================================================== */

.employee-form-actions {
    margin-top:
        22px;

    padding-top:
        18px;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 10px;

    border-top:
        1px solid
        var(--border);
}


/* =====================================================
   BOTONES
===================================================== */

.form-button {
    min-height:
        43px;

    padding:
        9px 17px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    border-radius:
        10px;

    font-size:
        0.84rem;

    font-weight:
        750;

    box-shadow:
        0 3px 9px
        rgba(23, 33, 43, 0.04);

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}


/* =====================================================
   CANCELAR
===================================================== */

.cancel-form-button {
    color:
        var(--text);

    background:
        #ffffff;

    border:
        1px solid
        var(--border);
}


.cancel-form-button:hover {
    color:
        var(--brand-dark);

    background:
        var(--surface-soft);

    border-color:
        #b9c7d1;

    box-shadow:
        0 6px 14px
        rgba(23, 33, 43, 0.07);

    transform:
        translateY(-2px);
}


/* =====================================================
   CONFIRMAR
===================================================== */

.confirm-form-button {
    color:
        #ffffff;

    background:
        var(--brand);

    border:
        1px solid
        var(--brand);
}


.confirm-form-button:hover {
    background:
        var(--brand-dark);

    border-color:
        var(--brand-dark);

    box-shadow:
        0 7px 16px
        rgba(10, 40, 58, 0.18);

    transform:
        translateY(-2px);
}


/* =====================================================
   EFECTO AL PRESIONAR
===================================================== */

.form-button:active {
    transform:
        translateY(1px)
        scale(0.97);

    box-shadow:
        0 2px 5px
        rgba(23, 33, 43, 0.08);
}


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

@keyframes employeeModalIn {

    from {
        opacity: 0;

        transform:
            translateY(12px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


@keyframes employeeBackdropIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


/* =====================================================
   TABLET / CELULAR
===================================================== */

@media (max-width: 650px) {

    .employee-modal {
        padding:
            10px;
    }


    .employee-modal-card {
        max-height:
            calc(100vh - 20px);

        border-radius:
            15px;
    }


    .employee-modal-header {
        padding:
            18px;
    }


    .employee-form {
        padding:
            18px;
    }


    .employee-form-grid {
        grid-template-columns:
            1fr;

        gap:
            15px;
    }


    .employee-form-actions {
        display: grid;

        grid-template-columns:
            1fr 1fr;
    }


    .form-button {
        width:
            100%;
    }

}


/* =====================================================
   CELULAR PEQUEÑO
===================================================== */

@media (max-width: 420px) {

    .employee-modal-header h2 {
        font-size:
            1.2rem;
    }


    .employee-modal-header p {
        font-size:
            0.80rem;
    }


    .employee-form-actions {
        grid-template-columns:
            1fr;
    }

}


/* =====================================================
   MOVIMIENTO REDUCIDO
===================================================== */

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

    .employee-modal.show
    .employee-modal-card,
    .employee-modal.show
    .employee-modal-backdrop {
        animation:
            none;
    }

}