/* Refresh – Spin & Earn · light, futuristic, smooth */
:root {
    --pearl: #f5f8fc;
    --ink: #101b34;
    --ink2: #51607f;
    --line: #dfe6f3;
    --aqua: #12c2b0;
    --blue: #3d5afe;
    --sky: #7cd4ff;
    --lilac: #e7eaff;
    --sun: #ffc857;
    --danger: #e5484d;
    --ok: #0fa37f;
    --glass: rgba(255,255,255,.72);
    --r: 22px;
    --grad: linear-gradient(135deg,#12c2b0 0%,#3d5afe 100%);
    --shadow: 0 18px 50px -18px rgba(61,90,254,.28),0 2px 6px rgba(16,27,52,.04);
}

* {
    box-sizing: border-box;
    margin: 0
}

html {
    -webkit-text-size-adjust: 100%
}

body {
    font-family: 'Manrope',system-ui,sans-serif;
    color: var(--ink);
    background: var(--pearl);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden
}

h1, h2, h3, .display {
    font-family: 'Sora','Manrope',sans-serif;
    letter-spacing: -.02em;
    line-height: 1.15
}

a {
    color: var(--blue);
    text-decoration: none
}

.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 80% -10%,#e3f6ff 0,transparent 60%),radial-gradient(900px 500px at -10% 110%,#ece6ff 0,transparent 60%)
}

    .aurora i {
        position: absolute;
        border-radius: 50%;
        filter: blur(70px);
        opacity: .55;
        animation: drift 18s ease-in-out infinite alternate
    }

        .aurora i:nth-child(1) {
            width: 340px;
            height: 340px;
            background: #b9f1e8;
            top: -60px;
            left: -80px
        }

        .aurora i:nth-child(2) {
            width: 380px;
            height: 380px;
            background: #c9d4ff;
            bottom: -120px;
            right: -100px;
            animation-delay: -6s
        }

        .aurora i:nth-child(3) {
            width: 240px;
            height: 240px;
            background: #ffe9b8;
            top: 45%;
            left: 55%;
            opacity: .35;
            animation-delay: -11s
        }

@keyframes drift {
    to {
        transform: translate(40px,-30px) scale(1.12)
    }
}

.shell {
    max-width: 460px;
    margin: 0 auto;
    padding: max(18px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom))
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px 18px
}

    .brand b {
        font-family: 'Sora';
        font-size: 20px;
        letter-spacing: -.03em
    }

    .brand small {
        color: var(--ink2);
        font-size: 13px;
        margin-left: 2px
    }

.logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--grad);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px -6px rgba(61,90,254,.55)
}

.foot {
    text-align: center;
    color: var(--ink2);
    font-size: 12px;
    margin-top: 26px
}

.card {
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.95);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px
}

    .card h1 {
        font-size: 30px;
        margin-bottom: 10px
    }

    .card h2 {
        font-size: 21px;
        margin-bottom: 6px
    }

.muted {
    color: var(--ink2);
    font-size: 14px
}

.rise {
    animation: rise .7s cubic-bezier(.2,.8,.2,1) both
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px)
    }
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    cursor: pointer;
    font: 600 16px 'Manrope';
    color: #fff;
    background: var(--grad);
    padding: 15px 22px;
    border-radius: 999px;
    box-shadow: 0 12px 26px -10px rgba(61,90,254,.65);
    transition: transform .25s,box-shadow .25s,opacity .25s
}

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 30px -10px rgba(61,90,254,.7)
    }

    .btn:active {
        transform: scale(.98)
    }

    .btn:disabled {
        opacity: .45;
        cursor: not-allowed;
        transform: none;
        box-shadow: none
    }

    .btn.ghost {
        background: #fff;
        color: var(--ink);
        border: 1px solid var(--line);
        box-shadow: none
    }

    .btn.sm {
        width: auto;
        padding: 9px 16px;
        font-size: 14px
    }

    .btn.loading {
        pointer-events: none;
        opacity: .7
    }

        .btn.loading::after {
            content: "";
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255,255,255,.5);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin .7s linear infinite
        }

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

:focus-visible {
    outline: 3px solid rgba(61,90,254,.4);
    outline-offset: 2px
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin: 14px 0 6px
}

input, select, textarea {
    width: 100%;
    font: 500 16px 'Manrope';
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    transition: border-color .2s,box-shadow .2s
}

    input:focus, select:focus {
        outline: none;
        border-color: var(--blue);
        box-shadow: 0 0 0 4px rgba(61,90,254,.12)
    }

.phone {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    overflow: hidden
}

    .phone span {
        padding: 0 4px 0 16px;
        font-weight: 700;
        color: var(--ink2)
    }

    .phone input {
        border: 0;
        box-shadow: none !important;
        border-radius: 0
    }

.otp {
    display: flex;
    gap: 9px;
    justify-content: space-between;
    margin: 14px 0
}

    .otp input {
        width: 100%;
        text-align: center;
        font: 700 22px 'Sora';
        padding: 14px 0;
        border-radius: 14px
    }

.msg {
    min-height: 22px;
    font-size: 14px;
    margin: 10px 0 2px;
    font-weight: 600
}

    .msg.err {
        color: var(--danger)
    }

    .msg.ok {
        color: var(--ok)
    }

.stack > * + * {
    margin-top: 12px
}

.hero {
    padding: 30px 24px 26px;
    position: relative;
    overflow: hidden
}

    .hero h1 {
        font-size: 36px
    }

    .hero .orb {
        position: absolute;
        right: -50px;
        top: -50px;
        width: 190px;
        height: 190px;
        border-radius: 50%;
        background: conic-gradient(from 0deg,#12c2b0,#7cd4ff,#c9d4ff,#ffe9b8,#12c2b0);
        opacity: .55;
        filter: blur(2px);
        animation: spin 22s linear infinite
    }

    .hero > * {
        position: relative
    }

.steps {
    display: grid;
    gap: 10px;
    margin: 20px 0 22px
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    font-weight: 600;
    font-size: 15px
}

    .step i {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        background: var(--lilac);
        display: grid;
        place-items: center;
        font-style: normal
    }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--lilac);
    font-size: 13px;
    font-weight: 700;
    color: var(--blue)
}

.who {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start
}

    .who b {
        font-family: 'Sora';
        font-size: 17px
    }

.prod {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    animation: rise .45s both
}

    .prod b {
        display: block;
        font-size: 15px
    }

    .prod small {
        color: var(--ink2)
    }

    .prod .amt {
        font: 700 16px 'Sora';
        color: var(--ok);
        text-align: right
    }

.x {
    border: 0;
    background: #f1f4fb;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink2);
    font-size: 16px
}

.status {
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    background: #fff;
    border: 1px dashed var(--line)
}

    .status.good {
        background: #e8fbf5;
        border: 1px solid #bdeedf;
        color: #0b7a60
    }

    .status.bad {
        background: #fff0f0;
        border: 1px solid #ffd2d2;
        color: #b4232a
    }

.scanner {
    position: fixed;
    inset: 0;
    background: rgba(16,27,52,.55);
    backdrop-filter: blur(6px);
    display: none;
    place-items: center;
    z-index: 50;
    padding: 18px
}

    .scanner.on {
        display: grid
    }

    .scanner .box {
        background: #fff;
        border-radius: 26px;
        padding: 16px;
        width: 100%;
        max-width: 420px
    }

#reader {
    border-radius: 18px;
    overflow: hidden;
    min-height: 260px;
    background: #0e1830
}

/* ---- spin wheel: the one showpiece ---- */
.stage {
    position: relative;
    width: min(340px,calc(100% - 44px));
    aspect-ratio: 1;
    margin: 8px auto 22px
}
    /* 44px = room for the outer ring + glow, so it never spills out of the card */
    .stage::before {
        content: "";
        position: absolute;
        inset: -14px;
        border-radius: 50%;
        background: conic-gradient(from 0deg,#12c2b0,#7cd4ff,#c9d4ff,#ffe9b8,#12c2b0);
        filter: blur(16px);
        opacity: .6;
        animation: spin 14s linear infinite
    }

.wheel {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 8px #fff,0 0 0 9px var(--line),0 24px 50px -18px rgba(61,90,254,.55);
    transition: transform 6s cubic-bezier(.08,.72,.1,1)
}

    .wheel canvas {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        display: block
    }

.hub {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 21%;
    aspect-ratio: 1;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 24px -6px rgba(16,27,52,.35);
    display: grid;
    place-items: center;
    z-index: 2
}

    .hub svg {
        width: 56%
    }

.pointer {
    position: absolute;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    z-index: 3;
    width: 34px;
    height: 44px;
    filter: drop-shadow(0 6px 8px rgba(16,27,52,.3))
}

.amount {
    font: 800 44px 'Sora';
    text-align: center;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 2px 0 4px
}

.center {
    text-align: center
}

.done {
    width: 84px;
    height: 84px;
    margin: 6px auto 14px;
    border-radius: 50%;
    background: var(--grad);
    display: grid;
    place-items: center;
    box-shadow: 0 18px 36px -12px rgba(61,90,254,.6);
    animation: pop .8s cubic-bezier(.2,1.4,.3,1) both
}

@keyframes pop {
    from {
        transform: scale(.3);
        opacity: 0
    }
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px
}

    .kv:last-child {
        border: 0
    }

    .kv span {
        color: var(--ink2)
    }

    .kv b {
        text-align: right
    }

canvas.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60
}
/* ---- small phones ---- */
.card {
    overflow: hidden
}

@media (max-width:480px) {
    .shell {
        padding-left: 14px;
        padding-right: 14px
    }

    .card {
        padding: 20px 16px;
        border-radius: 20px
    }

        .card h1 {
            font-size: 26px
        }

    .hero h1 {
        font-size: 30px
    }

    .amount {
        font-size: 38px
    }

    .stage {
        width: min(340px,calc(100% - 36px))
    }
}

@media (max-width:360px) {
    .hero h1 {
        font-size: 26px
    }

    .amount {
        font-size: 32px
    }

    .otp {
        gap: 6px
    }

        .otp input {
            font-size: 18px;
            padding: 12px 0
        }

    .btn {
        padding: 13px 16px;
        font-size: 15px
    }
}

@media (min-width:900px) {
    .shell {
        max-width: 520px
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}

/* ---- admin ---- */
.admin {
    display: grid;
    grid-template-columns: 236px 1fr;
    min-height: 100vh
}

.side {
    padding: 22px 16px;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4px
}

    .side .brand {
        padding: 0 6px 18px
    }

    .side a.nav {
        display: block;
        padding: 11px 14px;
        border-radius: 14px;
        color: var(--ink2);
        font-weight: 600;
        font-size: 14.5px;
        transition: background .2s,color .2s
    }

        .side a.nav:hover {
            background: var(--lilac);
            color: var(--ink)
        }

        .side a.nav.on {
            background: var(--grad);
            color: #fff;
            box-shadow: 0 10px 20px -10px rgba(61,90,254,.6)
        }

    .side .me {
        margin-top: auto;
        font-size: 13px;
        color: var(--ink2);
        padding: 8px 6px
    }

.main {
    padding: 28px 30px 40px;
    max-width: 1180px;
    width: 100%
}

    .main h1 {
        font-size: 28px;
        margin-bottom: 4px
    }

.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
    gap: 14px;
    margin-bottom: 18px
}

.kpi {
    background: var(--glass);
    border: 1px solid #fff;
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow)
}

    .kpi span {
        color: var(--ink2);
        font-size: 13px;
        font-weight: 600
    }

    .kpi b {
        display: block;
        font: 800 28px 'Sora';
        margin-top: 4px
    }

.panel {
    background: var(--glass);
    border: 1px solid #fff;
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
    overflow: hidden
}

    .panel h2 {
        font-size: 17px;
        margin-bottom: 12px
    }

.scroll {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px
}

th {
    text-align: left;
    color: var(--ink2);
    font-weight: 700;
    font-size: 12.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap
}

td {
    padding: 12px;
    border-bottom: 1px solid #eef2fa;
    vertical-align: top
}

tr:last-child td {
    border: 0
}

tbody tr:hover {
    background: rgba(231,234,255,.4)
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--lilac);
    color: var(--blue)
}

    .tag.ok {
        background: #e0f8f0;
        color: #0b7a60
    }

    .tag.off {
        background: #fde8e8;
        color: #b4232a
    }

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    align-items: end
}

    .filters > * {
        width: auto;
        flex: 1 1 150px;
        padding: 11px 14px;
        font-size: 14px
    }

    .filters .btn {
        flex: 0 0 auto
    }

.bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 150px;
    padding-top: 8px
}

    .bars div {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        height: 100%;
        font-size: 12px;
        color: var(--ink2)
    }

    .bars i {
        display: block;
        width: 100%;
        max-width: 44px;
        border-radius: 12px 12px 6px 6px;
        background: var(--grad);
        min-height: 4px
    }

.pager {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 14px
}

    .pager a, .pager span {
        padding: 7px 13px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid var(--line);
        font-weight: 600;
        font-size: 13px;
        color: var(--ink)
    }

    .pager span {
        background: var(--grad);
        color: #fff;
        border: 0
    }

.flash {
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 14px
}

    .flash.ok {
        background: #e0f8f0;
        color: #0b7a60
    }

    .flash.err {
        background: #fde8e8;
        color: #b4232a
    }

pre.xml {
    background: #0f1a33;
    color: #d6e2ff;
    padding: 16px;
    border-radius: 16px;
    overflow: auto;
    font-size: 12.5px;
    max-height: 420px;
    white-space: pre-wrap;
    word-break: break-all
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

@media(max-width:860px) {
    .admin {
        grid-template-columns: 1fr
    }

    .side {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px
    }

        .side .me, .side .brand {
            display: none
        }

    .main {
        padding: 18px 14px
    }

    .grid2 {
        grid-template-columns: 1fr
    }
}

@media print {
    .aurora, .btn, .foot, .brand {
        display: none !important
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc
    }
}
