/* === STILE ESERCIZI INTERATTIVI CALCOLO COMBINATORIO === */

/* --- 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: 20px;
    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;
}

.intro-text {
    background: #e7f3ff;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* --- BOX ESERCIZIO --- */
.interactive-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.interactive-box:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.interactive-box > p:first-child {
    font-size: 1.05rem;
    margin-top: 0;
}

/* --- STEP --- */
.step {
    display: none;
    margin-top: 15px;
    padding: 18px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step h3 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid #e3f2fd;
    padding-bottom: 8px;
}

/* --- BOTTONI SCELTA --- */
.btn-choice {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid #007bff;
    background: white;
    cursor: pointer;
    font-weight: bold;
    text-align: left;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    color: #333;
}

.btn-choice:hover {
    background: #007bff;
    color: white;
    transform: translateX(4px);
}

/* --- FEEDBACK --- */
.feedback {
    margin-top: 12px;
    font-weight: bold;
    font-size: 1rem;
    min-height: 24px;
}

.correct { color: #28a745; }
.wrong   { color: #dc3545; }

/* --- INPUT NUMERICO --- */
input[type="number"] {
    padding: 8px 10px;
    font-size: 1rem;
    width: 120px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    margin-right: 10px;
    transition: border-color 0.2s;
}

input[type="number"]:focus {
    border-color: #007bff;
    outline: none;
}

/* --- BOTTONE AVANTI / VERIFICA --- */
.next-btn {
    padding: 9px 20px;
    border: 2px solid #28a745;
    background: #28a745;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.next-btn:hover {
    background: white;
    color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- FOOTER --- */
.footer-container {
    margin-top: 30px;
    width: 100%;
    text-align: center;
    border-top: 3px solid #4a9edd;
    padding-top: 20px;
}

.footer-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

button.btn-footer, a.btn-footer {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

button.btn-footer:hover, a.btn-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-theory  { 
    background-color: #007bff; 
    color: white; 
    border-color: #007bff; 
}

.btn-theory:hover  { 
    background-color: white; 
    color: #007bff; 
    border-color: #007bff;
}

.btn-index   { 
    background-color: #800020; 
    color: white; 
    border-color: #800020; 
}

.btn-index:hover   { 
    background-color: white; 
    color: #800020; 
    border-color: #800020;
}

.btn-print   { 
    background-color: #6f42c1; 
    color: white; 
    border-color: #6f42c1; 
}

.btn-print:hover   { 
    background-color: white; 
    color: #6f42c1; 
    border-color: #6f42c1;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .main-test-wrapper { padding: 15px; }
    body { padding: 5px; }
    h1 { font-size: 1.4rem; }
    .btn-choice { font-size: 0.9rem; padding: 9px 12px; }
    .header-box img { max-height: 30px; }
}

/* --- STAMPA --- */
@media print {
    body { background: white !important; }
    .main-test-wrapper { box-shadow: none !important; }
    .footer-container { display: none !important; }
    .step { display: block !important; box-shadow: none !important; }
    .btn-choice, .next-btn { display: none !important; }
    .interactive-box { border: 1px solid #ccc !important; background: white !important; }
}

/* Bottone riepilogo (Verde scuro) */
.btn-summary { background-color: #28a745; color: white; border-color: #28a745; }
.btn-summary:hover { background-color: white; color: #28a745; border-color: #28a745; }
/* Bottone Teoria DSA */
.btn-dsa {
    background-color: #ff9800;
    color: white;
    border-color: #ff9800;
}

/* Hover invertito */
.btn-dsa:hover {
    background-color: white !important;
    color: #ff9800 !important;
    border-color: #ff9800 !important;
}
