/* ===== CSS CALCOLATORE SRI ===== */

/* Tooltip icona info */

.tooltip-icon {
    color: var(--primary-color);
    cursor: help;
    position: relative;
    margin-left: 0.25rem;
    font-size: 0.9rem;
    display: inline-block; /* Fondamentale */
}

/* Usiamo SOLO ::after per il testo del tooltip */
.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    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: normal;
    width: 220px; /* Meglio width che max-width per stabilità */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    text-align: center;
    line-height: 1.4;
    font-family: sans-serif; /* Evita che il tooltip erediti il font delle icone */
}

/* Mostra il tooltip al passaggio del mouse */
.tooltip-icon:hover::after {
    opacity: 1;
}

/* Steps */
.sri-step {
    display: none;
}

.sri-step.active {
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-select:hover,
.form-input:hover {
    border-color: var(--primary-color);
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

/* Ambiti Tecnici */
.ambito-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.ambito-section:last-child {
    border-bottom: none;
}

.ambito-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Classe Energetica Badge */
.classe-badge {
    display: inline-block;
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
    font-size: 3rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    line-height: 1;
}

.classe-A { background: #00a859; }
.classe-B { background: #7cb342; }
.classe-C { background: #c0ca33; }
.classe-D { background: #fdd835; color: #333; }
.classe-E { background: #ffb300; color: #333; }
.classe-F { background: #fb8c00; }
.classe-G { background: #e53935; }

/* Progress Bars */
.progress-bar-container {
    background: #e0e0e0;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a859, #7cb342);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Grid Risultati */
.risultati-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.risultato-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

.risultato-card:hover {
    background: #e8f5e9;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.risultato-card-title {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.risultato-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Info Box */
.info-box {
    padding: 1rem;
    background: #e3f2fd;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    margin: 1.5rem 0;
}

.info-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.warning-box {
    padding: 1rem;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.warning-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-body {
        padding: 1rem !important;
    }
    
    .risultati-grid {
        grid-template-columns: 1fr;
    }
    
    .classe-badge {
        font-size: 2.5rem;
        padding: 1rem 2rem;
    }
    
    .risultato-card-value {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    nav, footer, .btn-cta, .btn-secondary {
        display: none !important;
    }
    
    .sri-step {
        display: block !important;
        page-break-inside: avoid;
    }
    
    #step1, #step2 {
        display: none !important;
    }
}
