/* ============================================================
   Module Sondages — styles complets
   ============================================================ */

/* ---- Carte de sondage (v2) ---- */
.poll-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.poll-card-v2 {
    background: var(--card, #0c1d36);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 16px;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.poll-card-link:hover .poll-card-v2 {
    transform: translateY(-4px);
    border-color: rgba(72,189,211,.4);
    box-shadow: 0 12px 30px rgba(0,0,0,.3);
}

.poll-card-v2-strip {
    height: 4px;
    background: linear-gradient(90deg, var(--secondary, #6150aa), var(--primary, #48bdd3));
}
.poll-card-v2.is-closed .poll-card-v2-strip {
    background: rgba(255,255,255,.1);
}

.poll-card-v2-body {
    padding: 1.25rem 1.35rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    flex: 1;
}

.poll-card-v2-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.poll-card-v2-type {
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    background: rgba(255,255,255,.05);
    padding: .15rem .5rem;
    border-radius: 999px;
}

.poll-card-v2-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--foreground);
}

.poll-card-v2-desc {
    margin: 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.5;
}

.poll-card-v2-leader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.2);
    border-radius: 10px;
    padding: .5rem .75rem;
    margin-top: .25rem;
}
.poll-card-v2-leader-label {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent-warning, #f59e0b);
}
.poll-card-v2-leader-pct {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-warning, #f59e0b);
}

.poll-card-v2-foot {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.poll-card-v2-stats {
    display: flex;
    gap: .75rem;
    font-size: .8rem;
    color: var(--muted);
}
.poll-stat { white-space: nowrap; }

.poll-card-v2-cta {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
}
.poll-card-link:hover .poll-card-v2-cta {
    text-decoration: underline;
}

/* ---- Détail sondage : layout 2 colonnes ---- */
.poll-detail { max-width: 720px; }

.poll-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.75rem;
    align-items: start;
}
@media (max-width: 820px) {
    .poll-layout { grid-template-columns: 1fr; }
}

.poll-main { min-width: 0; }
.poll-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 1rem;
}
@media (max-width: 820px) {
    .poll-side { position: static; }
}

.poll-side-desc { padding: 1.25rem 1.35rem; }
.poll-side-desc p {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--muted);
    margin: .5rem 0 0;
}

.poll-info-list {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.poll-info-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .9rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
}
.poll-info-list li:last-child { border-bottom: none; padding-bottom: 0; }

.poll-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.poll-back {
    display: inline-block;
    text-decoration: none;
}
.poll-eyebrow-lg {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.poll-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.poll-desc {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-style: italic;
    color: var(--muted);
}

/* ---- Formulaire de vote ---- */
.poll-vote-card { padding: 1.75rem; }

.poll-vote-options {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 1.5rem 0;
}

.poll-vote-option {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border, rgba(255,255,255,.08));
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .1s;
    position: relative;
}
.poll-vote-option:hover {
    border-color: var(--primary);
    background: rgba(72,189,211,.06);
    transform: translateX(3px);
}
.poll-vote-option:active { transform: scale(.99); }

.poll-vote-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom radio/checkbox */
.poll-vote-radio {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border, rgba(255,255,255,.2));
    border-radius: 50%;
    flex-shrink: 0;
    transition: all .18s;
    position: relative;
}
.poll-vote-option input[type="checkbox"] + .poll-vote-radio {
    border-radius: 6px;
}
.poll-vote-option input:checked + .poll-vote-radio {
    border-color: var(--primary);
    background: var(--primary);
}
.poll-vote-option input:checked + .poll-vote-radio::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #08172d;
    font-size: .8rem;
    font-weight: 900;
}
.poll-vote-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(72,189,211,.10);
}

.poll-vote-label {
    flex: 1;
    font-size: 1.02rem;
    font-weight: 600;
}

/* ---- Résultats ---- */
.poll-results-card { padding: 1.75rem; }
.poll-results-head { margin-bottom: 1.5rem; }

.poll-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.poll-result-row { position: relative; }
.poll-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .4rem;
}
.poll-result-label {
    font-weight: 700;
    font-size: .98rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.poll-your-vote {
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(72,189,211,.14);
    padding: .12rem .5rem;
    border-radius: 999px;
}
.poll-result-pct {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--foreground);
    white-space: nowrap;
}

.poll-result-track {
    width: 100%;
    height: 16px;
    background: rgba(255,255,255,.05);
    border-radius: 999px;
    overflow: hidden;
}
.poll-result-fill {
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--secondary, #6150aa), var(--primary, #48bdd3));
    transition: width .5s ease;
}
.poll-result-fill.is-mine {
    background: var(--primary, #48bdd3);
}
.poll-result-fill.is-winner {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.poll-result-count {
    font-size: .78rem;
    color: var(--muted);
    margin-top: .25rem;
    display: block;
}

/* ---- État vide ---- */
.poll-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}
/* ---- Non connecté ---- */
.poll-login-prompt {
    text-align: center;
    padding: 2.5rem 1.75rem;
}
.poll-login-prompt .card-title { margin-bottom: .5rem; }
.poll-login-prompt .hero-actions { margin-top: 1.25rem; }

/* ---- Admin : options dynamiques ---- */
.poll-options-admin {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .75rem;
}
.poll-option-admin {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.poll-option-admin input { flex: 1; }

/* ---- Responsive ---- */
@media (max-width: 540px) {
    .poll-result-head { flex-direction: column; align-items: flex-start; gap: .15rem; }
    .poll-result-pct { font-size: 1.4rem; }
    .poll-vote-option { padding: .85rem 1rem; }
}
