/* style.css - RESTORED PREMIUM DESIGN */
:root {
    --isaca-blue: #004a99;
    --accent: #3498db;
    --correct: #28a745;
    --error: #dc3545;
    --bg: #f4f7f9;
    --card-bg: #ffffff;
    --text: #333333;
    --pro-gold: #ffcc00;
    --card-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Ombra originale index_old */
}

/* Variabili Dark Mode */
body.dark-mode {
    --bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --isaca-blue: #3498db;
    --card-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    margin: 0; padding: 0;
    background-color: var(--bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Ripristino centratura precisa di index_old */
.container { 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 20px; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
}

header { 
    text-align: center; 
    padding: 20px 0; 
    position: relative; 
}

.logo { 
    font-size: 1.8rem; 
    font-weight: 900; 
    color: var(--isaca-blue); 
    letter-spacing: -1px; 
}

.logo span { 
    color: var(--pro-gold); 
    font-size: 0.9rem; 
    vertical-align: top; 
    margin-left: 5px; 
}

/* Estetica Sezioni di index_old */
section { 
    display: none; 
    background: var(--card-bg); 
    padding: 25px; 
    border-radius: 20px; 
    box-shadow: var(--card-shadow); 
}

section.active { 
    display: block !important; 
    animation: slideIn 0.3s ease-out; 
}

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

/* Dashboard Stats */
.stats-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-bottom: 25px; 
}

.stat-card { 
    background: var(--bg); 
    padding: 15px; 
    border-radius: 15px; 
    text-align: center; 
    border: 1px solid rgba(0,0,0,0.05); 
    transition: border 0.3s;
}

body.dark-mode .stat-card {
    border-color: #333;
}

.stat-card h4 { 
    margin: 0; 
    font-size: 0.8rem; 
    color: #666; 
    text-transform: uppercase; 
}

.stat-card p { 
    margin: 5px 0 0; 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--isaca-blue); 
}

/* Bottoni Opzioni (Il cuore del design piacevole) */
.option-btn { 
    width: 100%; 
    padding: 18px; 
    margin-bottom: 12px; 
    border: 2px solid rgba(0,0,0,0.05); 
    border-radius: 12px; 
    text-align: left; 
    cursor: pointer; 
    transition: all 0.2s ease-in-out; 
    background: var(--card-bg); 
    font-size: 1.1rem; 
    line-height: 1.4; 
    color: var(--text); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

.option-btn:hover { 
    border-color: var(--accent); 
    background-color: rgba(52, 152, 219, 0.1); 
    transform: translateX(5px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

/* Colori corretti/errati con override */
.option-btn.correct { 
    background-color: var(--correct) !important; 
    color: white !important; 
    border-color: #1e7e34 !important; 
}

.option-btn.error { 
    background-color: var(--error) !important; 
    color: white !important; 
    border-color: #bd2130 !important; 
}

/* Menu Dropdown Fix */
#question-count { 
    width: 100%; 
    padding: 15px; 
    border-radius: 12px; 
    border: 2px solid var(--isaca-blue); 
    margin-bottom: 20px; 
    font-size: 16px; 
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23004a99' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

/* Footer & Utils */
footer { 
    text-align: center; 
    margin-top: auto; 
    padding: 30px 0; 
    color: #999; 
    font-size: 0.8rem; 
}

.btn-main { 
    width: 100%; 
    padding: 16px; 
    background: var(--isaca-blue); 
    color: white; 
    border: none; 
    border-radius: 12px; 
    font-size: 1rem; 
    font-weight: bold; 
    cursor: pointer; 
    margin-bottom: 12px; 
    transition: transform 0.2s; 
}
/* Progress Bar Styling */
#progress-container {
    background: rgba(0, 0, 0, 0.1) !important;
}

body.dark-mode #progress-container {
    background: rgba(255, 255, 255, 0.1) !important;
}

#progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--isaca-blue)) !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.btn-reset {
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-reset:hover {
    opacity: 1;
    background-color: rgba(220, 53, 69, 0.1) !important;
}

body.dark-mode .btn-reset {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

.btn-danger {
    width: 100%;
    padding: 12px;
    background-color: var(--error); /* Usa il rosso che hai già definito */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Stop Test */
.btn-exit {
    background-color: #fceaea; /* Sfondo rosso chiarissimo */
    color: #e74c3c;            /* Testo rosso */
    border: 1px solid #e74c3c;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-exit:hover {
    background-color: #e74c3c;
    color: white;
}

/* Badge Timer */
#timer-badge {
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
}

body.dark-mode #timer-badge {
    background: var(--accent);
}

/* History reset (Red) */
.btn-danger {
    width: 100%;
    padding: 15px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.2);
}

.btn-abort-pill {
    background-color: var(--error); /* Rosso pieno */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px; /* Effetto pillola */
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    transition: transform 0.1s, background-color 0.2s;
}

.btn-abort-pill:active {
    transform: scale(0.95); /* Effetto pressione */
    background-color: #b91d1d; /* Rosso più scuro al click */
}

/* Stile per il tasto Reset nella pagina Analytics (rosso pieno come richiesto) */
.btn-danger-full {
    background-color: var(--error);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    font-weight: bold;
    margin-top: 20px;
    cursor: pointer;
}

.btn-danger-full {
    background-color: #dc3545 !important; /* Rosso ISACA/Error */
    color: white !important;
    border: none;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
    text-transform: uppercase;
}

@keyframes progress-glow {
    0% { box-shadow: 0 0 0px var(--accent); }
    50% { box-shadow: 0 0 15px var(--accent); opacity: 0.8; }
    100% { box-shadow: 0 0 0px var(--accent); }
}
.progress-active {
    animation: progress-glow 0.4s ease;
}

#report-content {
    max-height: 70vh; /* Altezza massima 70% della finestra */
    overflow-y: auto; /* Attiva lo scroll interno */
    padding-right: 10px;
}

.review-list {
    max-height: 65vh;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 10px;
}

#analytics-level-banner div {
    background: var(--isaca-blue);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

/* Contenitore per i grafici negli Analytics */
.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 400px; /* Dimensione perfetta per non farlo sformare */
    margin: 0 auto 20px auto;
    display: block;
}

/* Banner del Livello negli Analytics */
.analytics-badge {
    text-align: center;
    margin: 10px auto 25px auto;
    width: 100%;
}

.rank-title { font-size: 0.7rem; text-transform: uppercase; opacity: 0.8; margin: 0; }
.rank-value { font-size: 1.4rem; font-weight: 800; margin: 0; } /* Ridotto drasticamente */

@media (max-width: 480px) {
    .chart-wrapper { height: 220px; } /* Ancora più piccolo su piccoli schermi */
    .rank-value { font-size: 1.2rem; }
}

.btn-main:active { transform: scale(0.98); }



.chart-wrapper {
    position: relative;
    height: 300px; 
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    /* Niente bordi rossi qui! */
}


#performanceChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

#ai-advice {
    margin-top: 15px;
    padding: 12px;
    background: #fff8e1;
    border-radius: 10px;
    border-left: 5px solid #ffc107;
    font-size: 0.85rem;
    color: #333;
}
/* ============================================================
   NUOVI STILI v3 — Back header, Segnalibri, Studio, Streak
   ============================================================ */

/* --- Section header (Back + Title) --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

body.dark-mode .section-header {
    border-bottom-color: rgba(255,255,255,0.08);
}

.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    flex: 1;
}

/* --- Bottone Back elegante --- */
.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px 6px 4px;
    border-radius: 8px;
    transition: background 0.15s;
    min-width: 64px;
}

.btn-back:hover, .btn-back:active {
    background: rgba(52, 152, 219, 0.1);
}

.btn-back svg {
    flex-shrink: 0;
}

/* --- Hint swipe --- */
.swipe-hint {
    text-align: center;
    font-size: 0.72rem;
    color: #bbb;
    margin: -12px 0 16px 0;
    letter-spacing: 0.3px;
}

body.dark-mode .swipe-hint { color: #555; }

/* --- Bottone Segnalibro nel quiz --- */
.btn-bookmark {
    background: none;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #aaa;
}

.btn-bookmark:active { transform: scale(0.9); }

.btn-bookmark.bookmarked {
    color: #f4a61d;
    border-color: #f4a61d;
    background: rgba(244, 166, 29, 0.08);
}

body.dark-mode .btn-bookmark {
    border-color: rgba(255,255,255,0.15);
}

/* --- Cards segnalibri --- */
.bookmark-card {
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body.dark-mode .bookmark-card {
    border-color: rgba(255,255,255,0.08);
}

.bookmark-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.bookmark-remove-btn:hover {
    color: var(--error);
    background: rgba(220, 53, 69, 0.08);
}

/* --- Bottone Studio Mode --- */
.btn-study {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
}

/* --- Spiegazione inline (Studio Mode) --- */
.study-explanation-box {
    background: #fffbea;
    border: 1px dashed #f4c24a;
    border-left: 4px solid #f4c24a;
    border-radius: 10px;
    padding: 14px;
    font-size: 0.9rem;
    color: #444;
    margin-top: 16px;
    line-height: 1.5;
}

body.dark-mode .study-explanation-box {
    background: rgba(244, 194, 74, 0.08);
    color: #ddd;
    border-color: rgba(244, 194, 74, 0.4);
}

/* --- Stats grid 2x2 per includere Streak e Bookmarks --- */
.stats-grid {
    grid-template-columns: 1fr 1fr !important;
}

/* --- Select styled (uguale a question-count) --- */
.select-styled {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--isaca-blue);
    margin-bottom: 20px;
    font-size: 16px;
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23004a99' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

/* ============================================================
   PAYWALL & PREMIUM STYLES
   ============================================================ */

/* --- Badge premium in home --- */
#premium-badge {
    display: block;
    text-align: center;
    margin: 0 0 18px 0;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    background: rgba(0,0,0,0.04);
    color: #888;
    border: 1.5px dashed #ddd;
    transition: all 0.2s;
}

#premium-badge.active {
    background: linear-gradient(135deg, #f4c24a22, #f4a61d22);
    color: #c88a00;
    border: 1.5px solid #f4c24a;
    cursor: default;
}

body.dark-mode #premium-badge {
    background: rgba(255,255,255,0.04);
    border-color: #444;
    color: #666;
}

body.dark-mode #premium-badge.active {
    background: rgba(244,162,29,0.12);
    border-color: rgba(244,162,29,0.5);
    color: #f4c24a;
}

/* --- Modale paywall --- */
#paywall-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#paywall-modal.visible {
    display: flex;
    opacity: 1;
}

.paywall-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
}

.paywall-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    padding: 32px 24px 40px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    z-index: 1;
}

#paywall-modal.visible .paywall-card {
    transform: translateY(0);
}

.paywall-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.paywall-close:hover { background: rgba(0,0,0,0.12); }

.paywall-header {
    text-align: center;
    margin-bottom: 24px;
}

.paywall-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.paywall-title {
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.paywall-subtitle {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.paywall-features li {
    padding: 9px 0;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.paywall-features li:last-child { border-bottom: none; }

body.dark-mode .paywall-features li {
    border-bottom-color: rgba(255,255,255,0.05);
}

.paywall-price {
    text-align: center;
    margin-bottom: 20px;
}

.paywall-amount {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--isaca-blue);
    display: block;
}

.paywall-period {
    font-size: 0.8rem;
    color: #888;
}

.paywall-buy-btn {
    width: 100%;
    padding: 18px;
    background: var(--isaca-blue);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 12px;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 16px rgba(0, 74, 153, 0.3);
}

.paywall-buy-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.paywall-restore-btn {
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 12px;
}

.paywall-legal {
    font-size: 0.72rem;
    color: #aaa;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* --- Loading overlay --- */
#paywall-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.paywall-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Toast notifica --- */
.paywall-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.paywall-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   PAYWALL — Tab switcher + Promo Code UI
   ============================================================ */

.paywall-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    padding: 4px;
}

body.dark-mode .paywall-tabs {
    background: rgba(255,255,255,0.06);
}

.paywall-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 9px;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.paywall-tab.active {
    background: var(--card-bg);
    color: var(--isaca-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body.dark-mode .paywall-tab.active {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
}

.paywall-panel {
    animation: fadeIn 0.2s ease;
}

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

/* --- Sezione codice promo --- */
.promo-code-section {
    padding: 8px 0;
}

.promo-code-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.5;
}

body.dark-mode .promo-code-desc { color: #aaa; }

.promo-code-input {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    color: var(--text);
    background: var(--bg);
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    text-transform: uppercase;
}

.promo-code-input:focus {
    outline: none;
    border-color: var(--isaca-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

body.dark-mode .promo-code-input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: #eee;
}

body.dark-mode .promo-code-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.promo-code-input::placeholder {
    color: #bbb;
    letter-spacing: 1px;
    font-weight: 400;
}

.promo-code-note {
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
    margin: 14px 0 0 0;
    line-height: 1.6;
}

/* ============================================================
   Help / Info Modal
   ============================================================ */

#help-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#help-modal.visible {
    display: flex;
    opacity: 1;
}

.help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
}

.help-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    padding: 32px 24px 40px;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    z-index: 1;
}

#help-modal.visible .help-card {
    transform: translateY(0);
}

.help-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.help-close:hover { background: rgba(0,0,0,0.12); }

.help-title {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px 0;
    color: var(--text);
}

.help-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 24px 0;
}

.help-section {
    margin-bottom: 22px;
}

.help-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent);
    margin: 0 0 10px 0;
}

.help-section p,
.help-section li {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text);
    margin: 0 0 6px 0;
}

.help-section ul {
    margin: 0;
    padding-left: 18px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 4px;
}

.help-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 700;
    background: rgba(0,0,0,0.04);
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.help-table td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: var(--text);
    vertical-align: top;
}

.help-table tr:last-child td { border-bottom: none; }

.help-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 20px 0;
}

.help-disclaimer-box {
    background: rgba(220, 53, 69, 0.07);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text);
}

body.dark-mode .help-table th {
    background: rgba(255,255,255,0.05);
}
body.dark-mode .help-disclaimer-box {
    background: rgba(220, 53, 69, 0.12);
}

/* --- Bottone Exam Mode --- */
.btn-exam-mode {
    background: linear-gradient(135deg, #e67e22, #f39c12) !important;
}

/* --- Bottone Weak Spot Mode --- */
.btn-weakspot {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

/* --- Exam review grid: celle disabilitate (domande 31-90 nell'esame reale) --- */
.exam-cell-locked {
    background: rgba(0,0,0,0.04) !important;
    color: #ccc !important;
    border: 1px solid #e0e0e0 !important;
    cursor: default !important;
    pointer-events: none;
    font-size: 0.7rem !important;
}
body.dark-mode .exam-cell-locked {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #444 !important;
}
