/* =========================
   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;
}

.sp-poll {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================
   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-submit {
    display: inline-block;
    vertical-align: middle;
}

.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-container {
        flex-direction: column;
    }

    .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%;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left;
}

    .sp-get-pin {
        width: 100%;
        max-width: 100%;
    }

    .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;
    }
}

.sp-leave-poll button:hover {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.sp-leave-poll button:focus {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.elementor-kit-8 .sp-leave-poll button:hover,
.elementor-kit-8 .sp-leave-poll button[type="button"]:hover,
body .sp-leave-poll button:hover,
body .sp-leave-poll button[type="button"]:hover {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.elementor-kit-8 .sp-leave-poll button:focus,
body .sp-leave-poll button:focus {
    outline: 2px solid #222 !important;
    outline-offset: 2px !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;
}