:root {
    --primary: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --bg: #f8f9fa;
    --card: #ffffff;
}

body { font-family: 'Segoe UI', sans-serif; background-color: var(--bg); margin: 0; padding-bottom: 50px; color: #333; }
header { background: var(--primary); color: white; padding: 15px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.2rem; font-weight: bold; }
#step-indicator { font-size: 0.8rem; opacity: 0.9; }

.container { max-width: 600px; margin: 20px auto; padding: 0 15px; }

section { background: var(--card); padding: 20px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 20px; }
.subtitle { font-size: 0.9rem; color: #666; margin-bottom: 20px; }

h2 { color: var(--primary); margin-top: 0; font-size: 1.3rem; border-bottom: 1px solid #eee; padding-bottom: 15px; }
h3 { font-size: 1rem; color: #555; margin-top: 25px; text-transform: uppercase; font-weight: 600; }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ced4da; border-radius: 8px; font-size: 16px; box-sizing: border-box; }
input:focus, select:focus { border-color: var(--primary); outline: none; }

.row { display: flex; gap: 15px; margin-bottom: 15px; }
.col { flex: 1; }

/* GRIGLIA PROBLEMI */
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.problem-card { background: #fff; border: 2px solid #e9ecef; border-radius: 10px; padding: 15px 5px; text-align: center; cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; align-items: center; min-height: 80px; justify-content: center; }
.problem-card i { font-size: 28px; margin-bottom: 10px; color: var(--secondary); }
.problem-card span { font-size: 0.85rem; font-weight: 600; }
.problem-card:hover { border-color: var(--primary); background-color: #f0f8ff; }
.problem-card.active { background-color: var(--primary); border-color: var(--primary); color: white; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,123,255,0.3); }
.problem-card.active i { color: white; }

/* BOTTONI */
.btn-primary { background: var(--primary); color: white; width: 100%; padding: 15px; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer; margin-top: 10px; }
.btn-success { background: var(--success); color: white; width: 100%; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }

/* STATI */
.status-box { padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; margin: 15px 0; }
.neutral { background: #e9ecef; color: #495057; }
.leak { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.ok { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.img-preview { max-width: 100%; max-height: 250px; border-radius: 8px; border: 2px dashed #ccc; display: none; margin: 10px auto; }
.info-box { background: #e7f1ff; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 0.95rem; border-left: 4px solid var(--primary); }
.info-box p { margin: 5px 0; }
#summary_tel_link { color: var(--primary); text-decoration: none; font-weight: bold; }

/* SUCCESS ANIMATION */
#step-success h2 { color: white; border: none; font-size: 2rem; }
#step-success i { color: #a3d5ff; animation: popIn 0.5s ease; }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 80% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

/* PDF */
#pdf-template { display: none; width: 100%; max-width: 800px; background: white; padding: 40px; color: #333; font-family: Arial, sans-serif; }
.pdf-header { text-align: center; border-bottom: 2px solid #333; margin-bottom: 30px; }
.pdf-meta { display: flex; justify-content: space-between; margin-bottom: 20px; color: #666; }
.pdf-section { margin-bottom: 30px; border: 1px solid #ddd; padding: 15px; }
.pdf-table { width: 100%; border-collapse: collapse; margin-bottom: 15px; font-size: 14px; }
.pdf-table td { padding: 8px; border-bottom: 1px solid #f0f0f0; }
.pdf-table td:first-child { font-weight: bold; width: 35%; background: #f9f9f9; }
.pdf-footer { text-align: center; font-size: 10px; color: #aaa; margin-top: 40px; border-top: 1px solid #eee; padding-top: 10px; }

/* STILE MODALE QR */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); /* Sfondo scuro */
    backdrop-filter: blur(5px);
    align-items: center; justify-content: center;
}
.modal-content {
    background-color: #fff;
    margin: 15% auto; 
    padding: 25px;
    border-radius: 15px;
    width: 80%; max-width: 300px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: popIn 0.3s ease;
}
.close-btn {
    position: absolute; top: 10px; right: 15px;
    color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer;
}
.close-btn:hover { color: #000; }