/* Stile ispirato alla maschera originale */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    display: flex;
    justify-content: center;
    padding: 40px;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: #fff;
    border: 1px solid #336699;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

header {
    background-color: #336699; /* Blu testata */
    color: white;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.form-row, .form-grid {
    padding: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-top: 0;
}

label {
    display: block;
    color: #336699;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
}

input[type="number"], input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Evita che l'input esca dai margini */
    font-size: 14px;
}

.info-box {
    margin: 20px;
    border: 1px solid #336699;
    border-radius: 4px;
}

.info-box p:first-child {
    background-color: #336699;
    color: white;
    margin: 0;
    padding: 8px 15px;
    font-size: 12px;
}

.info-box p:last-child {
    padding: 15px;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.actions {
    background-color: #f9f9f9;
    padding: 20px;
    text-align: right;
    border-top: 1px solid #eee;
}

button {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.btn-annulla {
    background-color: #fff;
    color: #999;
    border: 1px solid #ddd;
}

.btn-calcola {
    background-color: #e0e0e0; /* Grigio del tasto originale */
    color: #333;
    border: 1px solid #ccc;
}

button:hover {
    opacity: 0.8;
}

.checkbox-row {
    display: flex;
    align-items: center;
    padding: 10px 20px !important;
}

.checkbox-row input {
    width: auto;
    margin-right: 10px;
}

.label-inline {
    display: inline;
    color: #333;
    font-size: 13px;
    font-weight: bold;
}

.label-inline span {
    font-weight: normal;
    color: #666;
}

.note-box {
    padding: 0 20px 20px 20px;
    font-size: 11px;
    color: #555;
    line-height: 1.4;
}

/* Area Risultati */
.result-area {
    margin: 20px;
    padding: 20px;
    background-color: #e8f4fd;
    border-left: 5px solid #336699;
}

.result-area h3 {
    margin: 0;
    color: #336699;
}

.risultati-header {
    background-color: #336699;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    margin-top: 20px;
}

.disclaimer {
    font-size: 11px;
    color: #666;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.tabella-risultati {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tabella-risultati th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #336699;
    color: #333;
}

.tabella-risultati td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.tabella-risultati tr:nth-child(even) {
    background-color: #fafafa;
}

.totali-finali {
    padding: 20px 15px;
    font-size: 14px;
    line-height: 1.6;
}

/* Stile per il tasto stampa dentro la testata risultati */
.risultati-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-stampa {
    background-color: #fff;
    color: #336699;
    padding: 5px 15px;
    font-size: 11px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

/* REGOLE PER LA STAMPA PDF */
@media print {
    /* Nascondi tutto tranne il div dei risultati */
    header, .main-form, .actions, .no-print, .info-box, .note-box {
        display: none !important;
    }

    body {
        background-color: #fff;
        padding: 0;
    }

    .container {
        border: none;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
    }

    .risultati-header {
        background-color: #336699 !important;
        color: white !important;
        -webkit-print-color-adjust: exact; /* Forza il colore su Chrome/Edge */
    }

    .tabella-risultati th {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
}