/* style_interno.css - Stile Isolato per il Modulo Perizia */

/* --- LAYOUT GENERALE E SFONDO --- */
#perizia-wrapper {
    width: 100%;
    /* Sfondo elegante: un gradiente leggero o un'immagine sfocata */
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    background-image: radial-gradient(#266058 0.5px, transparent 0.5px), radial-gradient(#266058 0.5px, #fdfbfb 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    /* Se hai un'immagine di sfondo, usa questa riga invece:
       background: url('../images/bg-home.jpg') no-repeat center center/cover; */
    
    padding-top: 80px; 
    padding-bottom: 80px;
    min-height: 85vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- SEZIONE INTRODUTTIVA (MARKETING) --- */
.perizia-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    padding: 0 15px;
}

.perizia-intro h1 {
    color: #266058;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.perizia-intro p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.highlight-green {
    color: #266058;
    font-weight: bold;
}

/* --- LA CARD BIANCA (IL FORM) --- */
.container-perizia {
    max-width: 650px; /* Leggermente più stretto per eleganza */
    width: 95%;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 16px; /* Più arrotondato */
    padding: 40px;
    /* Ombra più profonda per effetto "sospeso" */
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}

/* Badge "Gratuito" sulla card */
.badge-free {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.3);
}

/* Titoli interni al form */
.container-perizia h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1.8rem;
}

.container-perizia h3 {
    text-align: center;
    color: #266058;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 1.4rem;
}

.form-subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 30px;
    font-size: 0.95rem;
    margin-top: -5px;
}

/* --- INPUT E CAMPI --- */
.form-group-perizia { margin-bottom: 25px; }

.form-group-perizia label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: #444;
    font-size: 0.95rem;
}

.container-perizia input[type="text"], 
.container-perizia input[type="number"], 
.container-perizia input[type="email"], 
.container-perizia input[type="tel"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee; /* Bordo più spesso ma chiaro */
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    transition: all 0.3s;
}

.container-perizia input:focus {
    border-color: #266058;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(38, 96, 88, 0.1);
}

/* --- BOTTONI --- */
.button-perizia {
    width: 100%;
    padding: 18px;
    background: #266058;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(38, 96, 88, 0.2);
}

.button-perizia:hover:not(:disabled) {
    background: #1e4d46;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(38, 96, 88, 0.3);
}

.button-perizia:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

.button-perizia.back-button {
    background: transparent;
    color: #7f8c8d;
    border: 2px solid #ecf0f1;
    margin-top: 15px;
    box-shadow: none;
}
.button-perizia.back-button:hover {
    background: #ecf0f1;
    color: #2c3e50;
    border-color: #bdc3c7;
}

/* --- OPZIONI A PULSANTE (Grid migliorata) --- */
.option-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.option {
    padding: 15px 10px;
    background-color: #fff;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 calc(33% - 12px); /* 3 per riga */
    text-align: center;
    min-width: 100px;
    font-weight: 600;
    color: #555;
}

.option:hover {
    border-color: #b2bec3;
    background-color: #f8f9fa;
}

.option.active {
    background-color: #eafaf1;
    color: #266058;
    border-color: #266058;
    box-shadow: 0 4px 10px rgba(38, 96, 88, 0.15);
}

/* --- AUTOCOMPLETE --- */
#results {
    margin-top: 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-top: none;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.95rem;
}
.result-item:hover {
    background-color: #f0fdfa;
    color: #266058;
}

/* --- SEZIONE BENEFIT (SOTTO IL FORM) --- */
.perizia-benefits {
    max-width: 900px;
    margin: 60px auto 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 20px;
}

.benefit-item {
    flex: 1 1 250px;
    text-align: center;
    padding: 20px;
}

.benefit-icon {
    font-size: 2.5rem;
    color: #266058;
    margin-bottom: 15px;
    background: white;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.benefit-item h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.benefit-item p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

/* Checkbox Privacy */
.consent-group-perizia {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Utility */
.hidden { display: none !important; }

/* Mobile adjustments */
@media (max-width: 768px) {
    .perizia-intro h1 { font-size: 1.8rem; }
    .container-perizia { padding: 25px 20px; }
    .option { flex: 1 1 calc(50% - 12px); } /* 2 per riga su mobile */
}

/* --- NUOVO: Evidenziazione Campi Obbligatori --- */

/* Classe per evidenziare il campo corrente */
.highlight-active {
    border: 2px solid #e67e22 !important; /* Arancione per attirare l'attenzione */
    background-color: #fffaf0 !important; /* Sfondo giallino chiaro */
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.3) !important;
    transition: all 0.3s ease;
    animation: pulseInput 2s infinite;
}

/* Animazione pulsante per renderlo impossibile da ignorare */
@keyframes pulseInput {
    0% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(230, 126, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0); }
}

/* Applichiamo lo stile anche ai gruppi di opzioni */
.option-group.highlight-active {
    padding: 10px;
    border-radius: 8px;
}