:root {
    --primary-color: #0056b3;
    --secondary-color: #28a745;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-test-wrapper {
	padding: 15px 20px; /* Leggera riduzione padding superiore */
    background-color: var(--card-bg);
    max-width: 800px;
    width: 100%;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Compatta l'header box */
.header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding: 10px 0; /* Padding ridotto */
    margin-bottom: 10px; /* Ridotto lo spazio verso il titolo */
    background-color: white;
}

.header-box img {
    max-height: 40px;
    width: auto;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
}

.instruction-text {
    background: #e7f3ff;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.question {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

/* Ottimizzazione per Mobile: bottoni e input pił grandi */
label {
    display: block;
    background: #f8f9fa;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

label:hover {
    background: #e9ecef;
}

input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.steps {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #fff9db;
    border-left: 4px solid #fcc419;
    border-radius: 4px;
    font-size: 0.9rem;
}

button {
    width: 100%; /* Sui cellulari i bottoni full-width sono pił comodi */
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
}

@media (min-width: 600px) {
    button { width: auto; padding: 10px 20px; }
}

#results {
    margin-top: 30px;
    padding: 20px;
    border-radius: var(--border-radius);
}
.question: transition: all 0.3s ease;
.question:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 86, 179, 0.2);
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background-color: #495057; /* Grigio pił scuro */
}

.btn-secondary:active {
    transform: scale(0.98); /* Effetto pressione al tocco sullo schermo */
}
/* Contenitore generale del footer */
.footer-container {
    margin: 5px 0; /* Ridotto drasticamente il margine (era 30px) */
    width: 100%;
}

.footer {
    display: flex;
    flex-direction: column; /* Dispone gli elementi (bottoni e poi link) in verticale */
    align-items: center;    /* Centra tutto orizzontalmente */
    justify-content: center;
    width: 100%;
    margin-top: 30px;
    gap: 15px;              /* Spazio tra i bottoni e il link di validazione */
}

.footer-buttons {
    display: flex;
    flex-wrap: wrap;       /* Permette ai bottoni di andare a capo su mobile */
    justify-content: center;
    gap: 10px;              /* Spazio tra un bottone e l'altro */
}

/* Bottone VERIFICA (Blu) */
.btn-verify {
    background-color: #0056b3;
    color: white;
    transition: all 0.3s ease;
}

.btn-verify:hover {
    background-color: #003d82;
}

.btn-verify:active {
    transform: translateY(0); /* Torna gił quando cliccato */
}

/* Bottone RICOMINCIA (Grigio) */
.btn-reset {
    background-color: #d9534f; /* Rosso meno acceso, pił professionale */
    color: white;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-reset:hover {
    background-color: #c9302c; /* Rosso pił intenso al passaggio del mouse */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-reset:active {
    transform: translateY(0);
}
/* Bottone DSA (Arancione) */
.btn-dsa-version {
    background-color: #ff8c00;
    color: white;
    transition: all 0.3s ease;
}

.btn-dsa-version:hover {
    background-color: #e67e00;
    transform: translateY(-2px);
}

/* Bottone Indice (Bordeaux) */
.btn-index {
    background-color: #800020;
    color: white;
    transition: all 0.3s ease;
}

.btn-index:hover {
    background-color: #600018;
    transform: translateY(-2px);
}

@media (min-width: 600px) {
    .footer {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }
}
/* Bottone INDICE (Bordeaux - Navigazione) */
.btn-index {
    background-color: #800020; /* Bordeaux */
    color: white;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-index:hover {
    background-color: #600018; /* Bordeaux pił scuro */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}