* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== PAGINA DI BENVENUTO ===== */
.welcome-page {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 60px 50px;
    max-width: 650px;
    width: 100%;
    animation: fadeInScale 0.6s ease-out;
}

.welcome-page.hidden {
    display: none;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.company-logo {
    text-align: center;
    margin-bottom: 35px;
}

.truck-icon {
    font-size: 70px;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.company-name {
    color: #1e3c72;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.welcome-title {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
}

.instructions {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 35px;
}

.instruction-text {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.instruction-list {
    margin: 25px 0;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.instruction-icon {
    background: #1e3c72;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.instruction-footer {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin-top: 20px;
    text-align: center;
}

.start-quiz-btn {
    width: 100%;
    padding: 18px 32px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

.start-quiz-btn:hover {
    background: #2a5298;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.4);
}

.start-quiz-btn:active {
    transform: translateY(-1px);
}

/* ===== CONTAINER QUESTIONARIO ===== */
.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 50px 60px;
    max-width: 700px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out;
}

.container.hidden {
    display: none;
}

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

/* Progress Indicators - MAGGIORE DISTANZA DAL TITOLO */
.progress-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 45px;
    gap: 8px;
    flex-wrap: wrap;
}

.circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 2px solid #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.circle:hover {
    transform: scale(1.1);
    border-color: #1e3c72;
}

.circle.active {
    transform: scale(1.25);
    border-color: #1e3c72;
    background: #1e3c72;
    color: white;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.4);
}

/* SFONDO GRIGIO + BORDO GRIGIO SCURO */
.circle.completed {
    background: #f5f5f5;
    border-color: #888;
    color: #555;
}

.circle.error {
    border-color: #dc3545;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-5px) scale(1); }
    75% { transform: translateX(5px) scale(1); }
}

/* Error Banner */
.error-banner {
    display: none;
    background: #fff5f5;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 25px;
    color: #dc3545;
    font-weight: 500;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s ease-out;
}

.error-banner.show {
    display: flex;
}

.error-icon {
    font-size: 22px;
}

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

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.form-step.active {
    display: block;
}

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

h2 {
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafafa;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1e3c72;
    background: white;
}

input.error,
textarea.error {
    border-color: #dc3545;
    background: #fff5f5;
}

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

/* Animazione staggered per opzioni multiple - slide da destra */
.options-list {
    display: flex;
    flex-direction: column;
}

.form-step.active .radio-label,
.form-step.active .checkbox-label {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(0.08s * var(--i));
    opacity: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Radio e Checkbox personalizzati */
.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    font-weight: 400;
}

.radio-label:hover,
.checkbox-label:hover {
    border-color: #1e3c72;
    background: white;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

button {
    flex: 1;
    padding: 16px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

#prevBtn {
    background: #f5f5f5;
    color: #555;
}

#prevBtn:hover:not(:disabled) {
    background: #e0e0e0;
    transform: translateY(-2px);
}

#prevBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#nextBtn,
#submitBtn {
    background: #1e3c72;
    color: white;
}

#nextBtn:hover,
#submitBtn:hover {
    background: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 60, 114, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .welcome-page {
        padding: 40px 30px;
    }
    
    .company-name {
        font-size: 26px;
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .container {
        padding: 30px 25px;
    }
    
    .circle {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .circle.active {
        transform: scale(1.2);
    }
    
    h2 {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .truck-icon {
        font-size: 55px;
    }
    
    .company-name {
        font-size: 22px;
    }
    
    .instruction-text {
        font-size: 14px;
    }
    
    .instruction-item {
        font-size: 14px;
    }
    
    .progress-indicators {
        gap: 6px;
    }
    
    .circle {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
}
