/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
   /* font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    line-height: 1.6;
	*/
}

/* Container principale */
.container {
	max-width: 800px;
	margin: auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 400px;
}

/* Header */
h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.no-etichetta label {
    display: none !important;
}

/* Barra di progresso */
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #8BC34A;
    transition: width 0.3s ease;
}

/* Contenitore domande */
.question-container {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.question-container.active {
    display: block;
}

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

/* Titoli domande */
.question-title {
    font-size: 24px;
    font-weight: bold;
    color: #108ed3;
    margin-bottom: 20px;
    text-align: center;
	text-wrap: pretty;
}

.question-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
	text-wrap: pretty;
}

/* Contenuto domande */
.question-content {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
}

.question-content h3 {
    color: #007bff;
    margin-bottom: 15px;
}

.question-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.question-content li {
    margin-bottom: 8px;
}

.question-content p {
    margin-bottom: 12px;
}

.question-content strong {
    color: #333;
}

/* Griglia risposte */
.answers-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

/* Pulsanti risposta */
.answer-button {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.answer-button:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.answer-button.selected {
    border-color: #007bff;
    background-color: #e3f2fd;
    font-weight: bold;
}

/* Checkbox multipli */
.answer-checkbox {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-checkbox:hover {
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.answer-checkbox input[type="checkbox"] {
    margin-right: 15px;
    transform: scale(1.5);
    cursor: pointer;
}

.answer-checkbox span {
    font-size: 16px;
    cursor: pointer;
}

/* Navigazione */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Pulsanti */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: inherit;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

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

.btn-secondary:hover {
    background-color: white;
    transform: translateY(-1px);
}

.btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Campi form */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-field input.error {
    border-color: #dc3545;
}

/* Riepilogo */
.summary {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.summary h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.summary-item {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: #333;
    margin-right: 10px;
    min-width: 150px;
}

.summary-item span {
    color: #666;
    text-align: right;
    flex: 1;
}

/* Contatore domande */
#questionCounter {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Form nascosto */
.hidden-form {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
     
    .container {
        padding: 20px;
    }
    
    .question-title {
        font-size: 20px;
    }
    
    .answer-button,
    .answer-checkbox {
        padding: 15px;
    }
    
    .navigation {
        // flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
    }
	
	.btn-secondary {
    padding-left: 0px;
	}
    
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summary-item strong {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .summary-item span {
        text-align: left;
    }
}

/* Animazioni aggiuntive */
.answer-button:active {
    transform: translateY(0);
}

.btn:active {
    transform: translateY(0);
}

/* Stati di caricamento */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Evidenziazione errori */
/* Messaggi di errore */
.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: none;
    padding: 5px 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    line-height: 1.3;
}

.form-field input.error,
.form-field select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.checkbox-label.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

/* Focus su campi con errore */
.form-field input.error:focus,
.form-field select.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

/* Animazione per errori */
.error-message {
    animation: slideDown 0.3s ease-out;
}

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

/* Stati di successo */
.form-field input.valid,
.form-field select.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}


/* Miglioramenti accessibilità */
.btn:focus,
.answer-button:focus,
.answer-checkbox:focus {
    // outline: 2px solid #007bff;
    outline-offset: 2px;
}

input:focus,
select:focus {
    outline: none;
}

/* Checkbox personalizzati - VERSIONE CORRETTA */
.form-field-checkbox {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.checkbox-label:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 15px;
    margin-top: 3px;
    transform: scale(1.3);
    flex-shrink: 0;
    width: auto;
    height: auto;
}

.checkbox-text {
    flex: 1;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Override eventuali stili sui checkbox */
.checkbox-label input[type="checkbox"] {
    width: auto !important;
    padding: 0 !important;
    border: none !important;
}

/* Stati checkbox */
.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    font-weight: 600;
    // color: #007bff;
}

/* Focus accessibilità */
.checkbox-label input[type="checkbox"]:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Link styling nei checkbox */
.checkbox-text a {
    color: #007bff;
    text-decoration: underline;
    font-weight: 600;
}

.checkbox-text a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Responsive per checkbox */
@media (max-width: 768px) {
    .checkbox-label {
        padding: 12px;
    }
    
    .checkbox-text {
        font-size: 13px;
    }
    
    .checkbox-label input[type="checkbox"] {
        margin-right: 12px;
        transform: scale(1.2);
    }
}

/* Stati di errore per checkbox */
.checkbox-label.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

/* Label-only / Text-only */
.form-field-label {
    margin-bottom: 20px;
}

.label-content {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    line-height: 1.6;
    font-size: 14px;
}

/* Link styling */
.label-content a {
    color: #007bff;
    text-decoration: underline;
    font-weight: 600;
}

.label-content a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Classi personalizzate per pulsanti */
.button-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
}

.button-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.button-accent {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.button-default {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.big {
    padding: 25px;
    font-size: 18px;
}

/* Wrapper personalizzati */
.grid-2-columns {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.compact {
    gap: 10px;
}

/* Classi per servizi */
.service-banking {
    border-left: 4px solid #007bff;
}

.service-card.popular {
    border: 3px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffffff);
}

.service-digital {
    border-left: 4px solid #28a745;
}

.service-premium.highlight {
    border: 2px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da, #ffffff);
}

/* NUOVO: Submit button personalizzazioni */
.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
	text-transform: uppercase;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34, #17a2b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.big-submit {
    padding: 20px 30px;
    font-size: 20px;
    font-weight: bold;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.large {
    padding: 18px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2-columns {
        grid-template-columns: 1fr;
    }
    
    .big-submit {
        padding: 15px 20px;
        font-size: 18px;
    }
}

/* Immagini e icone nelle risposte */
.answer-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.answer-icon {
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

.answer-text {
    flex: 1;
    line-height: 1.4;
}

/* Layout per button con contenuto */
.answer-button {
    display: flex;
    align-items: center;
    text-align: left;
}

/* Layout per checkbox con contenuto */
.answer-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.answer-checkbox {
    align-items: flex-start;
}

.answer-checkbox input[type="checkbox"] {
    margin-top: 8px;
}

/* Responsive per immagini */
@media (max-width: 768px) {
    .answer-image {
        width: 32px;
        height: 32px;
        margin-right: 12px;
    }
    
    .answer-icon {
        font-size: 20px;
        margin-right: 12px;
        min-width: 25px;
    }
}

/* Varianti dimensioni */
.answer-image.large {
    width: 60px;
    height: 60px;
}

.answer-image.small {
    width: 24px;
    height: 24px;
}

.answer-icon.large {
    font-size: 32px;
}

.answer-icon.small {
    font-size: 18px;
}

/* Layout aggiornato per risposte */
.answer-main,
.answer-content {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.answer-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.answer-text {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.answer-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-top: 4px;
    font-weight: normal;
}

/* Aggiustamenti checkbox */
.answer-checkbox input[type="checkbox"] {
    margin-top: 6px;
    align-self: flex-start;
}

/* Stati hover/selected con descrizione */
.answer-button:hover .answer-description,
.answer-button.selected .answer-description {
    color: #333;
}

.answer-checkbox:hover .answer-description {
    color: #333;
}

/* Responsive per descrizioni */
@media (max-width: 768px) {
    .answer-description {
        font-size: 12px;
    }
    
    .answer-text {
        font-size: 15px;
    }
}

/* Varianti styling descrizioni */
.answer-description.highlight {
    color: #007bff;
    font-weight: 500;
}

.answer-description.muted {
    color: #999;
    font-style: italic;
}

/* Range input styling */
.range-container {
    margin-top: 60px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.range-min, .range-max {
    color: #666;
    font-weight: 500;
}

.range-value {
    color: #007bff;
    font-weight: bold;
    font-size: 16px;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
}

input[type="range"] {
    width: 100% !important;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    padding: 0 !important;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s ease;
    resize: vertical;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Character counter per textarea */
.char-counter {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 4px;
}

.char-counter.warning {
    color: #ffc107;
}

.char-counter.error {
    color: #dc3545;
}

/* Range wrapper per posizionamento relativo */
.range-wrapper {
    position: relative;
    margin: 0px 0;
    overflow: visible; /* ← Cambiato da hidden per permettere la visualizzazione del valore */
    padding-top: 0px; /* ← Spazio per il valore fluttuante */
}

/* Range labels aggiornate */
.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
	margin-top: -8px;
    margin-bottom: 20px;
	font-size: 14px;
}

.range-min, .range-max {
    color: #666;
    font-weight: 500;
}

/* Valore fluttuante che segue il pallino */
.range-value-floating {
    position: absolute;
    top: -35px;
    left: 0;
    color: #007bff;
    font-weight: bold;
    font-size: 14px;
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    transition: left 0.1s ease;
    z-index: 10;
    /* ← AGGIUNTO: Centratura perfetta */
    transform: translateX(-50%);
    min-width: fit-content;
}

/* Triangolino sotto il valore */
.range-value-floating::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #007bff;
}

/* Aggiustamenti range input */
input[type="range"] {
    width: 100% !important;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    padding: 0 !important;
    margin: 8px 0 10px 0; /* Più spazio sopra per il valore fluttuante */
	
}





/* Stile generale */
.slider {
  width: 100%;
  height: 8px;
  background: transparent !important;
  cursor: pointer;
  appearance: none;
  border: none !important;
  height: 15px !important;
}

/* WebKit (Chrome, Safari, Edge) */
.slider::-webkit-slider-thumb {
  appearance: none !important;
  height: 20px !important;
  width: 20px !important;
  background: #4CAF50 !important;
  border-radius: 50%;
  border: 1px soli red !important;
  margin-top: -6px; /* centra il thumb verticalmente */
}

.slider::-webkit-slider-runnable-track {
  height: 8px;
  background: yellow;
  border-radius: 4px;
}

/* Firefox */
.slider::-moz-range-thumb {
  height: 20px  !important;
  width: 20px  !important;
  background: #4CAF50 !important;
  border-radius: 50%;
  border: none;
}

.slider::-moz-range-track {
  height: 8px;
  background: #ddd;
  border-radius: 4px;
}

/* IE (se ti serve compatibilità legacy) */
.slider::-ms-thumb {
  height: 20px;
  width: 20px;
  background: #4CAF50;
  border: none;
}

.slider::-ms-track {
  height: 8px;
  background: transparent;
  border-color: transparent;
  color: transparent;
}

.question-anchor {
    position: relative;
    top: 0px; /* Offset per non essere troppo attaccato al bordo */
    visibility: hidden;
    height: 0;
}

.cinquanta-percent {
    margin-bottom: 20px;
    width: 48%;
    display: grid;
}

.cinquanta-percent label {
   margin-bottom: 5px; 
   font-size: 14px;
}

.sinistra {
    float: left;
}

.destra {
    float: right;
}

.campo-privacy {
    display: grid;
    width: 100%;
	font-size: 12px !important;
}

.campo-privacy .checkbox-label  {
    border:none;
	padding: 5px;
}

.campo-privacy a, .campo-privacy .checkbox-text {
    font-size: 13px !important;
}

.overlay-invio-in-corso {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* font-family: Arial, sans-serif; */
}



.div-invio-in-corso {
    /* background: white; */
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    color: #ffffff;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); */
}



.invio-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}





.invio-in-corso {
    margin: 0 0 10px 0;
}


.non-chiudere {  
	margin: 0;  
	color: #f8f8f8;
}