/* ================= MODAL ================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* CAJA DEL MODAL */
.modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 600px;       /* tamaño más cómodo */
    max-height: 90vh;       /* limita altura y permite scroll */
    overflow-y: auto;
    padding: 25px 20px 30px;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.5s ease;
}

/* ANIMACIÓN */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* BOTÓN CERRAR */
.modal-content .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: 0.2s;
}

.modal-content .close:hover {
    color: var(--rojo-fuerte);
    transform: scale(1.1);
}

/* TÍTULO */
.modal-content h2 {
    margin: 0 0 20px;
    font-size: 22px;
    color: var(--black);
    text-align: center;
    letter-spacing: 0.5px;
    font-family: Arial, Helvetica, sans-serif;
}

/* ================= FORMULARIO ================= */
#formAltaColaborador {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#formAltaColaborador label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

/* INPUTS Y SELECTS */
#formAltaColaborador input,
#formAltaColaborador select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: 0.2s;
}

#formAltaColaborador input:focus,
#formAltaColaborador select:focus {
    border-color: var(--rojo-principal);
    box-shadow: 0 0 0 2px rgba(200,0,0,0.1);
}

/* ================= INPUT + RELOAD BUTTON ================= */
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* espacio entre input y botón */
}

.input-wrapper input {
    flex: 1;
}

.input-wrapper button {
    padding: 10px 14px;
    font-size: 18px;
    background: var(--azul-principal);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.input-wrapper button:hover {
    background: linear-gradient(135deg, var(--azul-principal), #1e90ff);
    transform: scale(1.05);
}

/* ================= ACCIONES BOTONES ================= */
#formAltaColaborador .acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.btn-primary {
    background: var(--rojo-principal);
    color: var(--blanco);
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
    transition: all 0.25s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--azul-principal), #1e90ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

.btn-secondary {
    background: #f2f2f2;
    color: #333;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .modal-content { max-width: 90%; padding: 20px; }
    #formAltaColaborador .acciones { flex-direction: column; gap: 8px; }
    .btn-primary, .btn-secondary { width: 100%; font-size: 15px; }
}

@media (max-width: 480px) {
    .modal-content { padding: 15px; }
    #formAltaColaborador { gap: 10px; }
    #formAltaColaborador input, #formAltaColaborador select { font-size: 13px; padding: 8px; }
    .input-wrapper { flex-direction: column; gap: 5px; }
    .input-wrapper button { width: 100%; font-size: 16px; padding: 8px 12px; }
}
