/* === STILE TEST 10 QUESITI ESAME === */

/* --- VARIABILI --- */
:root {
    --primary-color: #0056b3;
    --secondary-color: #28a745;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-radius: 12px;
}

/* --- BASE --- */
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 {
    background-color: var(--card-bg);
    max-width: 1000px;
    width: 100%;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* --- HEADER --- */
.header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding: 10px 0;
    margin-bottom: 10px;
    background-color: white;
}

.header-box img {
    max-height: 40px;
    width: auto;
}

/* --- TITOLO --- */
h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
}

/* --- TESTO ISTRUZIONI --- */
.instruction-text {
    background: #e7f3ff;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* --- DOMANDE --- */
.question {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question h2 {
    color: var(--secondary-color);
    margin-top: 0;
}

/* --- ETICHETTE RISPOSTA --- */
label {
    display: block;
    background: #f8f9fa;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s;
}

label:hover { background: #e9ecef; }

input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* --- SPIEGAZIONE & AIUTO (CONTENUTI) --- */
.steps {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #fff9db;
    border-left: 4px solid #fcc419;
    border-radius: 4px;
    font-size: 0.9rem;
}

.hint {
    display: none;
    margin-top: 10px;
    padding: 12px;
    background: #e7f1ff;
    border-left: 4px solid #74c0fc;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* --- CONTROLLI (BOTTONI) --- */
.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* ============================================================ */
/* SEZIONE BOTTONI (SPIEGAZIONE E AIUTO) */
/* ============================================================ */

/* --- 1. BOTTONE SPIEGAZIONE (Arancione -> Giallino) --- */

/* Stato Base: Arancione deciso (per non confondersi con le opzioni grigie) */
.controls button:not(.btn-aiuto), 
.btn-secondary {
    background-color: #fd7e14 !important; 
    color: white !important;
    border: 1px solid #d96b0f !important;
    transition: all 0.2s ease;
}

/* Hover quando è chiuso: Arancione più scuro */
.controls button:not(.btn-aiuto):hover, 
.btn-secondary:hover {
    background-color: #e67000 !important;
    color: white !important;
    border-color: #c45a00 !important;
}

/* Stato Aperto (is-active): Giallino a linguetta (si fonde col box) */
.controls button:not(.btn-aiuto).is-active,
.btn-secondary.is-active {
    background-color: #fff9db !important; /* Giallo box .steps */
    color: #856404 !important;
    border: 1px solid #fcc419 !important;
    border-bottom: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding-bottom: 11px !important;
}

/* Hover quando aperto: Giallo più intenso */
.controls button:not(.btn-aiuto).is-active:hover,
.btn-secondary.is-active:hover {
    background-color: #ffe8a1 !important;
    color: #856404 !important;
}


/* --- 2. BOTTONE AIUTO (Blu -> Azzurrino) --- */

/* Stato Base: Blu professionale */
.controls .btn-aiuto {
    background-color: #007bff !important; /* Blu vivace */
    color: #ffffff !important;            /* Testo bianco per contrasto */
    border: 1px solid #0056b3 !important;
    transition: all 0.2s ease;
}

/* Hover quando è chiuso: Blu più scuro */
.controls .btn-aiuto:hover {
    background-color: #0056b3 !important;
    color: #ffffff !important;
}

/* Stato Aperto (is-active): Azzurrino a linguetta */
/* Questo rimane identico per fondersi con il box .hint */
.controls .btn-aiuto.is-active {
    background-color: #e7f1ff !important; 
    color: #084298 !important;            
    border: 1px solid #74c0fc !important; 
    border-bottom: none !important;       
    border-radius: 8px 8px 0 0 !important;
    padding-bottom: 11px !important;
}

/* Hover quando è aperto */
.controls .btn-aiuto.is-active:hover {
    background-color: #d0ebff !important;
}
/* --- FOOTER & AZIONI FINALI --- */
.footer-container {
    padding: 30px 20px;
    border-top: 3px solid #4CAF50;
    background-color: #f9f9f9;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.flex-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-verify  { background-color: #28a745; color: white; }
.btn-verify:hover  { background-color: #1e7e34; }

.btn-reset   { background-color: #333333; color: white; }
.btn-reset:hover   { background-color: #1a1a1a; }

.btn-print   { background-color: #6f42c1; color: white; }
.btn-print:hover   { background-color: #5a32a3; }
.btn-dsa-version { background-color: #fd7e14 !important; color: white !important; }
.btn-dsa-version:hover { background-color: #e67e00 !important; }

.btn-index { background-color: #800020 !important; color: white !important; }
.btn-index:hover { background-color: #600018 !important; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .controls button { width: 100%; }
}

/* --- STAMPA --- */
@media print {
    button, .footer-container, input[type="radio"] { display: none !important; }
    .steps { display: block !important; visibility: visible !important; background: #fffef5 !important; }
}

/* TABELLE */
table, th, td { border: 1px solid black; border-collapse: collapse; }
/* --- BOTTONI FOOTER (Ripristino colori originali) --- */

/* Stile per il testo del quesito (il paragrafo subito dopo il titolo) */
/* Stile per il testo del quesito (il paragrafo subito dopo il titolo) */
/* Il nuovo contenitore unico per il testo della domanda */
.question-body {
    background-color: #f0f7ff;
    border: 1px solid #d0e3ff;
    border-left: 3px solid #007bff;
    padding: 15px 20px;
    border-radius: 4px 8px 8px 4px;
    margin: 15px 0 25px 0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.02);
}

/* Rimuoviamo i margini eccessivi dei paragrafi interni al box per non creare buchi */
/* Rimuoviamo il grassetto dai paragrafi interni al box della domanda */
.question-body p {
    margin: 10px 0;
    font-size: 1.1rem;
    font-weight: normal; /* Questo toglie il grassetto */
    line-height: 1.6;
    color: #2c3e50;
}

/* Facciamo lo stesso per gli elenchi, se presenti */
.question-body ol, .question-body ul {
    margin: 10px 0 10px 25px;
    font-weight: normal; /* Toglie il grassetto anche dagli elenchi */
    color: #2c3e50;
}
/* --- PROGRESS BAR --- */
.progress-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

/* cerchietto base */
.progress-item {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;

    background: #e9ecef;
    color: #333;
    border: 2px solid #ced4da;

    transition: all 0.25s ease;
    cursor: default;
}

/* 🟡 risposta selezionata (intermedio) */
.progress-item.answered {
    background: #ffc107;
    border-color: #e0a800;
    color: #333;
}

/* ✅ risposta corretta */
.progress-item.correct {
    background: #28a745 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

/* ❌ risposta sbagliata */
.progress-item.wrong {
    background: #dc3545 !important;
    border-color: #bd2130 !important;
    color: white !important;
}

/* effetto hover leggero */
.progress-item:hover {
    transform: scale(1.08);
}

/* Simboli dentro il cerchietto (come nella DSA) */
.progress-item.correct::after { content: ' ✓'; font-size: 0.7em; }
.progress-item.wrong::after   { content: ' ✗'; font-size: 0.7em; }
#timer-container {
    position: fixed;
    top: 15px;
    right: 15px;
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid #555;
    transition: all 0.3s ease;
}

/* ALERT ultimi 5 minuti */
.timer-warning {
    background-color: #d9534f !important;
    border-color: #c9302c !important;
    animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media print {
    #timer-container { display: none !important; }
}

@media (max-width: 768px) {
    #timer-container {
        position: sticky;
        top: 10px;
        margin: 10px auto;
        display: table;
        font-size: 0.9rem;
        z-index: 9999;
    }
}