/* Stili per la protezione form */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Stile per form in stato di submission */
form[data-submitted="true"] {
    opacity: 0.7;
    pointer-events: none;
}

/* Messaggi di errore di concorrenza */
.concurrency-error {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.concurrency-error .alert-heading {
    color: #856404;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.concurrency-error .btn-retry {
    margin-top: 0.5rem;
}

/* Indicatore di salvataggio */
.saving-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
}

.saving-indicator.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}