.form-message {
    margin-top: 20px;
}

.alert {
    display: flex;
    align-items: start;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.alert i {
    margin-right: 10px;
    font-size: 18px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Loading spinner en el botón */
#loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Animación del spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Estilos para el input de archivo personalizado */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.file-upload-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
}

.file-upload-display:hover {
    border-color: var(--dp-yellow);
    background-color: #fff;
}

.file-upload-text {
    flex: 1;
    color: #6c757d;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 40px);
    padding-right: 10px;
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

/* Para nombres muy largos, mostrar en múltiples líneas en hover */
.file-upload-display:hover .file-upload-text {
    white-space: normal;
    word-break: break-all;
    line-height: 1.3;
}

.file-upload-display i {
    color: var(--dp-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Estado cuando hay archivo seleccionado */
.file-upload-display.file-selected {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.file-upload-display.file-selected .file-upload-text {
    color: #155724;
}

.file-upload-display.file-selected i {
    color: #28a745;
}

/* Estado de error para el input de archivo */
.file-input.error + .file-upload-display {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.file-input.error + .file-upload-display .file-upload-text {
    color: #721c24;
}

/* Tooltip para mostrar nombre completo */
.file-upload-text[title] {
    cursor: help;
}

/* Responsive para mensajes */
@media (max-width: 768px) {
    .alert {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .alert i {
        font-size: 16px;
        margin-right: 8px;
    }

    .file-upload-display {
        padding: 10px 12px;
        min-height: 45px;
    }
    
    .file-upload-text {
        font-size: 14px;
    }
    
    .file-upload-display i {
        font-size: 14px;
    }

    /* En móvil, permitir wrap del texto siempre */
    .file-upload-text {
        white-space: normal;
        word-break: break-all;
        line-height: 1.2;
    }

    /* Para pantallas muy pequeñas */
    @media (max-width: 480px) {
        .file-upload-text {
            font-size: 12px;
            max-width: calc(100% - 30px);
        }
        
        .file-upload-display {
            padding: 8px 10px;
            min-height: 40px;
        }
    }
}