/* =========================================================
   SPIN & WIN — PROFESSIONAL THEME
   Palette: #716DAD + White + Black
   ========================================================= */

:root {
    --sw-purple: #716DAD;
    --sw-purple-dark: #5c578f;
    --sw-purple-soft: #f1eff8;
    --sw-white: #ffffff;
    --sw-black: #17161c;
    --sw-muted: #686674;
    --sw-border: #e6e4ed;
    --sw-shadow: 0 28px 80px rgba(0, 0, 0, .22);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Arial, sans-serif;

    color: var(--sw-black);
    background: #f8f7fb;
}

body.sw-modal-open {
    overflow: hidden;
}


/* =========================================================
   DEMO PAGE
   ========================================================= */

.sw-demo-header {
    background: #fff;
    border-bottom: 1px solid var(--sw-border);
}

.sw-demo-container {
    width: min(1180px, calc(100% - 40px));
    min-height: 76px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.sw-demo-logo {
    color: var(--sw-purple);

    font-size: 18px;
    font-weight: 800;
    letter-spacing: .04em;
}

.sw-demo-header nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.sw-demo-header nav a {
    color: var(--sw-black);

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
}

.sw-demo-main {
    min-height: calc(100vh - 140px);
}

.sw-demo-hero {
    min-height: 620px;

    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;

    display: flex;
    align-items: center;
}

.sw-demo-eyebrow {
    display: inline-block;

    margin-bottom: 16px;
    padding: 8px 13px;

    border-radius: 999px;

    background: var(--sw-purple-soft);
    color: var(--sw-purple);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.sw-demo-hero h1 {
    max-width: 720px;

    margin: 0 0 18px;

    font-size: clamp(42px, 6vw, 76px);
    line-height: .98;
    letter-spacing: -.055em;
}

.sw-demo-hero p {
    max-width: 550px;

    margin: 0 0 28px;

    color: var(--sw-muted);

    line-height: 1.7;
}

.sw-demo-hero button {
    border: 0;

    padding: 14px 23px;

    border-radius: 9px;

    background: var(--sw-purple);
    color: #fff;

    font-weight: 700;
}

.sw-demo-footer {
    padding: 28px 20px;

    text-align: center;

    background: #fff;
    border-top: 1px solid var(--sw-border);
}

.sw-demo-footer p {
    margin: 0;

    color: var(--sw-muted);

    font-size: 13px;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.sw-overlay {
    position: fixed;
    inset: 0;

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;

    background: rgba(23, 22, 28, .72);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.sw-overlay.sw-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   MODALS
   ========================================================= */

.sw-modal {
    position: relative;

    width: 100%;

    background: #fff;

    border-radius: 24px;

    box-shadow: var(--sw-shadow);

    overflow: hidden;

    animation: swModalIn .4s cubic-bezier(.22, 1, .36, 1);
}

.sw-modal[hidden] {
    display: none !important;
}

@keyframes swModalIn {

    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.sw-close {
    position: absolute;

    top: 50px;
    right: 14px;

    z-index: 100;

    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: 2px solid rgba(0, 0, 0, .12);
    border-radius: 50%;

    background: #fff;
    color: var(--sw-black);

    font-family: Arial, sans-serif;
    font-size: 32px;
    line-height: 1;
    font-weight: 400;

    cursor: pointer;

    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);

    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.sw-close:hover {
    background: var(--sw-purple);
    color: #fff;
    border-color: var(--sw-purple);

    transform: rotate(90deg) scale(1.05);
}


/* =========================================================
   WHEEL MODAL
   ========================================================= */

.sw-wheel-modal {
    max-width: 940px;
}

.sw-modal-content {
    min-height: 570px;

    display: grid;

    grid-template-columns: .88fr 1.12fr;
}


/* =========================================================
   LEFT HEADING
   ========================================================= */

.sw-heading {
    position: relative;

    z-index: 2;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 55px 42px 55px 52px;

    background: #fff;
}

.sw-eyebrow {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    width: fit-content;

    margin-bottom: 17px;
    padding: 7px 12px;

    border-radius: 999px;

    background: var(--sw-purple-soft);
    color: var(--sw-purple);

    font-size: 10px;
    line-height: 1;
    font-weight: 800;

    letter-spacing: .13em;
}

.sw-eyebrow::before {
    content: "";

    width: 6px;
    height: 6px;

    flex: 0 0 6px;

    border-radius: 50%;

    background: var(--sw-purple);
}

.sw-heading h2 {
    margin: 0 0 15px;

    color: var(--sw-black);

    font-size: clamp(42px, 5vw, 62px);
    line-height: .98;

    letter-spacing: -.055em;
}

.sw-heading p {
    max-width: 360px;

    margin: 0;

    color: var(--sw-muted);

    font-size: 15px;
    line-height: 1.7;
}


/* =========================================================
   WHEEL SIDE
   ========================================================= */

.sw-wheel-wrapper {
    position: relative;

    min-height: 570px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--sw-purple);

    overflow: hidden;
}


/* Decorative circles */

.sw-wheel-wrapper::before,
.sw-wheel-wrapper::after {
    content: "";

    position: absolute;

    border: 1px solid rgba(255, 255, 255, .13);

    border-radius: 50%;

    pointer-events: none;
}

.sw-wheel-wrapper::before {
    width: 470px;
    height: 470px;
}

.sw-wheel-wrapper::after {
    width: 570px;
    height: 570px;
}


/* =========================================================
   POINTER
   ========================================================= */

.sw-pointer {
    position: absolute;

    top: 47px;
    left: 50%;

    z-index: 10;

    width: 0;
    height: 0;

    transform: translateX(-50%);

    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 30px solid #fff;

    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .25));
}

.sw-pointer span {
    position: absolute;

    top: -34px;
    left: -7px;

    width: 14px;
    height: 14px;

    border-radius: 50%;

    background: #fff;
}


/* =========================================================
   WHEEL
   ========================================================= */

.sw-wheel {
    position: relative;

    z-index: 5;

    width: min(410px, 68vw);

    aspect-ratio: 1;

    border-radius: 50%;

    overflow: hidden;

    background: #fff;

    border: 10px solid #fff;

    box-shadow:
        0 20px 45px rgba(0, 0, 0, .24),
        0 0 0 2px rgba(255, 255, 255, .25);

    transform: rotate(0deg);

    transform-origin: center;
}


/* =========================================================
   WHEEL SEGMENTS
   ========================================================= */

.sw-segment {
    position: absolute;

    top: 0;
    left: 0;

    width: 50%;
    height: 50%;

    transform-origin: 100% 100%;

    display: block;

    clip-path: polygon(
        100% 100%,
        0 0,
        100% 0
    );
}


/* =========================================================
   PRIZE LABELS
   ========================================================= */

/*
   IMPORTANT:

   Each segment is a triangle with these points:

   (0%,0%) ───────── (100%,0%)
                    │
                    │
                    │
                    ● (100%,100%)

   Its geometric center is:

   X = 66.6667%
   Y = 33.3333%

   Therefore every prize starts from the exact
   same relative point in its own slice.
*/

.sw-segment span {
    position: absolute;

    left: 72%;
    top: 33.3333%;

    width: 115px;

    margin: 0;
    padding: 0;

    color: var(--sw-black);

    text-align: center;

    white-space: nowrap;

    font-size: 18px;
    line-height: 1;

    font-weight: 900;

    letter-spacing: -.025em;

    transform:
        translate(-50%, -50%)
        rotate(-30deg);

    transform-origin: center center;
}


/* =========================================================
   SEGMENT COLORS
   ========================================================= */

.sw-segment-1,
.sw-segment-3,
.sw-segment-5 {
    background: #fff;
}

.sw-segment-2,
.sw-segment-4,
.sw-segment-6 {
    background: #f0eef7;
}


/* =========================================================
   SEGMENT ROTATIONS
   ========================================================= */

.sw-segment-1 {
    transform: rotate(0deg);
}

.sw-segment-2 {
    transform: rotate(60deg);
}

.sw-segment-3 {
    transform: rotate(120deg);
}

.sw-segment-4 {
    transform: rotate(180deg);
}

.sw-segment-5 {
    transform: rotate(240deg);
}

.sw-segment-6 {
    transform: rotate(300deg);
}


/* =========================================================
   PURPLE TEXT
   ========================================================= */

.sw-segment-2 span,
.sw-segment-4 span,
.sw-segment-6 span {
    color: var(--sw-purple);
}


/* =========================================================
   CENTER SPIN BUTTON
   ========================================================= */

.sw-spin-button {
    position: absolute;

    top: 50%;
    left: 50%;

    z-index: 12;

    width: 94px;
    height: 94px;

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 8px solid #fff;
    border-radius: 50%;

    background: var(--sw-purple);
    color: #fff;

    cursor: pointer;

    box-shadow: 0 10px 28px rgba(0, 0, 0, .23);

    transition:
        background .25s ease,
        transform .25s ease;
}

.sw-spin-button:hover {
    background: var(--sw-purple-dark);

    transform:
        translate(-50%, -50%)
        scale(1.06);
}

.sw-spin-button:active {
    transform:
        translate(-50%, -50%)
        scale(.98);
}

.sw-spin-button:disabled {
    cursor: not-allowed;
    opacity: .8;
}

.sw-spin-button span {
    font-size: 15px;
    line-height: 1;

    font-weight: 900;

    letter-spacing: .08em;
}

.sw-spin-button small {
    margin-top: 4px;

    font-size: 8px;
    line-height: 1;

    font-weight: 700;

    letter-spacing: .12em;

    opacity: .8;
}


/* =========================================================
   WHEEL FOOTER
   ========================================================= */

.sw-wheel-footer {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 19px;

    z-index: 10;

    text-align: center;
}

.sw-wheel-note {
    color: rgba(255, 255, 255, .78);

    font-size: 11px;
    font-weight: 600;

    letter-spacing: .04em;
}


/* =========================================================
   RESULT MODAL
   ========================================================= */

.sw-result-modal {
    max-width: 510px;
}

.sw-result-content {
    padding: 44px 44px 40px;

    text-align: center;
}


/* =========================================================
   RESULT ICON
   ========================================================= */

.sw-result-icon {
    width: 62px;
    height: 62px;

    margin: 0 auto 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--sw-purple);
    color: #fff;

    font-size: 25px;
    font-weight: 800;
}

.sw-result-content > .sw-eyebrow {
    margin-bottom: 13px;
}


/* =========================================================
   RESULT TITLE
   ========================================================= */

.sw-result-content h2 {
    margin: 0 0 13px;

    color: var(--sw-black);

    font-size: 34px;
    line-height: 1;

    letter-spacing: -.04em;
}


/* =========================================================
   WINNING DISCOUNT
   ========================================================= */

.sw-winning-discount {
    display: flex;

    align-items: center;
    justify-content: center;

    width: fit-content;
    min-width: 150px;

    margin: 0 auto 16px;

    padding: 13px 24px;

    border-radius: 10px;

    background: var(--sw-purple);
    color: #fff;

    font-size: 27px;
    line-height: 1;

    font-weight: 900;

    letter-spacing: -.03em;

    text-align: center;
}


/* =========================================================
   RESULT DESCRIPTION
   ========================================================= */

.sw-result-description {
    max-width: 390px;

    margin: 0 auto 27px;

    color: var(--sw-muted);

    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   FORM
   ========================================================= */

.sw-form {
    display: flex;
    flex-direction: column;

    gap: 14px;

    text-align: left;
}

.sw-field {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.sw-field label {
    color: var(--sw-black);

    font-size: 12px;
    font-weight: 750;
}

.sw-field input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    border: 1px solid var(--sw-border);
    border-radius: 9px;

    background: #fff;
    color: var(--sw-black);

    font-family: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.sw-field input::placeholder {
    color: #a3a1aa;
}

.sw-field input:focus {
    border-color: var(--sw-purple);

    box-shadow:
        0 0 0 3px rgba(113, 109, 173, .12);
}

.sw-field.sw-invalid input {
    border-color: #d65f6b;
}

.sw-error {
    min-height: 0;

    color: #c94c59;

    font-size: 11px;
}


/* =========================================================
   SUBMIT BUTTON
   ========================================================= */

.sw-submit {
    position: relative;

    width: 100%;

    min-height: 51px;

    margin-top: 4px;

    border: 0;
    border-radius: 9px;

    background: var(--sw-purple);
    color: #fff;

    font-family: inherit;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

.sw-submit:hover {
    background: var(--sw-purple-dark);

    transform: translateY(-1px);

    box-shadow:
        0 9px 22px rgba(113, 109, 173, .28);
}

.sw-submit:disabled {
    cursor: not-allowed;
    opacity: .75;
}


/* =========================================================
   SUBMIT LOADER
   ========================================================= */

.sw-submit-loader {
    display: none;

    width: 16px;
    height: 16px;

    margin: 0 auto;

    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;

    border-radius: 50%;

    animation: swSpin .7s linear infinite;
}

.sw-submit.sw-loading .sw-submit-text {
    display: none;
}

.sw-submit.sw-loading .sw-submit-loader {
    display: block;
}

@keyframes swSpin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   FORM NOTE
   ========================================================= */

.sw-form-note {
    margin: 1px 0 0;

    color: #9997a1;

    font-size: 10.5px;
    line-height: 1.5;

    text-align: center;
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 780px) {

    .sw-overlay {
        padding: 12px;
    }

    .sw-modal-content {
        display: block;

        max-height: 94vh;

        overflow-y: auto;
    }

    .sw-heading {
        min-height: 245px;

        padding: 38px 30px 25px;

        text-align: center;

        align-items: center;
    }

    .sw-heading h2 {
        font-size: 42px;
    }

    .sw-heading p {
        max-width: 420px;

        font-size: 14px;
    }

    .sw-wheel-wrapper {
        min-height: 430px;

        padding: 30px 15px 48px;
    }

    .sw-pointer {
        top: 18px;
    }

    .sw-wheel {
        width: min(330px, 78vw);

        border-width: 8px;
    }

    .sw-wheel-footer {
        bottom: 15px;
    }

    .sw-result-content {
        padding: 38px 27px 32px;
    }

}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .sw-demo-container {
        width: calc(100% - 28px);
    }

    .sw-demo-header nav {
        display: none;
    }

    .sw-demo-hero {
        width: calc(100% - 28px);

        min-height: 500px;
    }

    .sw-demo-hero h1 {
        font-size: 46px;
    }


    /* Heading */

    .sw-heading {
        min-height: 220px;

        padding: 34px 22px 22px;
    }

    .sw-heading h2 {
        font-size: 35px;
    }

    .sw-heading p {
        font-size: 13px;
    }


    /* Wheel */

    .sw-wheel-wrapper {
        min-height: 370px;

        padding-top: 25px;
    }

    .sw-wheel {
        width: min(285px, 79vw);

        border-width: 7px;
    }


    /* Pointer */

    .sw-pointer {
        top: 10px;

        border-left-width: 11px;
        border-right-width: 11px;
        border-top-width: 25px;
    }

    .sw-pointer span {
        width: 11px;
        height: 11px;

        left: -5.5px;
        top: -29px;
    }


    /* =====================================================
       MOBILE WHEEL TEXT
       Same geometric positioning as desktop
       ===================================================== */

    .sw-segment span {
        left: 70%;
        top: 33.3333%;

        width: 82px;

        margin: 0;
        padding: 0;

        font-size: 14px;

        transform:
            translate(-50%, -50%)
            rotate(-30deg);
    }


    /* Spin button */

    .sw-spin-button {
        width: 72px;
        height: 72px;

        border-width: 6px;
    }

    .sw-spin-button span {
        font-size: 11px;
    }

    .sw-spin-button small {
        font-size: 7px;
    }


    /* Result modal */

    .sw-result-modal {
        border-radius: 18px;
    }

    .sw-result-content {
        padding: 34px 20px 28px;
    }

    .sw-result-content h2 {
        font-size: 30px;
    }


    /* Winning discount */

    .sw-winning-discount {
        min-width: 145px;

        padding: 12px 21px;

        font-size: 24px;

        text-align: center;
    }


    /* BIG CLOSE BUTTON */

    .sw-close {
        top: 10px;
        right: 10px;

        width: 42px;
        height: 42px;

        font-size: 29px;
        line-height: 42px;

        border-width: 2px;
    }

}


/* =========================================================
   RESPONSIVE — SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .sw-heading h2 {
        font-size: 31px;
    }

    .sw-wheel-wrapper {
        min-height: 345px;
    }

    .sw-wheel {
        width: 260px;
    }


    /* Small-screen wheel labels */

    .sw-segment span {
        left: 70%;
        top: 33.3333%;

        width: 76px;

        font-size: 12px;

        transform:
            translate(-50%, -50%)
            rotate(-30deg);
    }


    .sw-spin-button {
        width: 66px;
        height: 66px;
    }

}