* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.logo-container {
    margin-bottom: 30px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.main-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: #7f8c8d;
}

/* Model Selection */
.model-selection {
    margin-bottom: 40px;
}

.model-selection h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.model-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.model-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.model-card.active {
    background: #3498db;
    color: white;
}

.model-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.model-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.model-card.active p {
    color: rgba(255,255,255,0.9);
}

.select-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-btn:hover {
    background: #2980b9;
}

.model-card.active .select-btn {
    background: white;
    color: #3498db;
}

/* Form Section */
.form-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.form-section h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#model-title {
    text-align: center;
    margin-bottom: 30px;  /* Aumentato per più spazio */
    color: #2c3e50;
}

/* Layout specifico per il modello 3 - 4 colonne per riga */
.form-fields.four-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 900px;
    margin: 0 auto 30px;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.calculate-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background 0.3s ease;
}

.calculate-btn:hover {
    background: #229954;
}

/* Results Section */
.results-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.results-section h2 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2.2em;  /* Più grande ma meno di Low/High */
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

/* Probability Level Styling */
#prob-description {
    font-size: 1.3em;  /* Dimensione appropriata per il testo principale */
    margin-bottom: 30px;
    line-height: 1.5;
    color: white;
}

.result-description {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.result-interpretation {
    background: rgba(255,255,255,0.2);
    padding: 25px;
    border-radius: 10px;
    font-size: 1.15em;
    line-height: 1.6;
}

.result-interpretation strong {
    color: #fff;
    font-size: 1.2em;
}

.reset-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.reset-btn:hover {
    background: #c0392b;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2em;
    }
    
    .model-cards {
        grid-template-columns: 1fr;
    }
    
    .form-fields {
        grid-template-columns: 1fr;
    }
    
    .form-fields.four-columns {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .form-fields.four-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive per il testo dei risultati */
@media (max-width: 768px) {
    #prob-description {
        font-size: 1.1em;
    }
    
    .result-interpretation {
        font-size: 1em;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    #prob-description {
        font-size: 1em;
    }
    
    .result-interpretation {
        font-size: 0.95em;
        padding: 15px;
    }
}

/* Ottimizzazione specifica per iPhone e dispositivi mobili */
@media (max-width: 414px) { /* iPhone 6/7/8 Plus */
    
    .result-card {
        padding: 30px;
    }
}

@media (max-width: 390px) { /* iPhone 12/13/14 Pro */
    
    .result-card {
        padding: 25px;
    }
}

@media (max-width: 375px) { /* iPhone 6/7/8/SE */
    #prob-description {
        font-size: 0.95em;
    }
    
    .result-interpretation {
        font-size: 0.9em;
        padding: 15px;
    }
}

@media (max-width: 320px) { /* iPhone SE 1st gen */
   #prob-description {
        font-size: 0.9em;
    }
    
    .result-card {
        padding: 20px;
    }
}

/* Fix per overflow del testo */
@media (max-width: 414px) {
    .result-value {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

