/* Reform Simple Poll — front-end styles
 * Gradients and colors transcribed from the SVG reference (POP UP DESIGN FINAL).
 */

@font-face {
    font-family: 'NotoSansReformPoll';
    src: url('fonts/NotoSans-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

.reform-poll,
.reform-poll * {
    box-sizing: border-box;
}

/* ---------- Card ---------- */
/* Layered backgrounds (top to bottom in CSS = visually front to back):
 *   1. Diagonal blue frosted overlay, strong at top-right, fades to transparent (~52%).
 *      Matches the SVG's "linear-gradient1 at .5 opacity".
 *   2. Solid white base.
 * The card itself sits inside a colored gradient ring (box-shadow + border) which
 * approximates the SVG's outer linear-gradient border glow.
 */

.reform-poll {
    font-family: 'NotoSansReformPoll', 'Noto Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-weight: 600;
    max-width: 460px;
    width: 100%;
    color: #1341a8;
    line-height: 1.25;
    border-radius: 22px;
    border: 3px solid #ffffff;
    overflow: hidden;
    background:
        linear-gradient(225deg,
            rgba(99, 155, 220, .50) 0%,
            rgba(77, 150, 213, .39) 7%,
            rgba(54, 145, 205, .27) 15%,
            rgba(35, 140, 199, .17) 24%,
            rgba(20, 137, 195, .10) 32%,
            rgba(9, 134, 191, .05) 39%,
            rgba(3, 133, 189, .01) 46%,
            rgba(1, 133, 189, 0) 52%
        ),
        #ffffff;
    box-shadow:
        0 0 0 1px rgba(7, 197, 231, .55),
        0 0 0 2px rgba(37, 105, 195, .35),
        0 14px 32px rgba(0, 0, 0, .25);
}

/* ---------- Header ---------- */
/* Layered (front to back):
 *   1. Bottom darker shadow (linear-gradient4 at .6 opacity in SVG).
 *   2. Top white highlight (linear-gradient3 with overlay blend in SVG).
 *   3. Centered radial white glow (radial-gradient in SVG).
 *   4. Base horizontal gradient #2569c3 → #07c5e7.
 */

.reform-poll .reform-poll__head {
    background:
        linear-gradient(to bottom,
            rgba(31, 30, 33, 0)   65%,
            rgba(31, 30, 33, .12) 85%,
            rgba(31, 30, 33, .25) 100%),
        linear-gradient(to top,
            rgba(255, 255, 255, 0) 55%,
            rgba(255, 255, 255, .14) 80%,
            rgba(255, 255, 255, .28) 100%),
        radial-gradient(ellipse 75% 80% at 50% 0%,
            rgba(255, 255, 255, .28) 0%,
            rgba(255, 255, 255, 0) 65%),
        linear-gradient(to right, #2569c3 0%, #07c5e7 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reform-poll .reform-poll__title {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    letter-spacing: -.02em;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.reform-poll .reform-poll__close {
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 28px !important;
    line-height: 1 !important;
    width: 28px !important;
    height: 28px !important;
    min-height: 0 !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    opacity: .92;
    transition: opacity .15s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.reform-poll .reform-poll__close:hover { opacity: 1; }

/* ---------- Body ---------- */

.reform-poll .reform-poll__body {
    background: transparent;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- Option pill ---------- */
/* SVG: cyan #15b4e4 at 10% opacity. */

.reform-poll .reform-poll__opt {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px !important;
    background: rgba(21, 180, 228, .12) !important;
    background-color: rgba(21, 180, 228, .12) !important;
    background-image: none !important;
    border: 1px solid rgba(21, 180, 228, .30) !important;
    border-radius: 999px !important;
    cursor: pointer;
    overflow: hidden;
    text-align: left !important;
    font-family: inherit !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -.02em;
    color: #1341a8 !important;
    text-shadow: none !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset !important;
    min-height: 52px;
    width: 100%;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.reform-poll .reform-poll__opt:hover,
.reform-poll .reform-poll__opt:focus,
.reform-poll .reform-poll__opt:active {
    background: rgba(21, 180, 228, .22) !important;
    background-color: rgba(21, 180, 228, .22) !important;
    color: #1341a8 !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .65) inset,
        0 2px 8px rgba(21, 132, 200, .18) !important;
}

.reform-poll.is-voted .reform-poll__opt {
    cursor: default;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset !important;
}

/* ---------- Numbered circle (commented out in PHP, styles kept for reuse) ---------- */

.reform-poll .reform-poll__num {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reform-poll .reform-poll__num--1 { background: #00c4ab !important; }
.reform-poll .reform-poll__num--2 { background: #ffee38 !important; color: #1341a8 !important; }
.reform-poll .reform-poll__num--3 { background: #ff455b !important; }

/* ---------- Label ---------- */

.reform-poll .reform-poll__label {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -.02em;
    color: #1341a8 !important;
    text-shadow: none !important;
}

/* ---------- Result bar (background only, sibling of percentage) ---------- */
/* Bar sits at z-index 1 (behind label and percentage). Slight transparency lets
 * the dark navy label remain readable when the bar covers it. The bar stretches
 * from the right edge of the option leftward as the percentage grows. */

.reform-poll .reform-poll__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 0;
    z-index: 1;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: width .7s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}

.reform-poll.is-voted .reform-poll__bar {
    opacity: 1;
    min-width: 70px;       /* keeps the percentage label always sitting on color */
}

.reform-poll .reform-poll__bar[data-color="1"] { background: rgba(0,   196, 171, .85) !important; }
.reform-poll .reform-poll__bar[data-color="2"] { background: rgba(255, 238,  56, .90) !important; }
.reform-poll .reform-poll__bar[data-color="3"] { background: rgba(255,  69,  91, .85) !important; }

/* ---------- Percentage label (sibling of bar, pinned right, on top of bar) ---------- */

.reform-poll .reform-poll__pct {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    margin-left: 10px;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -.02em;
    line-height: 1.1;
    white-space: nowrap;
    display: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.reform-poll.is-voted .reform-poll__pct { display: inline-block; }

/* Yellow → use dark navy text for readable contrast (white on yellow is bad). */
.reform-poll.is-voted .reform-poll__opt[data-opt="2"] .reform-poll__pct {
    color: #1341a8 !important;
    text-shadow: none;
}

/* ---------- Popup overlay ---------- */

.reform-poll-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, .55) !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2147483646 !important;
    opacity: 0;
    transition: opacity .25s ease;
}

.reform-poll-overlay.is-open {
    display: flex;
    opacity: 1;
}

.reform-poll-overlay .reform-poll {
    transform: translateY(8px) scale(.98);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.reform-poll-overlay.is-open .reform-poll {
    transform: translateY(0) scale(1);
}

body.reform-poll-no-scroll {
    overflow: hidden;
}

/* small screens */
@media (max-width: 480px) {
    .reform-poll .reform-poll__title { font-size: 18px !important; }
    .reform-poll .reform-poll__label { font-size: 15px !important; }
    .reform-poll .reform-poll__pct   { font-size: 15px !important; }
    .reform-poll .reform-poll__num   { width: 34px; height: 34px; font-size: 16px; }
    .reform-poll-overlay { padding: 12px; }
}
