@import url("normalize.css");

:root {
    --primary: #0071E3;
    --primary40: #EDF5FD;
    --bg: #0b1020;
    --card: #121832;
    --muted: #97a1c0;
    --text: #eef2ff;
    --accent: #7c9dff;
    --ok: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
}

* {
    box-sizing: border-box
}

html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 20% -10%, #1c2650, transparent), linear-gradient(180deg, #0b1020, #0a0f1c);
    color: var(--text);
    font-family: 'Gilroy', sans-serif;
    line-height: 1.4;
}

.global-upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(5, 7, 15, .55);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
}

.global-upload-box {
    min-width: 220px;
    max-width: 90vw;
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    padding: 18px 20px;
    color: #eef2ff;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.global-upload-box .spinner {
    width: 22px;
    height: 22px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #7c9dff;
    animation: guloadspin .8s linear infinite;
}

@keyframes guloadspin {
    to {
        transform: rotate(360deg);
    }
}

.wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 15px
}

.card {
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
    padding: 20px
}

h1 {
    font-size: 28px;
    margin: 0 0 8px
}

.grid {
    display: grid;
    grid-template-columns:1.1fr .9fr;
    gap: 20px
}

.panel {
    background: var(--card);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .06)
}

.video_wrap {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #05070f;
}

.video_wrap video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    transform: scaleX(-1);
    transform-origin: center;
}


video, canvas {
    width: 100%;
    height: auto;
    display: block
}

.overlay {
    position: absolute;
    inset: 0;
    pointer-events: none
}

.video_hint {
    margin-bottom: 15px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.step {
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 12px
}

.step h3 {
    font-size: 15px;
    margin: 0 0 6px;
    font-weight: 700;
}

.step .muted {
    font-size: 14px;
}

.pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

.pill.wait {
    background: rgba(255, 255, 255, .08);
    color: #ddd
}

.pill.live {
    background: rgba(251, 191, 36, .15);
    border: 1px solid rgba(251, 191, 36, .4);
    color: #fcd34d
}

.pill.ok {
    background: rgba(52, 211, 153, .18);
    border: 1px solid rgba(52, 211, 153, .45);
    color: #a7f3d0
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

button {
    background-color: var(--primary40, #EDF5FD);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    fill: var(--primary, #0071E3);
    color: var(--primary, #0071E3);
    border: unset;
    border-radius: 10px;
    padding: 10px 25px 10px 25px;
    cursor: pointer;
    transition: .2s
}

button:hover {
    transform: translateY(-2px);
    background-color: var(--primary, #0071E3);
    color: #fff;
    fill: #fff;
}

button.primary {
    background-color: var(--primary, #0071E3);
    color: #fff;
    fill: #fff;
}

button.red {
    background-color: #E53935 !important;
    color: #fff !important;
    fill: #fff !important;
}

button.red:hover {
    background-color: #C62828 !important;
    color: #fff !important;
    fill: #fff !important;
}

.meter {
    height: 10px;
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    overflow: hidden
}

.meter > i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #7c9dff, #34d399);
    transition: width .25s linear
}

.log {
    font-family: 'Gilroy', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #0a0e1b;
    border-radius: 12px;
    padding: 10px;
    max-height: 180px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .06)
}

.badge {
    font-size: 14px;
    color: #c7d2fe
}

.muted {
    color: var(--muted)
}

a.link {
    color: #a5b4fc
}

.gate_overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: radial-gradient(1200px 700px at 20% -10%, rgba(124, 157, 255, .20), transparent),
    linear-gradient(180deg, #0b1020, #0a0f1c);
    backdrop-filter: blur(10px);
}

.gate_card {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
    align-content: center;
    width: min(560px, 92vw);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 28px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    text-align: center;
    color: var(--text);
    animation: gate-pop .28s ease-out both;
}

.gate_logo img, .card_logo img {
    min-width: 150px;
    margin-bottom: 10px;
}

.card_logo {
    text-align: center;
}

.gate_icon {
    color: #a5b4fc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: rgba(124, 157, 255, .12);
    border: 1px solid rgba(124, 157, 255, .35);
    margin-right: auto;
    margin-left: auto;
}

.gate_card h2 {
    font-size: 20px;
    font-weight: 700;
}

.gate_card .muted {
    color: var(--muted);
    font-size: 15px;
}

.gate_actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.qr_wrap {
    margin-top: 12px;
    display: grid;
    place-items: center;
}

#qrcode > img,
#qrcode > canvas {
    width: 180px;
    height: 180px;
    image-rendering: pixelated;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    background: #060912;
    border: 1px solid rgba(255, 255, 255, .08);
}

@keyframes gate-pop {
    from {
        transform: translateY(8px) scale(.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gate_card {
        animation: none;
    }
}

body.gated .wrap {
    filter: blur(2px) saturate(90%);
    pointer-events: none;
    user-select: none;
}

.wizard {
    display: grid;
    gap: 30px;
}

.wizard_header {
    display: grid;
    gap: 20px;
}

.wizard_steps {
    display: grid;
    grid-template-columns: 1fr 40px 1fr 40px 1fr;
    align-items: center;
    gap: 5px;
}

.wizard_step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 10px;
    color: var(--muted);
    transition: .2s;
}

.wizard_step.is-active {
    color: var(--text);
    border-color: rgba(124, 157, 255, .45);
    box-shadow: 0 6px 22px rgba(124, 157, 255, .12);
}

.wizard_step.is-done {
    color: var(--text);
    opacity: .9;
}

.wizard_dot {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(124, 157, 255, .18);
    border: 1px solid rgba(124, 157, 255, .45);
    font-weight: 700;
    font-size: 13px;
    color: #c7d2fe;
}

.wizard_label {
    font-size: 13px;
    font-weight: 600;
}

.wizard_connector {
    height: 2px;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
}

.wizard_progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
}

.wizard_progress .wizard_bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--ok));
    width: 50%;
    transition: width .25s ease;
}

.wizard_panel {
    display: none;
    padding: 0 10px;
}

.wizard_panel.is-visible {
    display: block;
}

.step_title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px dashed #ffffff1c;
}

.wizard_footer {
    display: flex;
    justify-content: flex-end;
    align-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ffffff1c;
}

.wizard_footer:has(> :nth-child(2)) {
    justify-content: space-between;
    align-content: space-between;
}

.wizard_guide {
    display: flex;
    flex-direction: column;
    gap: 15px;
    line-height: 1.5;
    color: var(--muted);
}

.wizard_guide h4, .wizard_guide h3 {
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: -10px;
}

.wizard_guide h3 {
    font-size: 19px;
}

.wizard_guide hr {
    color: #ffffff1c;
    border-color: #ffffff1c;
    width: 100%;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

button.red:disabled {
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(124, 157, 255, .45);
    }
    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 12px rgba(124, 157, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(124, 157, 255, 0);
    }
}

.pulse {
    animation: pulse 0.5s ease-out infinite;
}

.id-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 720px) {
    .id-grid {
        grid-template-columns: 1fr 1fr;
    }
}


.id-uploader .pick-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
}


.pick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}


.preview {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #0f1627;
}

.preview img {
    display: block;
    width: 100%;
    height: auto;
}

.preview-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.id-title {
    margin-bottom: 8px;
}


@media screen and (max-width: 768px) {
    .wizard_steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wizard_step {
        align-items: center;
        justify-content: flex-start;
    }

    .wizard_panel {
        padding: 0;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .controls {
        justify-content: space-between;
        align-content: space-between;
    }
}


@media (max-width: 420px) {
    .gate_card {
        padding: 18px;
        border-radius: 22px;
    }

    .gate_icon {
        width: 64px;
        height: 64px;
    }

    .gate_card h2 {
        font-size: 18px;
    }

    #qrcode > img, #qrcode > canvas {
        width: 160px;
        height: 160px;
    }

    .controls {
        justify-content: center;
        align-content: center;
    }

    .wizard_footer button, .pick-actions button, .preview-actions button {
        flex: 1;
    }

    button {
        padding: 10px;
    }
}