/* =========================
   VOTEPIN SAFETY
========================= */

.sp-poll,
.sp-poll *,
.sp-competition-header,
.sp-competition-header *,
.sp-leave-poll,
.sp-leave-poll * {
    box-sizing: border-box;
}

.simple-poll-blank-page {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* =========================
   POLL CONTAINER
========================= */
.sp-poll-container {
    display: block;
}

/* =========================
   TITLE
========================= */
.sp-poll h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 20px 0 10px;
    line-height: 1.3;
}

/* =========================
   INPUTS
========================= */
.sp-name,
.sp-code,
.sp-nickname {
    font-size: 16px !important;
    padding: 12px 16px;
    height: 48px;
    border: 1px solid #ccc;
    border-radius: 20px !important;
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
    padding-left: 14px !important;
    

}

.sp-code {
    margin-top: 12px;
}

.sp-name::placeholder,
.sp-code::placeholder,
.sp-nickname::placeholder {
    font-size: 14px;
    color: #999;
    padding-left: 14px !important;
}

.sp-name:focus,
.sp-code:focus,
.sp-nickname:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24,119,242,0.2);
}

/* =========================
   NAME ROW
========================= */
.sp-name-row {
    display: block;
    margin-bottom: 12px;
    max-width: 100%;
}

/* =========================
   PIN ROW (FIXED CLEAN)
========================= */
.sp-pin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.sp-get-pin {
    flex: 0 0 auto;
    max-width: 120px;
    white-space: nowrap;
}

.sp-code {
    flex: 1;
    min-width: 0;
}

/* =========================
   OPTIONS
========================= */
.sp-option {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    column-gap: 14px;
    margin: 12px 0;
    padding: 14px 12px 14px 8px;
    background: #e4e6eb;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.sp-option:hover {
    background: #d8dadf;
}

/* =========================
   CUSTOM RADIO DOT
========================= */

/* Hide the real browser radio, but keep it working */
.sp-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* Create our own visible radio circle */
.sp-option::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid #222;
    border-radius: 50%;
    background: #fff;
    position: relative;
    z-index: 3;
    justify-self: start;
}

/* Filled dot when selected */
.sp-option:has(input[type="radio"]:checked)::before {
    background: radial-gradient(circle, #222 42%, #fff 46%);
    border-color: #222;
}

/* Hover state */
.sp-option:hover::before {
    border-color: #222;
}

/* Keep selected dot strong on hover */
.sp-option:hover:has(input[type="radio"]:checked)::before {
    background: radial-gradient(circle, #222 42%, #fff 46%);
    border-color: #222;
}

.sp-option span {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.sp-option:has(input[type="radio"]:checked) {
    background: #dbeafe;
    border-color: #1877f2;
}

/* =========================
   INLINE RESULTS
========================= */
.sp-inline-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(24,119,242,0.2);
    transition: width 0.4s ease;
}

.sp-inline-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

/* =========================
   SUBMIT BUTTON
========================= */
.sp-submit {
    display: block;
    width: fit-content;
    margin-top: 14px;
    margin-bottom: 30px;
    margin-left: 0;
    margin-right: auto;
    padding: 12px 20px;
    background: #1877f2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.sp-submit:hover {
    background: #166fe5;
}

.sp-submit:disabled {
    opacity: 0.6;
}

.sp-get-pin {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.sp-get-pin:disabled,
.sp-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sp-total-votes {
    display: inline-block;
    margin-left: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    vertical-align: middle;
}

/* =========================
   MOBILE FIXES
========================= */
@media (max-width: 768px) {

    .sp-poll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 30px;
}

    .sp-pin-row {
        flex-direction: column;
        align-items: stretch;
    }

        .sp-get-pin {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: auto !important;
        text-align: left;
    }

    .sp-code {
        width: 100%;
    }

    .sp-name,
.sp-code,
.sp-nickname {
    font-size: 17px !important;
    height: 52px;
    padding: 14px 16px;
}

    .sp-option {
        padding: 14px;
    }

    .sp-option span {
        font-size: 16px;
    }

    .sp-submit {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }
}
.sp-message {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: #222;
    border: 1px solid #1877f2;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sp-message.sp-error {
    border-color: #b32d2e;
}

.sp-message.sp-success {
    border-color: #1877f2;
}

.sp-option.sp-selected {
    background: rgba(40, 167, 69, 0.15);
    border-radius: 6px;
    padding: 6px;
}

.simple-poll-blank-page {
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    min-height: 100vh;
    overflow-y: auto;
}

.simple-poll-blank-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 24px;
    box-sizing: border-box;
}

.simple-poll-blank-wrapper .sp-poll {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.sp-competition-header {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 24px auto;
    padding: 24px 20px;
    text-align: center;
    background: #222;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.sp-competition-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
}

.sp-competition-header p {
    margin: 12px 0 0 0;
    font-size: 16px;
    line-height: 1.5;
}
/* =========================
   SAFE MOBILE OPTION TITLES
========================= */

.sp-option span {
    overflow-wrap: anywhere;
    word-break: normal;
    padding-right: 82px;
}

@media (max-width: 480px) {
    .sp-option {
        grid-template-columns: 22px 1fr;
        padding: 14px 12px;
    }

    .sp-option span {
        font-size: 15px;
        line-height: 1.25;
        padding-right: 74px;
    }

    .sp-inline-label {
        right: 10px;
        font-size: 13px;
    }

}

/* =========================
   FIXED COMPETITION HEADER COLOURS
========================= */

.sp-competition-header {
    background: #222 !important;
    color: #fff !important;
}

.sp-competition-header h1,
.sp-competition-header p {
    color: #fff !important;
}

/* =========================
   VOTEPIN PORTABLE LAYOUT
   Works in normal pages, Astra, Elementor, and blank template
========================= */

/* Main poll container */
.sp-poll {
    width: 100% !important;
    max-width: var(--vp-poll-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sp-poll * {
    box-sizing: border-box;
}

/* Wrapper safety */
.sp-poll-container,
.simple-poll-blank-wrapper,
.votepin-polls-wrapper {
    width: 100% !important;
}

/* Elementor shortcode widget safety only */
.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-widget-container {
    display: block !important;
    width: 100% !important;
}

/* Force each option onto its own vertical row */
.sp-poll label.sp-option {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    margin: 12px 0 !important;
    position: relative !important;
}

/* Option title */
.sp-poll .sp-option span {
    min-width: 0 !important;
    padding-right: 82px !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    position: relative !important;
    z-index: 3 !important;
}

/* Result percentage/count */
.sp-poll .sp-inline-label {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    white-space: nowrap !important;
    z-index: 4 !important;
}

/* Result bar behind content */
.sp-poll .sp-inline-bar {
    position: absolute !important;
    z-index: 1 !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
}

/* Space between multiple polls */
.sp-poll + .sp-poll {
    margin-top: 24px !important;
}

/* Mobile */
@media (max-width: 600px) {
    .sp-poll {
        max-width: 520px !important;
    }

    .sp-poll label.sp-option {
        grid-template-columns: 20px minmax(0, 1fr) !important;
        margin: 10px 0 !important;
    }

    .sp-poll .sp-option span {
        padding-right: 72px !important;
    }

    .sp-poll .sp-inline-label {
        right: 10px !important;
        font-size: 13px !important;
    }
}

/* =========================
   LEAVE POLL LINK BUTTON
   Uses <a>, not <button>, to avoid Elementor button overrides
========================= */

.sp-leave-poll {
    width: 100%;
    max-width: var(--vp-poll-width, 720px);
    margin: -8px auto 20px auto;
    text-align: left;
}

.sp-leave-poll .sp-leave-poll-button,
.sp-leave-poll .sp-leave-poll-button:visited,
.sp-leave-poll .sp-leave-poll-button:active,
.sp-leave-poll .sp-leave-poll-button:focus {
    display: inline-block !important;
    background-color: #222 !important;
    border: 1px solid #222 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    cursor: pointer !important;
}

.sp-leave-poll .sp-leave-poll-button:hover {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-decoration: underline !important;
}

@media (max-width: 600px) {
    .sp-leave-poll {
        max-width: 520px;
        padding: 0 4px;
    }

    .sp-leave-poll .sp-leave-poll-button {
        font-size: 14px !important;
    }
}

/* =========================
   COMPETITION HEADER WYSIWYG CONTENT
========================= */

.sp-competition-subtitle {
    margin-top: 12px;
    color: #fff;
    line-height: 1.5;
}

.sp-competition-subtitle p {
    margin: 0 0 10px 0;
}

.sp-competition-subtitle p:last-child {
    margin-bottom: 0;
}

.sp-competition-subtitle a {
    color: #fff;
    text-decoration: underline;
}

.sp-competition-subtitle ul,
.sp-competition-subtitle ol {
    display: inline-block;
    text-align: left;
    margin: 10px auto;
}

/* =========================
   Contact / Early Access Page
========================= */

.vp-contact-intro {
    max-width: 820px;
    margin: 0 auto 34px;
    text-align: center;
}

.vp-contact-intro h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.vp-contact-intro p:last-child {
    max-width: 740px;
    margin: 20px auto 0;
    color: var(--vp-theme-muted);
    font-size: 19px;
}

.vp-contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
    gap: 20px;
    margin-top: 30px;
}

.vp-contact-card {
    padding: 30px;
    border-radius: var(--vp-theme-radius);
    background: #fff;
    box-shadow: var(--vp-theme-shadow);
    border: 1px solid rgba(16,32,51,0.08);
}

.vp-contact-card h2 {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.vp-contact-card p {
    color: var(--vp-theme-muted);
}

.vp-contact-card ul {
    margin: 14px 0 0;
    padding-left: 20px;
}

.vp-contact-card li {
    margin: 9px 0;
}

.vp-contact-card-highlight {
    background: var(--vp-theme-bg);
    color: #fff;
}

.vp-contact-card-highlight h2 {
    color: #fff;
}

.vp-contact-card-highlight p {
    color: rgba(255,255,255,0.76);
}

.vp-contact-note {
    margin-top: 32px;
    padding: 30px;
    border-radius: var(--vp-theme-radius);
    background: linear-gradient(180deg, #ffffff 0%, #f3edff 100%);
    border: 1px solid rgba(124,92,255,0.2);
    text-align: center;
}

.vp-contact-note h2 {
    margin: 0 0 10px;
    font-size: 32px;
    letter-spacing: -0.035em;
}

.vp-contact-note p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--vp-theme-muted);
}

@media (max-width: 820px) {
    .vp-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Desktop Get PIN alignment
========================= */

@media (min-width: 769px) {

    .sp-pin-row .sp-get-pin {
        margin-top: 12px !important;
        min-height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* =========================
   Voter security notice
========================= */

.sp-security-notice {
    width: 100%;
    max-width: var(--vp-poll-width, 720px);
    margin: 0 auto 18px auto;
    padding: 13px 15px;
    border-left: 4px solid #f59e0b;
    border-radius: 14px;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 14px;
    line-height: 1.45;
    box-sizing: border-box;
}

.sp-security-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #7c2d12;
}

@media (max-width: 600px) {
    .sp-security-notice {
        max-width: 100%;
        font-size: 13px;
    }
}

/* =========================
   Vote option alignment fix
========================= */

.sp-poll .sp-option {
    text-align: left !important;
    justify-content: flex-start !important;
}

.sp-poll .sp-option span {
    display: inline-block !important;
    text-align: left !important;
    width: auto !important;
    flex: 1 1 auto !important;
}

/* =========================
   Vote button + total votes row
========================= */

.sp-vote-actions-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    margin-top: 14px !important;
    margin-bottom: 10px !important;
}

.sp-vote-actions-row .sp-submit {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.sp-vote-actions-row .sp-total-votes {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
}

@media (max-width: 480px) {
    .sp-vote-actions-row {
        gap: 10px !important;
    }

    .sp-vote-actions-row .sp-total-votes {
        font-size: 13px !important;
    }
}

/* =========================
   Closed / Private Voting form clarity
========================= */

.sp-private-voting-instructions {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef2ff;
    border: 1px solid rgba(79, 70, 229, 0.22);
    color: #1f2937;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.sp-private-voting-instructions strong {
    color: #3730a3;
}

.sp-private-pin-row .sp-code {
    width: 100%;
}

/* Safety fallback: if a Get PIN button is accidentally rendered in private mode, hide it. */
.sp-poll[data-security-mode="closed_private"] .sp-get-pin,
.sp-poll[data-security-mode="closed_private"] .sp-nickname-row {
    display: none !important;
}

    .sp-poll label.sp-option > span {
        font-size: 14px !important;
    }

    .sp-poll label.sp-option .sp-inline-label {
        font-size: 11px !important;
    }
}

/* =========================
   Contact page mobile button fix
========================= */

@media (max-width: 600px) {

    .vp-contact-card-highlight .vp-button,
    .vp-contact-card-highlight .vp-early-access-button,
    .vp-contact-card-highlight .wp-block-button__link,
    .vp-contact-card-highlight a[href="#votepin-early-access"] {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 44px !important;
        padding: 10px 12px !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: 0 !important;
        font-size: 13px !important;
        font-weight: 900 !important;
        box-sizing: border-box !important;
    }

    .vp-contact-card-highlight {
        padding-left: 22px !important;
        padding-right: 22px !important;
    }
}

/* =========================
   Public page mobile white-container padding tidy
   Reduces inner squeeze on demo, contact, pricing and content cards
========================= */

@media (max-width: 700px) {

    /* Gutenberg/WordPress white content groups */
    body.page .wp-block-group.has-background,
    body.page .wp-block-cover,
    body.page .wp-block-media-text,
    body.simple-poll-blank-page .wp-block-group.has-background,
    body.votepin-polls-page .wp-block-group.has-background {
        padding-left: 14px !important;
        padding-right: 14px !important;
        box-sizing: border-box !important;
    }

    /* VotePin public content cards */
    .vp-contact-card,
    .vp-contact-note,
    .vp-pricing-card,
    .vp-pricing-package,
    .vp-demo-card,
    .vp-page-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
        box-sizing: border-box !important;
    }

    /* Reduce nested squeeze where a poll sits inside a page/group/card */
    body.simple-poll-blank-page .sp-poll,
    body.votepin-polls-page .sp-poll {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

@media (max-width: 420px) {

    body.page .wp-block-group.has-background,
    body.page .wp-block-cover,
    body.page .wp-block-media-text,
    body.simple-poll-blank-page .wp-block-group.has-background,
    body.votepin-polls-page .wp-block-group.has-background {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .vp-contact-card,
    .vp-contact-note,
    .vp-pricing-card,
    .vp-pricing-package,
    .vp-demo-card,
    .vp-page-card {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}