:root {
    --surface-bg: #f7f8fa;
    --text-main: #0a0e27;
    --text-secondary: #5b6582;
    --text-muted: #8891a8;
    --accent-primary: #ff6b00;
    --accent-secondary: #ff8f3d;
    --border-light: #e8ecf2;
    --border-medium: #d1d9e6;
}

.widget-title .poll-badge {
    margin-left: auto;
    font-family: 'Archivo', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #10b981;
    background: rgba(16,185,129,.08);
    border: 1.5px solid rgba(16,185,129,.18);
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.widget-title .poll-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16,185,129,.5);
    animation: poll-pulse 2.2s ease-in-out infinite;
}

@keyframes poll-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
    60%  { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.poll-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light) 30%, var(--border-light) 70%, transparent);
    margin: 0 0 20px;
}

/* ─── Question ────────────────────────────────────────────────── */
.widget .poll-question {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: clamp(14px, 2vw, 20px);
    font-family: 'Sora', sans-serif;
    letter-spacing: -.02em;
}

/* ─── Options ─────────────────────────────────────────────────── */
.poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.poll-option { position: relative; }
.poll-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.poll-label {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-light);
    background: var(--surface-bg);
    cursor: pointer;
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 600;
    color: var(--text-secondary);
    transition: border-color .22s ease, background .22s ease, color .22s ease, transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
    min-height: 50px;
}

/* shimmer layer */
.poll-label::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 40%,
        rgba(255,107,0,.06) 50%,
        transparent 60%);
    transform: translateX(-100%);
    transition: transform 0s;
}

.poll-label:hover::after {
    transform: translateX(100%);
    transition: transform .55s ease;
}

.poll-label:hover {
    border-color: rgba(255,107,0,.4);
    background: rgba(255,107,0,.03);
    color: var(--text-main);
    transform: translateX(4px);
    box-shadow: -3px 0 0 0 var(--accent-primary), 0 4px 16px rgba(255,107,0,.08);
}

/* ─── Custom Radio ────────────────────────────────────────────── */
.poll-radio {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
    position: relative; z-index: 1;
}

.poll-radio::after {
    content: '';
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transform: scale(0);
    transition: opacity .2s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
}

/* ─── Checked state ───────────────────────────────────────────── */
.poll-option input[type="radio"]:checked + .poll-label {
    border-color: var(--accent-primary);
    background: rgba(255,107,0,.04);
    color: var(--text-main);
    transform: translateX(4px);
    box-shadow: -3px 0 0 0 var(--accent-primary), 0 6px 24px rgba(255,107,0,.12);
}

.poll-option input[type="radio"]:checked + .poll-label .poll-radio {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 0 4px rgba(255,107,0,.14), 0 2px 8px rgba(255,107,0,.3);
}

.poll-option input[type="radio"]:checked + .poll-label .poll-radio::after {
    opacity: 1;
    transform: scale(1);
}

.poll-opt-num {
    flex-shrink: 0;
    margin-left: auto;
    font-family: 'Archivo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    opacity: .5;
    transition: opacity .2s;
}
.poll-option input[type="radio"]:checked + .poll-label .poll-opt-num { opacity: 0; }

.poll-vote-btn {
    width: 100%;
    padding: clamp(13px, 2vw, 16px);
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: clamp(14px, 2vw, 15px);
    font-weight: 700;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, opacity .2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255,107,0,.28), inset 0 1px 0 rgba(255,255,255,.15);
    min-height: 52px;
    letter-spacing: .01em;
}

.poll-vote-btn::before {
    content: '';
    position: absolute;
    top: -50%; left: -60%;
    width: 40%; height: 200%;
    background: rgba(255,255,255,.15);
    transform: skewX(-20deg);
    transition: left .5s ease;
}

.poll-vote-btn:hover::before { left: 130%; }
.poll-vote-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(255,107,0,.38), inset 0 1px 0 rgba(255,255,255,.15); }
.poll-vote-btn:active { transform: translateY(0) scale(.98); box-shadow: 0 4px 16px rgba(255,107,0,.2); }
.poll-vote-btn:disabled { opacity: .65; pointer-events: none; }

.poll-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f6;
    gap: 8px;
    flex-wrap: wrap;
}

.poll-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.poll-stats svg { width: 14px; height: 14px; color: var(--accent-primary); flex-shrink: 0; }

.poll-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-bg);
    padding: 5px 11px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.poll-timer svg { width: 12px; height: 12px; flex-shrink: 0; }

.poll-form.hidden { display: none; }
.poll-results { display: none; }
.poll-results.visible { display: block; }

.results-title {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-title::before,
.results-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light));
}

.results-title::before { background: linear-gradient(90deg, var(--border-light), transparent); }

.result-row {
    margin-bottom: 18px;
}
.result-row:last-child { margin-bottom: 0; }

.result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.result-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.winner-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 0 3px rgba(255,107,0,.18);
    flex-shrink: 0;
    animation: winner-glow 2s ease-in-out infinite;
}

@keyframes winner-glow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255,107,0,.18); }
    50%       { box-shadow: 0 0 0 5px rgba(255,107,0,.08), 0 0 12px rgba(255,107,0,.3); }
}

.result-pct {
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 42px;
    text-align: right;
}

.winner-row .result-pct { color: var(--accent-primary); }
.winner-row .result-label { color: var(--text-main); }

/* Bar track */
.result-bar-track {
    height: 6px;
    background: #f0f2f6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.result-bar-fill {
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 1s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.result-bar-fill.winner {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 8px rgba(255,107,0,.35);
}

.result-bar-fill.winner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 70%, rgba(255,255,255,.35) 100%);
    border-radius: inherit;
}

.result-bar-fill.other {
    background: linear-gradient(90deg, #d1d5db, #e5e7eb);
}

/* your choice tag */
.your-choice-tag {
    font-family: 'Archivo', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(255,107,0,.08);
    border: 1px solid rgba(255,107,0,.2);
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ─── Vote again ──────────────────────────────────────────────── */
.vote-again-btn {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Archivo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s, transform .2s cubic-bezier(.34,1.56,.64,1);
    min-height: 44px;
    letter-spacing: .01em;
}

.vote-again-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(255,107,0,.04);
    transform: translateY(-1px);
}

/* ─── Toast ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px) scale(.9);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px 14px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.07);
    box-shadow: 0 8px 40px rgba(10,14,39,.14), 0 2px 8px rgba(10,14,39,.06);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    transition:
        transform .45s cubic-bezier(.34,1.56,.64,1),
        opacity   .35s ease;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

.toast-icon-wrap {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255,107,0,.3);
}

.toast-icon-wrap svg {
    width: 16px; height: 16px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}

.toast-text { display: flex; flex-direction: column; gap: 1px; }
.toast-text strong { font-size: 14px; color: var(--text-main); }
.toast-text span   { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ─── Loading state ───────────────────────────────────────────── */
.poll-loading {
    opacity: .5;
    pointer-events: none;
    transition: opacity .3s;
}

/* ─── Accessibility / mobile ──────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .poll-label,
    .poll-vote-btn,
    .vote-again-btn { min-height: 48px; }
}

/* ─── Print ───────────────────────────────────────────────────── */
@media print {
    .widget:has(#pollForm) { display: none; }
}