sabato 22 agosto 2026

Verifica empirica del Simulatore Economico-Monetario NOTAX

 🏛 Simulatore Economico-Monetario NOTAX
Confronta il modello attuale a tassazione con il sistema di emissione sovrana e audit IA.

MODELLO ATTUALE: 

MODELLO NOTAX:

 

CODICE SORGENTE html:

 <!DOCTYPE html>
<html lang="it">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simulatore NOTAX - Governatura Monetaria e Audit IA</title>
    <style>
        :root {
            --primary: #0052cc;
            --secondary: #0747a6;
            --success: #36b37e;
            --warning: #ffab00;
            --danger: #ff5630;
            --bg: #f4f5f7;
            --card-bg: #ffffff;
            --text: #172b4d;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 20px;
        }

        .container {
            max-width: 1050px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            margin-bottom: 25px;
        }

        header h1 {
            color: var(--primary);
            margin-bottom: 5px;
        }

        .mode-selector {
            background: #ebecf0;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 25px;
            text-align: center;
        }

        .mode-btn-group {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 10px;
        }

        .mode-btn {
            padding: 12px 24px;
            border-radius: 6px;
            border: 2px solid transparent;
            font-weight: bold;
            cursor: pointer;
            width: 45%;
            font-size: 1em;
            transition: all 0.3s ease;
        }

        .mode-btn.today { background-color: #42526e; color: white; }
        .mode-btn.notax { background-color: var(--primary); color: white; }
        .mode-btn.active-today { border-color: var(--danger); box-shadow: 0 0 10px rgba(255,86,48,0.4); }
        .mode-btn.active-notax { border-color: var(--success); box-shadow: 0 0 10px rgba(54,179,126,0.4); }

        .grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        @media (max-width: 768px) {
            .grid { grid-template-columns: 1fr; }
            .mode-btn-group { flex-direction: column; }
            .mode-btn { width: 100%; }
        }

        .card {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            margin-bottom: 20px;
        }

        .card h2 {
            margin-top: 0;
            font-size: 1.2em;
            border-bottom: 2px solid var(--bg);
            padding-bottom: 10px;
        }

        .form-group { margin-bottom: 15px; }

        label {
            display: block;
            font-weight: 600;
            margin-bottom: 5px;
            font-size: 0.9em;
        }

        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid #dfe1e6;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 1em;
        }

        button.action-btn {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            width: 100%;
            font-size: 1em;
        }

        .progress-bar-container {
            background-color: #dfe1e6;
            border-radius: 10px;
            height: 22px;
            width: 100%;
            overflow: hidden;
            margin-top: 8px;
        }

        .progress-bar {
            height: 100%;
            background-color: var(--success);
            width: 0%;
            transition: width 0.5s ease;
            text-align: center;
            color: white;
            font-size: 0.8em;
            line-height: 22px;
            font-weight: bold;
        }

        .log-terminal {
            background-color: #091e42;
            color: #00875a;
            font-family: "Courier New", Courier, monospace;
            padding: 15px;
            border-radius: 6px;
            height: 220px;
            overflow-y: auto;
            font-size: 0.85em;
        }

        .log-line { margin-bottom: 6px; }
        .log-line.warn { color: #ffab00; }
        .log-line.err { color: #ff5630; }
        .log-line.info { color: #4c9aff; }

        .metrics-box {
            display: flex;
            justify-content: space-between;
            margin-top: 10px;
            background: #f4f5f7;
            padding: 10px;
            border-radius: 4px;
        }

        .metric { text-align: center; }
        .metric-value { font-size: 1.2em; font-weight: bold; }
        .status-badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-weight: bold;
            font-size: 0.8em;
        }
    </style>
</head>
<body>

<div class="container">
    <header>
        <h1>🏛️ Simulatore Economico-Monetario NOTAX</h1>
        <p>Confronta il modello attuale a tassazione con il sistema di emissione sovrana e audit IA.</p>
    </header>

    <!-- INTERRUTTORE MODALITA' -->
    <div class="mode-selector">
        <h3>Seleziona il Sistema da Testare</h3>
        <div class="mode-btn-group">
            <button id="btnModeToday" class="mode-btn today">⚠️ Come Avviene Oggi (Tasse + Debito)</button>
            <button id="btnModeNOTAX" class="mode-btn notax active-notax">🚀 Modello NOTAX (Tesoro + Audit IA)</button>
        </div>
    </div>

    <div class="grid">
        <!-- FASE 1: PARLAMENTO -->
        <div class="card">
            <h2>1. 📜 Proposta Legislativa (Parlamento)</h2>
            <form id="lawForm">
                <div class="form-group">
                    <label for="lawTitle">Titolo del Disegno di Legge:</label>
                    <input type="text" id="lawTitle" value="Ammodernamento Rete Digitale e Trasporti" required>
                </div>
                <div class="form-group">
                    <label for="lawAmount">Copertura Richiesta (Miliardi €):</label>
                    <input type="number" id="lawAmount" value="20" min="1" max="100" required>
                </div>
                <div class="form-group">
                    <label for="lawCategory">Destinazione Prevalente Fondi:</label>
                    <select id="lawCategory">
                        <option value="produttiva">Infrastrutture, Ricerca & Automazione (80% CapEx)</option>
                        <option value="mista">Sanità & Manutenzione Pubblica (60% CapEx)</option>
                        <option value="improduttiva">Sussidi Improduttivi & Burocrazia (30% CapEx)</option>
                    </select>
                </div>
                <button type="button" id="btnSubmitLaw" class="action-btn">Analizza Proposta</button>
            </form>
        </div>

        <!-- FASE 2: AUDIT & CALCOLO IA -->
        <div class="card">
            <h2>2. 🤖 Audit IA & Neutralità Prezzi (&alpha;*)</h2>
            <div id="aiPlaceholder">
                <p style="color: #6b778c; text-align: center;">Inserisci la legge e avvia l'analisi per calcolare l'impatto di bilancio e sui prezzi.</p>
            </div>
            <div id="aiResults" style="display: none;">
                <p>Esito Validazione: <span id="auditBadge" class="status-badge">In Corso...</span></p>
                
                <div class="metrics-box">
                    <div class="metric">
                        <small>Quota Produttiva (&alpha;)</small>
                        <div class="metric-value" id="valProd" style="color: var(--success)">0%</div>
                    </div>
                    <div class="metric">
                        <small>Impatto Prezzi (&Delta;P)</small>
                        <div class="metric-value" id="valPriceImpact">0%</div>
                    </div>
                </div>

                <div style="margin-top: 15px;">
                    <label>Rapporto di Produttività Calcolato (Target &ge; 80%):</label>
                    <div class="progress-bar-container">
                        <div id="aiProgressBar" class="progress-bar">0%</div>
                    </div>
                </div>

                <div id="aiRecommendation" style="margin-top: 15px; font-size: 0.9em; padding: 10px; border-radius: 4px;"></div>
                <button type="button" id="btnApproveLaw" class="action-btn" style="margin-top: 15px; display: none;">Invia Esecuzione al Tesoro</button>
            </div>
        </div>
    </div>

    <!-- FASE 3: TESORERIA -->
    <div class="card">
        <h2>3. 🏦 Risultato Esecutivo della Tesoreria</h2>
        <div class="grid">
            <div>
                <h3>Indicatori Fiscati & Finanziari</h3>
                <div class="metrics-box">
                    <div class="metric">
                        <small>Prelievo Fiscale</small>
                        <div class="metric-value" id="valTaxImpact">0 €</div>
                    </div>
                    <div class="metric">
                        <small>Nuovo Debito/Interessi</small>
                        <div class="metric-value" id="valDebtImpact">0 €</div>
                    </div>
                </div>
            </div>
            <div>
                <h3>Registro Audit in Tempo Reale</h3>
                <div class="log-terminal" id="terminalLog">
                    <div class="log-line info">[SISTEMA PRONTO] Seleziona la modalità in alto e avvia una proposta...</div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    let currentMode = 'NOTAX';
    let currentLaw = {};

    const btnModeToday = document.getElementById('btnModeToday');
    const btnModeNOTAX = document.getElementById('btnModeNOTAX');
    const btnSubmitLaw = document.getElementById('btnSubmitLaw');
    const btnApproveLaw = document.getElementById('btnApproveLaw');
    const terminalLog = document.getElementById('terminalLog');

    btnModeToday.addEventListener('click', () => {
        currentMode = 'TODAY';
        btnModeToday.className = 'mode-btn today active-today';
        btnModeNOTAX.className = 'mode-btn notax';
        logTerminal("COMMUTATO IN: Modello Attuale (Prelievo Fiscale & Indebitamento Titoli di Stato)", "warn");
    });

    btnModeNOTAX.addEventListener('click', () => {
        currentMode = 'NOTAX';
        btnModeNOTAX.className = 'mode-btn notax active-notax';
        btnModeToday.className = 'mode-btn today';
        logTerminal("COMMUTATO IN: Modello NOTAX (Emissione Sovrana del Tesoro & Audit IA 80/20)", "info");
    });

    function logTerminal(msg, type = 'normal') {
        const time = new Date().toLocaleTimeString();
        const line = document.createElement('div');
        line.className = `log-line ${type}`;
        line.innerText = `[${time}] ${msg}`;
        terminalLog.appendChild(line);
        terminalLog.scrollTop = terminalLog.scrollHeight;
    }

    btnSubmitLaw.addEventListener('click', () => {
        const title = document.getElementById('lawTitle').value;
        const amount = parseFloat(document.getElementById('lawAmount').value);
        const category = document.getElementById('lawCategory').value;

        currentLaw = { title, amount, category };

        document.getElementById('aiPlaceholder').style.display = 'none';
        document.getElementById('aiResults').style.display = 'block';
        btnApproveLaw.style.display = 'none';

        let prodRatio = category === 'produttiva' ? 82 : (category === 'mista' ? 60 : 30);

        if (currentMode === 'TODAY') {
            document.getElementById('auditBadge').innerText = 'MODELLO CONVENZIONALE';
            document.getElementById('auditBadge').style.background = '#ffebe6';
            document.getElementById('valProd').innerText = prodRatio + '%';
            document.getElementById('valPriceImpact').innerText = '+2.8% (Inflazione)';
            document.getElementById('valPriceImpact').style.color = 'var(--danger)';
            document.getElementById('aiProgressBar').style.width = prodRatio + '%';
            
            document.getElementById('aiRecommendation').style.background = '#ffebe6';
            document.getElementById('aiRecommendation').innerText = 'Sistema Tradizionale: Nessuna verifica algoritmica di produttività applicata. La legge richiede copertura obbligatoria via Tasse o Debito.';
            btnApproveLaw.style.display = 'block';
        } else {
            // Modello NOTAX con calcolo formula Saba-Werner
            document.getElementById('auditBadge').innerText = 'AUDIT IA IN CORSO...';
            
            setTimeout(() => {
                if (prodRatio >= 80) {
                    document.getElementById('auditBadge').innerText = 'CONFORME (Target &ge; 80%)';
                    document.getElementById('auditBadge').style.background = '#e3fcef';
                    document.getElementById('valProd').innerText = prodRatio + '%';
                    document.getElementById('valPriceImpact').innerText = '-0.4% (Deflazione)';
                    document.getElementById('valPriceImpact').style.color = 'var(--success)';
                    document.getElementById('aiProgressBar').style.width = prodRatio + '%';
                    
                    document.getElementById('aiRecommendation').style.background = '#e3fcef';
                    document.getElementById('aiRecommendation').innerText = 'L\'IA conferma il rispetto del parametro 80/20. L\'aumento dell\'offerta reale compensa l\'emissione monetaria, riducendo i prezzi al dettaglio.';
                    btnApproveLaw.style.display = 'block';
                } else {
                    document.getElementById('auditBadge').innerText = 'RETTIFICA IA IN CORSO';
                    document.getElementById('auditBadge').style.background = '#fff0b3';
                    document.getElementById('aiRecommendation').style.background = '#fff0b3';
                    document.getElementById('aiRecommendation').innerText = `Rapporto insufficiente (${prodRatio}% CapEx). L'IA rimodula automaticamente i capitoli di spesa tagliando gli sprechi per raggiungere la quota soglia dell'80%.`;

                    setTimeout(() => {
                        prodRatio = 80;
                        document.getElementById('valProd').innerText = '80%';
                        document.getElementById('valPriceImpact').innerText = '-0.2% (Deflazione)';
                        document.getElementById('valPriceImpact').style.color = 'var(--success)';
                        document.getElementById('aiProgressBar').style.width = '80%';
                        document.getElementById('auditBadge').innerText = 'RETTIFICATO ALL\'80%';
                        document.getElementById('auditBadge').style.background = '#e3fcef';
                        document.getElementById('aiRecommendation').innerText = 'Riconfigurazione completata: Spesa burocratica convertita in investimenti tecnologici. Legge ora idonea senza impatto inflattivo.';
                        btnApproveLaw.style.display = 'block';
                    }, 2000);
                }
            }, 800);
        }
    });

    btnApproveLaw.addEventListener('click', () => {
        btnApproveLaw.disabled = true;
        const amount = currentLaw.amount;

        if (currentMode === 'TODAY') {
            const taxAmount = (amount * 0.431).toFixed(1);
            const debtAmount = (amount * 0.569).toFixed(1);

            document.getElementById('valTaxImpact').innerText = `-${taxAmount} Mld €`;
            document.getElementById('valTaxImpact').style.color = 'var(--danger)';
            document.getElementById('valDebtImpact').innerText = `+${debtAmount} Mld € (+Interessi)`;
            document.getElementById('valDebtImpact').style.color = 'var(--danger)';

            logTerminal(`[ESECUZIONE ATTUALE] Approvata legge da ${amount} Mld €:`, 'err');
            logTerminal(`  - Prelievo Fiscale Coatto (IRPEF/IVA): -${taxAmount} Mld € dai cittadini.`, 'err');
            logTerminal(`  - Emissione BTP sul mercato (Nuovo Debito): +${debtAmount} Mld € a carico futuro.`, 'warn');
        } else {
            document.getElementById('valTaxImpact').innerText = '0 € (NO TAX)';
            document.getElementById('valTaxImpact').style.color = 'var(--success)';
            document.getElementById('valDebtImpact').innerText = '0 € (Senza Debito)';
            document.getElementById('valDebtImpact').style.color = 'var(--success)';

            logTerminal(`[ESECUZIONE NOTAX] Emessi ${amount} Mld € dal Tesoro Sovrano senza tasse né debito.`, 'info');
            logTerminal(`  - Audit Esecutivo IA: Avviato tracciamento dei flussi di cassa in tempo reale...`, 'info');
            
            setTimeout(() => {
                logTerminal(`  - Verificato 80% CapEx: Fondi accreditati direttamente alle filiere produttive.`, 'info');
                logTerminal(`  - Risultato: Nessun prelievo fiscale, offerta di beni ampliata, prezzi in stabilità/calo.`, 'info');
                btnApproveLaw.disabled = false;
            }, 1800);
        }
    });
</script>

</body>
</html>

Nessun commento:

Posta un commento