/* ============================================
   Modal de Descarga - Estilos
   ============================================ */

/* Overlay */
.download-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Card */
.download-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
}

.download-modal-overlay.active .download-modal {
    transform: translateY(0) scale(1);
}

/* Close Button */
.download-modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.download-modal-close:hover {
    color: #333;
}

/* Header */
.download-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.download-modal-header .modal-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light, #4da6ff));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 1.4rem;
}

.download-modal-header h3 {
    font-size: 1.4rem;
    color: var(--dark-color, #2c3e50);
    margin-bottom: 6px;
    font-family: 'Playfair Display', serif;
}

.download-modal-header p {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}

.download-modal-file {
    display: inline-block;
    background: #f0f4ff;
    color: var(--primary-color, #0056b3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}

/* Form */
.download-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.download-form-group {
    position: relative;
}

.download-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

/* Radio button styles */
.download-type-options {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #444 !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    margin: 0;
    width: auto;
    padding: 0;
}

.download-form-group input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fafafa;
}

.download-form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #0056b3);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background-color: white;
}

.download-form-group input::placeholder {
    color: #bbb;
}

.download-form-group .input-icon {
    position: absolute;
    left: 13px;
    bottom: 13px;
    color: #bbb;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.download-form-group input:focus ~ .input-icon {
    color: var(--primary-color, #0056b3);
}

/* Error state */
.download-form-group input.input-error {
    border-color: #e74c3c;
}

.download-form-group .error-msg {
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 4px;
    display: none;
}

.download-form-group .error-msg.visible {
    display: block;
}

/* Submit Button */
.download-modal-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary-color, #0056b3), var(--primary-dark, #003366));
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-modal-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 86, 179, 0.35);
}

.download-modal-submit:active {
    transform: translateY(0);
}

.download-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.download-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: dl-spin 0.6s linear infinite;
    display: none;
}

.download-modal-submit.loading .download-spinner {
    display: inline-block;
}

.download-modal-submit.loading .btn-text {
    display: none;
}

@keyframes dl-spin {
    to { transform: rotate(360deg); }
}

/* Success state */
.download-modal-success {
    text-align: center;
    padding: 20px 0;
    display: none;
}

.download-modal-success .success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 1.8rem;
}

.download-modal-success h3 {
    color: #27ae60;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.download-modal-success p {
    color: #888;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
    .download-modal {
        padding: 30px 25px;
        margin: 15px;
    }

    .download-modal-header h3 {
        font-size: 1.2rem;
    }
}
