/* ===== CSS CALCOLATORE MUTUO ===== */

/* Container principale - larghezza 800px */
#calcolatore-wrapper {
    max-width: 800px;
}

/* Body del calcolatore - allinea i campi a sinistra */
#calculator-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Allineamento a sinistra invece di center */
    padding: 2rem !important;
}

/* Struttura Calculator Rows */
.calculator-row {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.calculator-row label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: .2rem;
    text-align: left;
}

/* Tooltip icona info */
.tooltip-icon {
    color: var(--primary-color);
    cursor: help;
    position: relative;
    margin-left: 0.25rem;
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before {
    opacity: 1;
}

/* Input container */
.input-container {
    position: relative;
    width: 100%;
    margin-bottom: .5rem;
}

.input-container input[type="text"] {
    width: 100%;
    padding: 0.5rem 2.1rem 0.5rem 1rem;
    font-size: 1.5rem;
    font-weight: 500;
    border: 1px solid #9e9e9e;
    border-radius: 4px;
    text-align: right;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input-container input[type="text"]:hover {
    border-color: red; /* #e91e63; */
}

.input-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

/* Simbolo € - più vicino al numero */
.input-container .currency {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-dark);
    pointer-events: none;
}

/* Badge percentuale - DENTRO il campo a sinistra */
.percentage-badge {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* Slider - SOLO IL TRACK DEVE ESSERE COLORATO */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent; /* TRASPARENTE - il colore va solo sul track */
    outline: none;
    position: relative;
    height: 32px; /* Altezza totale per contenere il thumb */
    padding: 0;
    margin: 0;
}

/* Track WebKit - QUI va il gradiente colorato */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #e0e0e0; /* Colore di default */
    border-radius: 10px;
    cursor: pointer;
}

/* Track Firefox - QUI va il gradiente colorato */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
}

/* Thumb WebKit - DIMENSIONE E CENTRATURA */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: #00a859; /* #9bcc3f; */
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-top: -12px; /* (32px thumb - 8px track) / 2 = -12px per centrare */
    position: relative;
    z-index: 2;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: red; /* #e91e63; */
}

/* Thumb Firefox - DIMENSIONE E CENTRATURA */
input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: #00a859; /* #9bcc3f; */
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb:hover {
    background: red; /* #e91e63; */
    transform: scale(1.15);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #e91e63;
}

.radio-option span {
    font-weight: 500;
}

/* Alert Box */
.alert-box {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.alert-box i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Results Section */
.results-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 2rem;
    border: 1px solid var(--text-dark);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 1.1rem;
}

.result-row span {
    color: var(--text-dark);;
}

.result-row strong {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.result-row.highlight {
    border-top: 2px solid #e0e0e0;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.result-row.highlight strong {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Testi finali e pulsante - max 400px */
#calculator-container > p,
#calculator-container .btn-cta {
    max-width: 400px;
    width: 100%;
}

/* TEMPORANEO */
.intervention-list .intervention-item {
    cursor: default!important;
    border-left: 4px solid #00af5c!important;
    color: var(--text-dark)!important;
}
.intervention-list .intervention-item:hover {
    transform: none!important;
    border-left-color: #008747!important;
}
.intervention-list .intervention-content p {
    color: var(--text-dark)!important;
}
/* FINE TEMPORANEO */

/* Responsive */
@media (max-width: 768px) {
    #calculator-container {
        align-items: center; /* Su mobile torna al centro */
    }
    
    .calculator-row {
        max-width: 100%;
    }
    
    .calculator-row label {
        font-size: 1rem;
    }
    
    .input-container input[type="text"] {
        font-size: 1.2rem;
        padding-right: 2.5rem;
    }
    
    .input-container .currency {
        font-size: 1rem;
        right: 0.5rem;
    }
    
    .radio-group {
        gap: 1rem;
    }
    
    .results-section,
    .alert-box,
    #calculator-container > p,
    #calculator-container .btn-cta {
        max-width: 100%;
    }
    
    /* Tooltip mobile */
    .tooltip-icon::after {
        bottom: auto;
        top: 125%;
        white-space: normal;
        max-width: 200px;
    }
    
    .tooltip-icon::before {
        bottom: auto;
        top: 115%;
        border-top-color: transparent;
        border-bottom-color: rgba(0, 0, 0, 0.9);
    }
}

@media (max-width: 425px) {
    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .result-row strong {
        font-size: 1.5rem;
    }
    
    .result-row.highlight strong {
        font-size: 1.6rem;
    }
}
