/* SNADIR Iscrizione Form Styles */

.snadir-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.snadir-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0066cc;
}

.snadir-form-header h2 {
    color: #0066cc;
    margin-bottom: 10px;
}

.snadir-form-header p {
    color: #666;
    font-size: 14px;
}

/* Steps */
.snadir-step {
    display: none;
}

.snadir-step.active-step {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.snadir-step h3 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group label.required::after {
    content: " *";
    color: #dc3545;
}

.form-group small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Form Rows */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.col-md-3 { flex: 0 0 25%; }
.col-md-4 { flex: 0 0 33.333%; }
.col-md-6 { flex: 0 0 50%; }
.col-md-8 { flex: 0 0 66.666%; }

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        flex: 0 0 100%;
    }
}

/* Radio e Checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-inline,
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.radio-inline input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Consensi bloccati (non deselezionabili) */
.checkbox-label.consenso-bloccato {
    opacity: 0.8;
    background-color: #f0f0f0;
    padding: 8px;
    border-radius: 4px;
    position: relative;
}

.checkbox-label.consenso-bloccato::after {
    content: '🔒';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

.checkbox-label.consenso-bloccato input[type="checkbox"] {
    cursor: not-allowed;
}

.checkbox-required input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

/* Privacy Section */
.privacy-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.privacy-section h4 {
    color: #333;
    margin: 20px 0 15px 0;
    font-size: 16px;
}

.privacy-link {
    color: #0066cc;
    text-decoration: underline;
}

.privacy-link:hover {
    color: #004999;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Buttons */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.spinner.active {
    display: inline-block; /* Visibile quando ha classe active */
}

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

/* Messages */
.snadir-message {
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.snadir-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.snadir-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-icon,
.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-icon {
    color: #dc3545;
}

.success-icon {
    color: #28a745;
    font-size: 64px;
    font-weight: bold;
}

/* Success Message */
.snadir-success-message {
    padding: 40px 20px;
    text-align: center;
}

.snadir-success-message h3 {
    color: #28a745;
    margin-bottom: 20px;
}

.success-actions {
    margin: 30px 0;
}

.success-actions .btn {
    padding: 15px 40px;
    font-size: 16px;
}

.next-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
    text-align: left;
}

.next-steps h4 {
    color: #333;
    margin-bottom: 15px;
}

.next-steps ol {
    margin-left: 20px;
}

.next-steps li {
    margin-bottom: 10px;
    color: #666;
}

/* Modal */
.snadir-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    margin-top: 20px;
}

.modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .snadir-form-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% 10px;
        padding: 20px;
    }
}

/* Progress Bar (opzionale) */
.progress-container {
    width: 100%;
    height: 4px;
    background: #eee;
    margin-bottom: 30px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #0066cc;
    transition: width 0.3s ease;
}

/* Print styles */
@media print {
    .form-actions,
    .btn,
    .snadir-form-header {
        display: none;
    }
}
