﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #1a1840;
    --navy2: #2d2a5e;
    --gold: #F5B731;
    --gold2: #e6a020;
    --bg: #f4f4f8;
    --bg2: #ebebf2;
    --muted: #9593b0;
    --white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #f9f9fb 0%, #f0f0f5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Phone shell ─────────────────────────────── */
.phone-shell {
    width: 375px;
    min-height: 100vh;
    background: linear-gradient(180deg, #f9f9fb 0%, #ededf3 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 48px 28px 36px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 400px) {
    .phone-shell {
        width: 100vw;
        padding: 40px 20px 28px;
    }
}

/* ── Header ──────────────────────────────────── */
.rfid-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

    .rfid-label svg {
        flex-shrink: 0;
    }

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
}

/* ── Scanner area ────────────────────────────── */
.scanner-wrap {
    position: relative;
    width: 370px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Corner brackets */
.corner {
    position: absolute;
    width: 36px;
    height: 36px;
    border-color: var(--gold);
    border-style: solid;
    border-width: 0;
    transition: opacity .3s;
    opacity: 0;
    border-radius: 5px;
}

    .corner.tl {
        top: 0;
        left: 0;
        border-top-width: 3px;
        border-left-width: 3px;
        border-radius: 6px 0 0 0;
    }

    .corner.tr {
        top: 0;
        right: 0;
        border-top-width: 3px;
        border-right-width: 3px;
        border-radius: 0 6px 0 0;
    }

    .corner.bl {
        bottom: 0;
        left: 0;
        border-bottom-width: 3px;
        border-left-width: 3px;
        border-radius: 0 0 0 6px;
    }

    .corner.br {
        bottom: 0;
        right: 0;
        border-bottom-width: 3px;
        border-right-width: 3px;
        border-radius: 0 0 6px 0;
    }

.scanner-wrap.active .corner {
    opacity: 1;
}

/* Ping rings */
.ring {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    border: 2px solid rgba(245,183,49,0.45);
    opacity: 0;
}

.scanner-wrap.scanning .ring {
    animation: ping 1.8s ease-out infinite;
}

    .scanner-wrap.scanning .ring:nth-child(2) {
        animation-delay: .6s;
    }

    .scanner-wrap.scanning .ring:nth-child(3) {
        animation-delay: 1.2s;
    }

/* Success ring */
.ring-success {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    border: 2px solid rgba(34,197,94,.5);
    opacity: 0;
    transform: scale(.9);
    transition: opacity .4s, transform .4s;
}

.scanner-wrap.success .ring-success {
    opacity: 1;
    transform: scale(1);
}

/* Box */
.scanner-box {
    position: relative;
    width: 350px;
    height: 220px;
    border-radius: 24px;
    background: var(--white);
    border: 2px solid rgba(26,24,64,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color .4s, box-shadow .4s, background .4s;
}

.scanner-wrap.active .scanner-box {
    border-color: rgba(245,183,49,.4);
    box-shadow: 0 8px 40px rgba(245,183,49,.18), 0 2px 12px rgba(0,0,0,.06);
    background: rgba(245,183,49,.04);
}

.scanner-wrap.success .scanner-box {
    border-color: rgba(34,197,94,.35);
    box-shadow: 0 8px 40px rgba(34,197,94,.15);
    background: rgba(34,197,94,.04);
}

/* Gold scan line */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    top: 10%;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: 0 0 10px var(--gold), 0 0 20px rgba(245,183,49,.4);
    opacity: 0;
}

.scanner-wrap.scanning .scan-line {
    animation: scan 2s ease-in-out infinite;
}

/* ── RFID icon (concentric squares) ─────────── */
.rfid-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .rfid-icon .sq {
        position: absolute;
        border-style: solid;
        border-color: rgba(26,24,64,.18);
        border-radius: 10px;
        transition: border-color .4s;
    }

    .rfid-icon .sq1 {
        width: 112px;
        height: 112px;
        border-width: 2.5px;
        border-radius: 18px;
    }

    .rfid-icon .sq2 {
        width: 80px;
        height: 80px;
        border-width: 2.5px;
        border-radius: 13px;
        border-color: rgba(26,24,64,.30);
    }

    .rfid-icon .sq3 {
        width: 52px;
        height: 52px;
        border-width: 2.5px;
        border-radius: 9px;
        border-color: rgba(26,24,64,.50);
    }

    .rfid-icon .sq4 {
        width: 30px;
        height: 30px;
        border-width: 2.5px;
        border-radius: 5px;
        border-color: rgba(26,24,64,.72);
    }

    .rfid-icon .dot {
        width: 14px;
        height: 14px;
        background: var(--navy);
        border-radius: 3px;
    }

.scanner-wrap.scanning .rfid-icon {
    animation: pulse-ring 1.8s ease-in-out infinite;
}

.scanner-wrap.idle .rfid-icon {
    animation: float 3s ease-in-out infinite;
}

/* Camera icon (activating) */
.cam-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: pop-in .5s cubic-bezier(.34,1.56,.64,1) both;
}

    .cam-wrap .cam-circle {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--gold), var(--gold2));
        display: flex;
        align-items: center;
        justify-content: center;
        animation: float 2s ease-in-out infinite;
        position: relative;
    }

        .cam-wrap .cam-circle::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid rgba(245,183,49,.6);
            animation: ping 1.6s ease-out infinite;
        }

/* Success tick */
.success-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: pop-in .6s cubic-bezier(.34,1.56,.64,1) both;
}

    .success-wrap .tick-circle {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, #22c55e, #16a34a);
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* ── Status text ─────────────────────────────── */
.status-area {
    text-align: center;
    min-height: 52px;
}

.status-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
}

.status-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* ── Bottom button ───────────────────────────── */
.btn-scan {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 28px rgba(245,183,49,.45);
    transition: transform .15s, box-shadow .15s;
    position: relative;
    overflow: hidden;
}

    .btn-scan:hover {
        transform: scale(1.02);
        box-shadow: 0 10px 32px rgba(245,183,49,.55);
    }

    .btn-scan:active {
        transform: scale(.97);
        box-shadow: 0 4px 16px rgba(245,183,49,.35);
    }

    .btn-scan::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,.18) 50%, transparent 75%);
        background-size: 200% 100%;
        animation: shimmer 1.6s infinite;
    }

.btn-cancel {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(245,183,49,.4);
    transition: transform .15s;
    font-size: 20px;
}

    .btn-cancel:hover {
        transform: scale(1.07);
    }

    .btn-cancel:active {
        transform: scale(.93);
    }

.demo-note {
    font-size: 11px;
    color: #c5c3d8;
    text-align: center;
}

    .demo-note strong {
        color: #b0adc8;
    }

/* ── Animations ──────────────────────────────── */
@keyframes scan {
    0% {
        top: 10%;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    100% {
        top: 90%;
        opacity: 0;
    }
}

@keyframes ping {
    0% {
        transform: scale(1);
        opacity: .6;
    }

    100% {
        transform: scale(2.1);
        opacity: 0;
    }
}

@keyframes pulse-ring {
    0%,100% {
        transform: scale(.88);
        opacity: .75;
    }

    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

@keyframes float {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pop-in {
    0% {
        transform: scale(.6);
        opacity: 0;
    }

    60% {
        transform: scale(1.08);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(22px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes corner-blink {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

.scanner-wrap.scanning .corner.tl {
    animation: corner-blink 1.5s ease-in-out infinite 0s;
}

.scanner-wrap.scanning .corner.tr {
    animation: corner-blink 1.5s ease-in-out infinite .2s;
}

.scanner-wrap.scanning .corner.bl {
    animation: corner-blink 1.5s ease-in-out infinite .4s;
}

.scanner-wrap.scanning .corner.br {
    animation: corner-blink 1.5s ease-in-out infinite .6s;
}

.animate-in {
    animation: slide-up .45s ease-out both;
}
