/* ==========================================================
   Valutatore - si carica DOPO ../style.css e ne usa le variabili
   ========================================================== */

.valutatore { max-width: 760px; padding-top: 30px; padding-bottom: 20px; }

/* ---------- Intro ---------- */
.v-intro { text-align: center; margin-bottom: 24px; }
.v-intro h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--primary-color); line-height: 1.2; margin-bottom: 10px; }
.v-intro p { color: #555; max-width: 600px; margin: 0 auto; }
.v-plus { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.v-plus li {
    background: #fff; border: 1px solid #e3e6ee; border-radius: 999px;
    padding: 6px 14px; font-weight: bold; font-size: .9em; color: var(--primary-color);
}
.v-plus i { color: var(--secondary-color); margin-right: 4px; }

/* ---------- Card ---------- */
.v-card {
    background: #fff; border: 1px solid #e3e6ee; border-radius: 14px;
    box-shadow: 0 6px 24px rgba(16, 24, 64, .08);
    padding: 28px; scroll-margin-top: 16px;
}

/* Passi */
.v-steps { list-style: none; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.v-steps li { display: flex; align-items: center; gap: 8px; font-size: .9em; font-weight: bold; color: #6b7180; }
.v-steps span {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eef0f5; color: #5d6372; transition: background-color var(--transition-speed);
}
.v-steps li.is-active { color: var(--primary-color); }
.v-steps li.is-active span { background: var(--primary-color); color: #fff; }
.v-steps li.is-done span { background: var(--secondary-color); color: #fff; }
.v-progress { height: 6px; background: #eef0f5; border-radius: 3px; overflow: hidden; margin-bottom: 26px; }
.v-progress-bar { height: 100%; width: 25%; background: var(--primary-color); transition: width .4s ease; }

/* Passi del modulo: senza JS sono tutti visibili */
.v-step { border: 0; min-width: 0; }
#v-form.js .v-step { display: none; }
#v-form.js .v-step.is-active { display: block; animation: v-fade .35s ease; }
@keyframes v-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* titolo del passo: h2 normale (il <legend> viene disegnato in modo diverso da Safari e Firefox) */
.v-step-titolo { display: block; width: 100%; font-size: 1.3em; font-weight: bold; line-height: 1.3; color: var(--primary-color); margin: 0 0 18px; padding: 0; }
.v-step { margin: 0; padding: 0; border: 0; min-width: 0; }

/* Campi */
.v-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-weight: bold; font-size: .9em; color: #555; }
.v-label { display: block; }
.v-field input, .v-field select {
    width: 100%; min-width: 0; height: 46px;
    font: inherit; font-size: 1rem; font-weight: normal; color: var(--text-dark);
    padding: 0 12px; border: 1px solid #ddd; border-radius: 6px; background: #fafbfd;
}
.v-field select {
    appearance: none; -webkit-appearance: none; padding-right: 32px;
    background: #fafbfd url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23040F9F%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-24.8%200L146.2%20205.9%2030.3%2069.4a17.6%2017.6%200%200%200-24.8%2024.8l130.6%20129.5a17.6%2017.6%200%200%200%2024.8%200l130.6-129.5a17.6%2017.6%200%200%200%200-24.8z%22%2F%3E%3C%2Fsvg%3E') no-repeat right 12px center;
    background-size: 10px 10px;
}
.v-field input:focus, .v-field select:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 15, 159, .15); background-color: #fff;
}
.v-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Scelte a pulsante (come il filtro "Locali" della home) */
.v-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.v-pills label { position: relative; flex: 1 1 120px; cursor: pointer; }
.v-pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.v-pills span {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 46px; padding: 8px 12px;
    border: 1px solid #ddd; border-radius: 6px; background: #fafbfd;
    font-weight: bold; color: #555; transition: all var(--transition-speed);
}
.v-pills label:hover span { border-color: var(--primary-color); }
.v-pills input:checked + span { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.v-pills input:focus-visible + span { outline: 3px solid var(--accent-on-dark); outline-offset: 2px; }

.v-check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 16px; font-size: .9em; cursor: pointer; }
.v-check input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--primary-color); }
.v-check a { text-decoration: underline; }
.v-error { color: var(--secondary-color); font-weight: bold; font-size: .9em; margin-top: 8px; }

/* Pulsanti */
.v-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.v-actions-end { justify-content: flex-end; }
.v-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: bold; font-size: 1rem;
    padding: 13px 26px; border-radius: 50px; border: 0; cursor: pointer;
    transition: background-color var(--transition-speed), transform .15s, box-shadow var(--transition-speed);
}
.v-btn:hover { transform: translateY(-1px); }
.v-btn:disabled { opacity: .6; cursor: wait; }
.v-btn-primary { background: var(--primary-color); color: #fff; }
.v-btn-primary:hover { background: #003366; color: #fff; }
.v-btn-accent { background: var(--secondary-color); color: #fff; box-shadow: 0 4px 15px rgba(228, 5, 33, .3); }
.v-btn-accent:hover { background: #c4041c; color: #fff; }
.v-btn-ghost { background: #fff; color: #555; border: 1px solid #ddd; }
.v-btn-ghost:hover { border-color: var(--primary-color); color: var(--primary-color); }

.v-note { text-align: center; color: #5f6470; font-size: .85em; margin-top: 16px; }
.v-note i { margin-right: 4px; }

/* ---------- Pagina risultato ---------- */
.v-esito h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); color: var(--primary-color); margin-bottom: 16px; }
.v-esito h1 i { color: var(--secondary-color); }
.v-esito h2 { font-size: 1.15em; color: var(--primary-color); margin: 26px 0 10px; padding-left: 12px; border-left: 4px solid var(--secondary-color); }
.v-esito-ok { color: #145c2c; background: #e3f6e8; border: 1px solid #b9e4c6; border-radius: 8px; padding: 10px 14px; font-weight: bold; margin-bottom: 20px; }
.v-esito-ok i { margin-right: 6px; }
.v-risultato {
    background: var(--primary-color); color: #fff; border-radius: 12px;
    padding: 24px; text-align: center; border-bottom: 5px solid var(--secondary-color);
}
.v-risultato-label { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .85em; opacity: .85; }
.v-risultato-valore { display: block; font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: bold; margin-top: 6px; }
.v-risultato-valore small { font-size: .5em; font-weight: normal; opacity: .85; }
.v-risultato-nd { color: #555; }
.v-riepilogo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.v-riepilogo div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eee; }
.v-riepilogo dt { color: #777; }
.v-riepilogo dd { font-weight: bold; text-align: right; }
.v-disclaimer {
    display: flex; gap: 12px; margin-top: 22px; padding: 16px;
    background: #fff8f8; border: 1px solid #f6c3c9; border-radius: 8px; font-size: .92em;
}
.v-disclaimer i { color: var(--secondary-color); margin-top: 3px; }
.v-disclaimer p { margin: 0; }
.v-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.v-errori { margin: 0 0 22px 20px; color: #8a1424; }
.v-errori li { margin-bottom: 4px; }

/* ---------- Modulo in 4 passi ---------- */
.v-facolt { font-weight: normal; color: #6b7180; }
.v-pills-4 label { flex-basis: calc(25% - 8px); min-width: 120px; }
.v-pills-5 label { flex-basis: calc(20% - 8px); min-width: 96px; }
.v-pills-6 label { flex-basis: calc(16.6% - 8px); min-width: 80px; }
.v-pills-col { flex-direction: column; }
.v-pills-col label { flex: 0 0 auto; }
.v-pills-col span { justify-content: flex-start; text-align: left; min-height: 44px; }
[data-solo-app][hidden] { display: none; }

/* ---------- Risultato ---------- */
.v-risultato-sotto { display: block; margin-top: 8px; opacity: .92; }
.v-fattori { list-style: none; margin: 0; padding: 0; border: 1px solid #e3e6ee; border-radius: 10px; overflow: hidden; }
.v-fattori li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #eef0f5; }
.v-fattori li:last-child { border-bottom: 0; }
.v-fattori li:nth-child(even) { background: #fafbfd; }
.v-fattori strong { white-space: nowrap; }
.v-f-su { color: #146c2e; }
.v-f-giu { color: #b3071c; }
.v-prossimo { margin-top: 26px; padding: 4px 20px 20px; background: #f1f3fb; border-radius: 12px; }
.v-prossimo h2 { margin-top: 18px; }
.v-prossimo .v-cta { margin-top: 16px; }
.v-btn-wa { background: #0F7A6E; color: #fff; }
.v-btn-wa:hover { background: #0e6f64; color: #fff; }
.v-venduti { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.v-venduti .h-card h3 { font-size: .95em; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .valutatore { padding-top: 20px; }
    .v-card { padding: 20px 16px; border-radius: 10px; }
    .v-steps li { font-size: .8em; flex-direction: column; gap: 4px; }
    .v-row, .v-riepilogo, .v-venduti { grid-template-columns: 1fr; }
    .v-pills-4 label { flex-basis: calc(50% - 8px); min-width: 0; }
    .v-pills-5 label, .v-pills-6 label { flex-basis: calc(33.3% - 8px); min-width: 0; }
    .v-actions { flex-direction: column-reverse; }
    .v-actions .v-btn, .v-cta .v-btn { width: 100%; }
}
