/* ============================================================
   stile-questionario-calcolo-probabilita-dsa.css
   Base identica a stile-questionario-calcolo-probabilita-standard.css
   (stesso header v3, breadcrumb, main-menu, footer, accordion
   .point-block/.solution-button/.solution-container/.hint),
   con un layer di override DSA in fondo al file: sfondo crema,
   Verdana, interlinea/spaziatura aumentate, bottoni più grandi,
   bottone "Ascolta" per la sintesi vocale.
   ============================================================ */

:root {
    --green: #009966;
    --green-dk: #009966;
    --green-title: #009966;
    --border-green: #009900;
    --green-lt: #f0fdf4;
    --border: #dbe4dc;
    --text: #2c3e50;
    --muted: #666;
    --bg: #f8f9fa;
    --radius: 8px;
    --container: 1000px;
}
* { box-sizing: border-box; }
html { overflow-y: scroll; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 10px;
    background-color: var(--bg);
    color: var(--text);
}

/* ---------- Header ---------- */
.page-wrap {
    max-width: var(--container);
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 20px;
}
.header-box {
    width: 100%;
    border: 2px dashed var(--border-green);
    box-sizing: border-box;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 15px;
    cursor: pointer;
    gap: 15px;
}
.header-box .brand-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-box .brand-left img { height: 50px; width: auto; }
.header-box .brand-left .site-url {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
}
.header-box .brand-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.header-box .brand-right .logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.header-box .brand-right img { height: 50px; width: auto; }
.header-box .brand-right .since {
    font-size: 0.78rem;
    color: #999;
    font-style: italic;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 20px;
}
.breadcrumb a { color: var(--green-dk); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Nav principale ---------- */
.main-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 0 25px;
    padding: 5px;
    border: 1px solid var(--border-green);
    border-radius: 8px;
    background: #f4f7f5;
}
.main-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.main-menu a:hover { background: var(--green); color: white; }
.main-menu a.current { background: var(--green); color: white; }
.main-menu a.current:hover { background: var(--green); }

.main-page-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin: 6px 0 8px;
    color: var(--green-title);
}
.page-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.page-intro {
    background-color: var(--green-lt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

/* ---------- Footer ---------- */
footer {
    margin-top: 16px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
    text-align: center;
    font-size: 0.88rem;
    color: #555;
}
.license-box {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.8rem;
    color: #777;
}
.validation-link {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #999;
}
.validation-link a { color: #999; text-decoration: none; }
.validation-link a:hover { text-decoration: underline; }
footer p { margin: 0; }

/* ---------- Punti a/b/c ---------- */
.point-block { margin-bottom: 28px; }
.point-block h2 {
    color: var(--green-dk);
    font-size: 1.1rem;
    padding-bottom: 6px;
}

.fade-green {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--green), transparent);
    margin: 15px 0;
}

/* Bottone "Soluzione Quesito N" */
.solution-button {
    background-color: white;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 8px 4px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: 600;
}
.solution-button:hover {
    background-color: #2e7d32;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46,125,50,0.3);
}

.solution-container { display: none; }
.solution {
    background-color: #f8f9fa;
    padding: 15px 15px 15px 25px;
    margin: 15px 0 15px 8px;
    border-left: 4px solid #0000FF;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}
.solution h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}
.solution .conclusion {
    background: var(--green-lt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 14px;
    font-weight: 600;
}

.graph {
    text-align: center;
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    max-width: 420px;
}
.graph img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}
.graph .graph-caption {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 8px;
}

.btn-nascondi-top {
    background-color: white;
    color: #e65100;
    border: 2px solid #e65100;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: none;
    font-size: 14px;
    margin: 8px 4px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: 600;
}
.btn-nascondi-top:hover {
    background-color: #e65100;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(230,81,0,0.3);
}

.btn-nascondi-wrap { text-align: center; }
.btn-nascondi {
    background-color: white;
    color: #e65100;
    border: 2px solid #e65100;
    padding: 10px 25px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    margin: 10px auto;
    transition: all 0.3s ease;
}
.btn-nascondi:hover {
    background-color: #e65100;
    color: white;
    box-shadow: 0 4px 8px rgba(230,81,0,0.3);
    transform: translateY(-2px);
}

.bottom-links-row {
    text-align: center;
    padding-top: 16px;
    border-top: 2px solid #ddd;
    margin-top: 10px;
    font-size: 0.92rem;
}
.bottom-links-row a { text-decoration: none; font-weight: 600; margin: 0 6px; }
.bottom-links-row .pdf-bottom { color: #e03030; }

/* ---- Bottone torna su ---- */
#btn-top {
    position: fixed;
    bottom: 20px;
    right: 4px;
    background: #9C27B0;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background 0.2s;
}
#btn-top:hover { background: #7a00cc; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

@media print {
    .footer-buttons-row, .bottom-links-row,
    #btn-top, .main-menu, footer, .solution-button, .btn-nascondi {
        display: none !important;
    }
    .solution-container { display: block !important; }
}

@media (min-width: 768px) {
    body { padding: 30px 20px; }
    .page-wrap { padding: 30px; }
    .main-page-title { font-size: 2.2rem; }
}

/* ---------- Box progresso ---------- */
#progress-box {
    position: fixed;
    top: 15px;
    right: 15px;
    background: var(--green-lt);
    border-left: 6px solid var(--green);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    white-space: nowrap;
    color: var(--text);
}
#progress-count { font-weight: 700; color: var(--green-dk); }
.progress-container {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 8px;
    margin: 8px 0 0 0;
    overflow: hidden;
}
#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--green);
    transition: width 0.4s ease;
}
#hint-count { font-weight: 700; color: #0056b3; }
@media print { #progress-box { display: none !important; } }
@media (max-width: 600px) {
    #progress-box {
        font-size: 0.78em;
        padding: 6px 10px;
        top: 6px;
        right: 6px;
        max-width: 150px;
    }
}

/* ---------- Bottone aiuto e box suggerimento ---------- */
.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 4px;
}
button.btn-aiuto {
    background-color: white !important;
    color: #0056b3 !important;
    border: 2px solid #0056b3 !important;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
button.btn-aiuto:hover {
    background-color: #0056b3 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,86,179,0.3);
}
button.btn-aiuto.is-active {
    background-color: #e7f1ff !important;
    color: #084298 !important;
    border-color: #74c0fc !important;
}
.hint {
    display: none;
    margin: 10px 0;
    padding: 15px;
    background-color: #e7f1ff;
    border-left: 5px solid #74c0fc;
    border-radius: 0 8px 8px 0;
    color: #084298;
    font-size: 0.95em;
    line-height: 1.6;
}
.hint strong {
    display: block;
    margin-bottom: 5px;
    color: #0056b3;
}
@media print { .controls, .hint, #progress-box { display: none !important; } }

/* ---------- Bottoni footer ---------- */
.footer-buttons-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0 20px;
}
.btn-footer-teoria, .btn-footer-arancio, .btn-footer-viola, .btn-footer-verde {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 190px;
    max-width: 44vw;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 8px;
    background: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85em;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 3px 7px rgba(0,0,0,0.1);
    box-sizing: border-box;
    cursor: pointer;
}
.btn-footer-teoria  { color: #5c6bc0; border: 2px solid #5c6bc0; }
.btn-footer-arancio { color: #ff9800; border: 2px solid #ff9800; }
.btn-footer-viola   { color: #9c27b0; border: 2px solid #9c27b0; }
.btn-footer-verde   { color: #2e7d32; border: 2px solid #2e7d32; }
.btn-footer-teoria:hover  { background: #5c6bc0; color: white; transform: translateY(-2px); }
.btn-footer-arancio:hover { background: #ff9800; color: white; transform: translateY(-2px); }
.btn-footer-viola:hover   { background: #9c27b0; color: white; transform: translateY(-2px); }
.btn-footer-verde:hover   { background: #2e7d32; color: white; transform: translateY(-2px); }

@media (max-width: 480px) {
    .btn-footer-teoria, .btn-footer-arancio, .btn-footer-viola, .btn-footer-verde { max-width: 92vw; }
}
@media print { .footer-buttons-row { display: none !important; } }

/* ---------- Box testo del quesito ---------- */
.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);
}
.question-body p {
    margin: 10px 0;
    font-size: 1.05rem;
    font-weight: normal;
    line-height: 1.6;
    color: #2c3e50;
}
.question-body p:first-child { margin-top: 0; }
.question-body p:last-child { margin-bottom: 0; }


/* ============================================================
   ================   LAYER DI OVERRIDE DSA   ===================
   (da qui in poi: solo aggiunte/override rispetto al CSS
   standard qui sopra — leggibilità aumentata, sfondo crema,
   bottoni più grandi, bottone "Ascolta")
   ============================================================ */

:root {
    --bg-dsa: #fdf6e3;      /* sfondo crema/paglierino, come nei test DSA del sito */
    --text-dsa: #202124;
    --green-dsa: #1a6b35;
}

body {
    font-family: 'Verdana', 'Geneva', sans-serif;
    background-color: var(--bg-dsa);
    color: var(--text-dsa);
    line-height: 1.8;
    letter-spacing: 0.05em;
    padding: 10px;
}

.page-wrap {
    background-color: #ffffff;
    max-width: 1000px;
    width: 100%;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin: 20px auto 0;
    box-sizing: border-box;
}

/* Header DSA: stesso impianto v3, verde DSA più scuro per contrasto,
   dimensioni allineate a stile-test1-probabilita-dsa.css */
.header-box {
    border-color: var(--green-dsa);
    border-width: 2.5px;
    padding: 12px 14px;
    border-radius: 10px;
    row-gap: 8px;
}
.header-box .brand-left .site-url,
.header-box .brand-right .since {
    font-size: 0.95rem;
}

.breadcrumb {
    font-size: 1rem;
    margin-bottom: 22px;
}
.breadcrumb a { color: var(--green-dsa); font-weight: 700; }

.main-menu {
    border-color: var(--green-dsa);
    border-width: 1.5px;
    margin-bottom: 28px;
}
.main-menu a {
    padding: 11px 20px;
    font-size: 1rem;
    font-weight: 700;
}
.main-menu a:hover, .main-menu a.current { background-color: var(--green-dsa); }

.main-page-title {
    font-size: 2rem;
    line-height: 1.4;
}
.main-page-title span {
    font-size: 0.55em;
}

.page-intro {
    font-size: 1rem;
    font-weight: 500;
}

/* Formule più grandi, come negli altri test DSA del sito */
.mjx-chtml, mjx-container {
    font-size: 1.12em !important;
}

/* Bottoni più grandi e touch-friendly */
.solution-button, .btn-nascondi-top, .btn-nascondi, button.btn-aiuto {
    padding: 14px 24px;
    font-size: 1rem;
}

.hint {
    font-size: 1.05rem;
    line-height: 1.8;
}

.question-body p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Bottone "Ascolta" (sintesi vocale) */
.btn-ascolta {
    background-color: #28a745;
    color: white;
    border: 2px solid #1e7e34;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-ascolta:hover {
    background-color: white;
    color: #1e7e34;
    transform: translateY(-2px);
}
.btn-ascolta.playing {
    background-color: #ffc107;
    color: #333;
    border-color: #e0a800;
}

@media print {
    .btn-ascolta { display: none !important; }
}

@media (max-width: 768px) {
    body { font-size: 17px; }
    .main-page-title { font-size: 1.6rem; }
    .solution-button, .btn-nascondi-top, .btn-nascondi, button.btn-aiuto, .btn-ascolta {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    .controls { flex-direction: column; }
}
