/* Vivi Perugia Sondaggi - stile frontend */

.vp-sondaggio-box {
    --vp-accent: #e72168;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 20px 22px;
    background: #ffffff;
    border: 1px solid rgba(231, 33, 104, 0.16);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(231, 33, 104, 0.08);
    font-family: "Raleway", sans-serif;
    overflow: hidden;
}

.vp-sondaggio-box * {
    box-sizing: border-box;
    font-family: "Raleway", sans-serif;
}

.vp-sondaggio-domanda {
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1f1f1f;
    text-align: left;
}

/* Risposte chiuse in linea su desktop */
.vp-opzioni-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    margin-bottom: 14px;
}

.vp-opzioni-wrapper.vp-num-2 .vp-opzione,
.vp-opzioni-wrapper.vp-num-3 .vp-opzione {
    flex: 1 1 0;
    min-width: 0;
}

.vp-opzione {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    margin: 0;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    line-height: 1.45;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.vp-opzione:hover {
    border-color: var(--vp-accent);
    background: rgba(231, 33, 104, 0.04);
    box-shadow: 0 6px 18px rgba(231, 33, 104, 0.08);
}

.vp-opzione input[type="radio"] {
    accent-color: var(--vp-accent);
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 18px;
}

.vp-opzione span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

/* 3 campi aperti in linea su desktop */
.vp-open-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.vp-open-field-wrap {
    width: 100%;
}

.vp-open-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
}

.vp-risposta-testo {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    margin: 0;
    font-family: "Raleway", sans-serif;
}

.vp-risposta-testo:focus {
    outline: none;
    border-color: var(--vp-accent);
    box-shadow: 0 0 0 3px rgba(231, 33, 104, 0.12);
}

.vp-open-help {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 13px;
    color: #777;
    line-height: 1.5;
}

.vp-vota-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    padding: 13px 22px;
    background: var(--vp-accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.vp-vota-btn:hover {
    background: #cb1d5b;
    box-shadow: 0 10px 22px rgba(231, 33, 104, 0.24);
}

.vp-vota-btn:disabled {
    background: #d8a8ba;
    cursor: not-allowed;
    box-shadow: none;
}

.vp-errore {
    color: #b42318;
    font-size: 13px;
    margin-top: 10px;
}

.vp-risultati-sottotitolo {
    font-size: 12px;
    color: #7a7a86;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Risultati chiusi in linea su desktop */
.vp-risultati-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.vp-risultati-wrapper.vp-num-2 .vp-risultato-riga,
.vp-risultati-wrapper.vp-num-3 .vp-risultato-riga {
    flex: 1 1 0;
    min-width: 0;
}

.vp-risultato-riga {
    width: 100%;
    margin: 0;
    padding: 14px 14px 12px;
    border: 1px solid #ececf1;
    border-radius: 12px;
    background: #fafafb;
}

.vp-risultato-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2f2f35;
}

.vp-risultato-label > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.vp-risultato-perc {
    color: var(--vp-accent);
    white-space: nowrap;
    flex: 0 0 auto;
}

.vp-barra-container {
    width: 100%;
    height: 14px;
    background: #f3f3f5;
    border-radius: 999px;
    overflow: hidden;
}

.vp-barra-riempimento {
    height: 100%;
    background: linear-gradient(90deg, #e72168, #ff4b8a);
    border-radius: 999px;
    width: 0%;
    transition: width .6s ease;
}

/* Podio aperto in linea su desktop */
.vp-risultati-open-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.vp-classifica-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.vp-classifica-list .vp-classifica-item {
    flex: 1 1 0;
    min-width: 0;
}

.vp-classifica-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid #ececf1;
    border-radius: 12px;
    background: #fafafb;
}

.vp-classifica-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vp-classifica-rank {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(231, 33, 104, 0.1);
    color: var(--vp-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex: 0 0 28px;
}

.vp-classifica-meta {
    font-size: 13px;
    color: var(--vp-accent);
    font-weight: 700;
    white-space: nowrap;
}

.vp-classifica-testo {
    font-size: 14px;
    font-weight: 600;
    color: #2e2e36;
    line-height: 1.4;
}

.vp-empty-results {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fafafb;
    border: 1px dashed #dedee4;
    color: #777;
    font-size: 14px;
}

.vp-sondaggio-risultati {
    margin-top: 14px;
}

.vp-totale-voti {
    display: none;
}

@media (max-width: 767px) {
    .vp-sondaggio-box {
        padding: 16px;
        border-radius: 14px;
    }

    .vp-sondaggio-domanda {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .vp-opzioni-wrapper {
        flex-direction: column;
    }

    .vp-opzioni-wrapper.vp-num-2 .vp-opzione,
    .vp-opzioni-wrapper.vp-num-3 .vp-opzione {
        flex: 1 1 auto;
        width: 100%;
    }

    .vp-open-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .vp-risultati-wrapper {
        flex-direction: column;
    }

    .vp-risultati-wrapper.vp-num-2 .vp-risultato-riga,
    .vp-risultati-wrapper.vp-num-3 .vp-risultato-riga {
        flex: 1 1 auto;
        width: 100%;
    }

    .vp-classifica-list {
        flex-direction: column;
        gap: 10px;
    }

    .vp-classifica-list .vp-classifica-item {
        flex: 1 1 auto;
        width: 100%;
    }

    .vp-risultato-label,
    .vp-classifica-testo {
        font-size: 13px;
    }
}

.vp-sondaggio-box.vp-appena-votato .vp-risultato-riga,
.vp-sondaggio-box.vp-appena-votato .vp-classifica-item {
    animation: vpFadeIn .4s ease;
}

@keyframes vpFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
