.capa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.capa-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    height: 100%;
}

.capa-item:hover {
    transform: translateY(-5px);
}

.capa-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 508 / 281;
    object-fit: contain;
    display: block;
    background-color: #f0f0f1;
}

.titulo-capa {
    padding: 20px;
    background: #152346;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.titulo-capa h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 15px;
}

.btn-cap-popup,
.btn-cap-popup:focus {
    background: #E2AA2F;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: auto;
    transition: background 0.3s;
}

.btn-cap-popup:hover {
    background: #e2a92fad;
}

#cap-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 39, 75, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.cap-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: capSlideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes capSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cap-header {
    background: #16274B;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #d63638;
}

.cap-title {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
}

.cap-title span {
    color: #E2AA2F;
    display: block;
    font-size: 0.9em;
    font-weight: 400;
    margin-top: 5px;
}

#cap-close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#cap-close:hover {
    color: #fff;
}

.cap-body {
    padding: 25px;
    overflow-y: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
}

#cap-formulario input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f9f9f9;
    box-sizing: border-box;
}

#cap-formulario input:focus {
    border-color: #152346;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 35, 70, 0.1);
}

.cap-footer {
    margin-top: 10px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: #152346;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    background: #0f1a36;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cap-box {
        width: 95%;
        border-radius: 8px;
    }
}

.cap-success {
    color: green;
    margin-top: 10px;
    text-align: center;
}

.cap-error {
    color: red;
    margin-top: 10px;
    text-align: center;
}