
:root {
    --ink: #0a0a0f;
    --surface: #f5f3ef;
    --card: #ffffff;
    --accent: #ff4d1c;
    --accent2: #1c6fff;
    --muted: #8a8a9a;
    --border: #e8e6e0;
    --success: #00c566;
    --warn: #ff9900;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* ── HEADER ── */
header {
    width: 100%;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    gap: 12px;
}

.logo {
    font-family:  sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: .7;
    }
}

.badge {
    font-size: .7rem;
    font-weight: 500;
    background: var(--ink);
    color: #fff;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: .05em;
    text-transform: uppercase;
    flex-shrink: 0;
}
/* -- Vendor session pill -- */
.vendor-pill {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 5px 12px 5px 6px;
    transition: border-color .2s;
}

    .vendor-pill.show {
        display: flex;
    }

    .vendor-pill:hover {
        border-color: #ccc;
    }

.vendor-avatar {
    width: 28px;
    height: 28px;
    background: var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family:  sans-serif;
    font-weight: 800;
    font-size: .68rem;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}

.vendor-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1;
    max-width: 140px;
}

.vendor-name {
    font-family:  sans-serif;
    font-weight: 700;
    font-size: .78rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vendor-biz {
    font-size: .67rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--muted);
    font-size: .7rem;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 6px;
    transition: color .2s, background .2s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    margin-left: 2px;
    height: 100%;
    min-height: 28px;
}

    .btn-logout:hover {
        color: var(--accent);
        background: #fff0ee;
    }

/* ── MAIN ── */
main {
    flex: 1;
    width: 100%;
    max-width: 520px;
    padding: 48px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* ── PANELS ── */
.panel {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    animation: slideUp .45s cubic-bezier(.22,1,.36,1) forwards;
}

    .panel.active {
        display: flex;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── IDLE ── */
.scan-hero {
    text-align: center;
    margin-bottom: 40px;
}

.scan-icon-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto 32px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    animation: spin 3s linear infinite;
}

.scan-ring-2 {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-bottom-color: var(--accent2);
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.scan-icon-inner {
    width: 80px;
    height: 80px;
    background: var(--ink);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

    .scan-icon-inner svg {
        width: 36px;
        height: 36px;
        stroke: #fff;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
    }

.scan-hero h1 {
    font-family:  sans-serif;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.scan-hero p {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

/* ── SCAN BTN ── */
.btn-scan {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family:  sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
    margin-top: 8px;
}

    .btn-scan::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--accent), #ff8000);
        opacity: 0;
        transition: opacity .3s;
    }

    .btn-scan:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(0,0,0,.18);
    }

        .btn-scan:hover::before {
            opacity: 1;
        }

    .btn-scan:active {
        transform: translateY(0);
    }

    .btn-scan span, .btn-scan i {
        position: relative;
        z-index: 1;
    }

    .btn-scan i {
        font-size: 16px;
    }

/* ── READER ── */
.reader-wrap {
    width: 100%;
    background: var(--ink);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.reader-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.reader-title {
    font-family:  sans-serif;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

.btn-close-reader {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background .2s;
}

    .btn-close-reader:hover {
        background: rgba(255,255,255,.2);
    }

#reader {
    width: 100% !important;
    min-height: 280px;
    background: #111;
}

    #reader * {
        border-color: transparent !important;
    }

.reader-hint {
    padding: 16px 24px;
    text-align: center;
    color: rgba(255,255,255,.45);
    font-size: .8rem;
    letter-spacing: .03em;
}

/* ── LOADING ── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.88);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

    .loading-overlay.show {
        display: flex;
    }

.loader-card {
    background: var(--card);
    border-radius: 24px;
    padding: 40px 48px;
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.loader-title {
    font-family:  sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.loader-sub {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
}

/* ── VOUCHER CARD ── */
.voucher-card {
    width: 100%;
    background: var(--ink);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

    .voucher-card::before {
        content: '';
        position: absolute;
        top: -60px;
        right: -60px;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, rgba(255,77,28,.3) 0%, transparent 70%);
        pointer-events: none;
    }

.vc-top {
    padding: 28px 28px 20px;
    position: relative;
}

.vc-label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-bottom: 6px;
}

.vc-name {
    font-family:  sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: -.02em;
    margin-bottom: 4px;
}

.vc-type {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
}

.vc-divider {
    border: none;
    border-top: 1px dashed rgba(255,255,255,.12);
    margin: 0 28px;
}

.vc-stats {
    padding: 20px 28px 28px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.vc-stat label {
    display: block;
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    margin-bottom: 4px;
}

.vc-stat strong {
    font-family:  sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.vc-stat .accent-val {
    color: var(--accent);
}

.vc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

    .vc-badge.valid {
        background: rgba(0,197,102,.15);
        color: var(--success);
        border: 1px solid rgba(0,197,102,.3);
    }

    .vc-badge.locked {
        background: rgba(255,153,0,.15);
        color: var(--warn);
        border: 1px solid rgba(255,153,0,.3);
    }

.vc-channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 100px;
    margin-top: 10px;
}

    .vc-channel-pill.nfc {
        background: rgba(28,111,255,.18);
        color: #6fa3ff;
        border: 1px solid rgba(28,111,255,.3);
    }

    .vc-channel-pill.qr {
        background: rgba(255,77,28,.12);
        color: #ff7a5a;
        border: 1px solid rgba(255,77,28,.25);
    }

    .vc-channel-pill.manual {
        background: rgba(0,197,102,.12);
        color: #3dd98a;
        border: 1px solid rgba(0,197,102,.25);
    }

/* ── FORM ── */
.form-section {
    width: 100%;
}

.section-label {
    font-family:  sans-serif;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .field label {
        font-size: .8rem;
        font-weight: 500;
        color: var(--ink);
    }

        .field label .req {
            color: var(--accent);
            margin-left: 2px;
        }

    .field input {
        padding: 14px 16px;
        border: 1.5px solid var(--border);
        border-radius: 12px;
        font-family: 'DM Sans', sans-serif;
        font-size: .95rem;
        color: var(--ink);
        background: var(--card);
        transition: border-color .2s, box-shadow .2s;
        outline: none;
        -webkit-appearance: none;
    }

        .field input:focus {
            border-color: var(--ink);
            box-shadow: 0 0 0 3px rgba(10,10,15,.07);
        }

    .field textarea {
        padding: 14px 16px;
        border: 1.5px solid var(--border);
        border-radius: 12px;
        font-family: 'DM Sans', sans-serif;
        font-size: .95rem;
        color: var(--ink);
        background: var(--card);
        transition: border-color .2s, box-shadow .2s;
        outline: none;
        -webkit-appearance: none;
        resize: vertical;
        min-height: 100px;
        line-height: 1.5;
    }

        .field textarea:focus {
            border-color: var(--ink);
            box-shadow: 0 0 0 3px rgba(10,10,15,.07);
        }

        .field textarea.error {
            border-color: var(--accent);
        }

    .field input.error {
        border-color: var(--accent);
    }

    .field .hint {
        font-size: .75rem;
        color: var(--muted);
        line-height: 1.4;
    }

/* -- Session banner (shown instead of creds when logged in) -- */
.session-banner {
    display: none;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border: 1.5px solid #c8dffe;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    align-items: center;
    gap: 14px;
}

    .session-banner.show {
        display: flex;
    }

.session-banner-icon {
    width: 38px;
    height: 38px;
    background: var(--accent2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .session-banner-icon i {
        font-size: 18px;
        color: #fff;
    }

.session-banner-text {
    flex: 1;
}

    .session-banner-text strong {
        display: block;
        font-size: .82rem;
        font-weight: 600;
        color: var(--ink);
        margin-bottom: 2px;
    }

    .session-banner-text span {
        font-size: .73rem;
        color: #4a7cc7;
    }

.btn-switch-account {
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: .72rem;
    font-weight: 500;
    color: var(--accent2);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 4px;
    flex-shrink: 0;
    transition: color .2s;
}

    .btn-switch-account:hover {
        color: #0040cc;
    }

/* ── LOCATION ── */
.location-box {
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: var(--card);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.loc-icon {
    width: 40px;
    height: 40px;
    background: #f0f4ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .loc-icon i {
        font-size: 18px;
        color: var(--accent2);
    }

.loc-text h4 {
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: 3px;
}

.loc-text p {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.45;
    margin-bottom: 10px;
}

.btn-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent2);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .2s;
}

    .btn-location:hover {
        opacity: .85;
    }

    .btn-location:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.location-status {
    font-size: .75rem;
    margin-top: 8px;
    font-weight: 500;
}

    .location-status.ok {
        color: var(--success);
    }

    .location-status.err {
        color: var(--accent);
    }

/* ── SUBMIT ── */
.btn-submit {
    width: 100%;
    padding: 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family:  sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: .01em;
    transition: transform .2s, box-shadow .2s, opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(255,77,28,.3);
    }

    .btn-submit:active {
        transform: translateY(0);
    }

    .btn-submit:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .btn-submit i {
        font-size: 15px;
    }

/* ── SUCCESS ── */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.success-icon i {
    font-size: 32px;
}

.success-panel {
    text-align: center;
    width: 100%;
}

    .success-panel h2 {
        font-family:  sans-serif;
        font-weight: 800;
        font-size: 1.8rem;
        letter-spacing: -.03em;
        margin-bottom: 10px;
    }

    .success-panel p {
        color: var(--muted);
        line-height: 1.6;
        margin-bottom: 32px;
    }

.receipt-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    text-align: left;
    margin-bottom: 28px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
}

    .receipt-row:last-child {
        border-bottom: none;
    }

    .receipt-row .rk {
        color: var(--muted);
    }

    .receipt-row .rv {
        font-weight: 600;
    }

        .receipt-row .rv.big {
            font-family:  sans-serif;
            font-size: 1.1rem;
            font-weight: 800;
            color: var(--success);
        }

.btn-new-scan {
    width: 100%;
    padding: 16px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family:  sans-serif;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    transition: opacity .2s;
}

    .btn-new-scan:hover {
        opacity: .85;
    }

/* ── ERROR ── */
.error-panel {
    text-align: center;
    width: 100%;
}

.error-icon {
    width: 72px;
    height: 72px;
    background: #fff0ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border: 2px solid rgba(255,77,28,.2);
    animation: scaleIn .4s cubic-bezier(.34,1.56,.64,1) forwards;
}

    .error-icon i {
        font-size: 26px;
    }

.error-panel h2 {
    font-family:  sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -.02em;
    margin-bottom: 10px;
}

.error-msg {
    background: #fff0ee;
    border: 1px solid rgba(255,77,28,.2);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: .85rem;
    color: #c0341a;
    margin-bottom: 28px;
    line-height: 1.5;
    text-align: left;
}

/* ── CREDS NOTICE ── */
.creds-notice {
    background: #f8f8ff;
    border: 1.5px solid #e0e0f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .78rem;
    color: #555;
    margin-bottom: 16px;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

    .creds-notice i {
        color: var(--accent2);
        flex-shrink: 0;
        margin-top: 2px;
        font-size: 14px;
    }


/* ── ADD TO HOME SCREEN ── */
.btn-a2hs {
    display: none; /* shown by JS when prompt is available */
    align-items: center;
    gap: 9px;
    padding: 10px 22px;
    background: transparent;
    color: var(--muted);
    border: 1.5px dashed var(--border);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: .82rem;
    cursor: pointer;
    margin-top: 10px;
    transition: border-color .2s, color .2s, background .2s;
}

    .btn-a2hs:hover {
        border-color: var(--ink);
        color: var(--ink);
        background: rgba(10,10,15,.03);
        border-style: solid;
    }

    .btn-a2hs .ico {
        font-size: 13px;
    }

    .btn-a2hs.installed {
        color: var(--success);
        border-color: rgba(0,197,102,.4);
        border-style: solid;
        cursor: default;
    }

        .btn-a2hs.installed:hover {
            background: transparent;
        }

/* ── MORE DETAILS TOGGLE ── */
.more-details-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

    .more-details-toggle input[type="checkbox"] {
        display: none;
    }

.toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 100px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}

    .toggle-track::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 14px;
        height: 14px;
        background: #fff;
        border-radius: 50%;
        transition: transform .2s;
        box-shadow: 0 1px 3px rgba(0,0,0,.18);
    }

.more-details-toggle input:checked ~ .toggle-track {
    background: var(--ink);
}

    .more-details-toggle input:checked ~ .toggle-track::after {
        transform: translateX(16px);
    }

.toggle-label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted);
    transition: color .2s;
}

.more-details-toggle:has(input:checked) .toggle-label {
    color: var(--ink);
}

.extra-fields {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    animation: slideUp .3s cubic-bezier(.22,1,.36,1) forwards;
}

    .extra-fields.show {
        display: flex;
    }

/* ── MANUAL ENTRY BTN ── */
.btn-manual {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s;
    margin-top: 14px;
}

    .btn-manual i {
        font-size: 14px;
    }

    .btn-manual:hover {
        border-color: var(--ink);
        background: rgba(10,10,15,.04);
        transform: translateY(-1px);
    }

/* ── MODAL (shared base) ── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

    .modal-backdrop.open {
        display: flex;
    }

.modal-card {
    background: var(--card);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
    animation: modalIn .35s cubic-bezier(.22,1,.36,1) forwards;
    overflow: hidden;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.94) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .modal-icon svg {
        stroke: var(--ink);
    }

.modal-title h3 {
    font-family:  sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
    margin-bottom: 2px;
}

.modal-title p {
    font-size: .75rem;
    color: var(--muted);
}

.modal-close {
    background: var(--surface);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .9rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

    .modal-close:hover {
        background: var(--border);
        color: var(--ink);
    }

    .modal-close:disabled {
        opacity: .3;
        cursor: not-allowed;
    }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 10px;
}

.modal-cancel-btn {
    flex: 1;
    padding: 13px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    color: var(--muted);
    cursor: pointer;
    transition: background .2s, color .2s;
}

    .modal-cancel-btn:hover {
        background: var(--border);
        color: var(--ink);
    }

.modal-submit-btn {
    flex: 2;
    padding: 13px 20px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family:  sans-serif;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .2s;
}

    .modal-submit-btn:hover {
        opacity: .85;
        transform: translateY(-1px);
    }

    .modal-submit-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
        transform: none;
    }

/* -- Auth modal extras -- */
.auth-modal-icon {
    background: var(--ink) !important;
}

    .auth-modal-icon svg {
        stroke: #fff !important;
    }

.auth-error {
    background: #fff0ee;
    border: 1px solid rgba(255,77,28,.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .78rem;
    color: #c0341a;
    margin-top: 14px;
    display: none;
    line-height: 1.5;
}

    .auth-error.show {
        display: block;
    }

.auth-footer-note {
    text-align: center;
    font-size: .72rem;
    color: var(--muted);
    padding: 0 24px 20px;
    line-height: 1.5;
}

    .auth-footer-note a {
        color: var(--accent2);
        text-decoration: none;
    }

        .auth-footer-note a:hover {
            text-decoration: underline;
        }

/* ── CODE INPUT ── */
.code-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: var(--card);
}

    .code-input-wrap:focus-within {
        border-color: var(--ink);
        box-shadow: 0 0 0 3px rgba(10,10,15,.07);
    }

    .code-input-wrap.error {
        border-color: var(--accent);
    }

    .code-input-wrap input {
        flex: 1;
        border: none;
        outline: none;
        padding: 14px 16px;
        font-family: 'DM Mono', 'Courier New', monospace;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: .08em;
        color: var(--ink);
        background: transparent;
        text-transform: uppercase;
    }

        .code-input-wrap input::placeholder {
            font-weight: 400;
            letter-spacing: .02em;
            color: #bbb;
            text-transform: none;
            font-family: 'DM Sans', sans-serif;
        }

.paste-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    height: 100%;
    background: var(--surface);
    border: none;
    border-left: 1px solid var(--border);
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
    min-height: 50px;
}

    .paste-btn:hover {
        background: var(--border);
        color: var(--ink);
    }

/* ── NFC BANNER ── */
.nfc-banner {
    width: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    border: 1px solid rgba(28,111,255,.3);
    animation: nfcGlow 2s ease-in-out infinite;
}

@keyframes nfcGlow {
    0%,100% {
        box-shadow: 0 0 0 4px rgba(28,111,255,.06);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(28,111,255,.14);
    }
}

.nfc-banner-icon {
    width: 40px;
    height: 40px;
    background: rgba(28,111,255,.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6fa3ff;
}

.nfc-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .nfc-banner-text strong {
        font-family:  sans-serif;
        font-weight: 700;
        font-size: .88rem;
        color: #fff;
    }

    .nfc-banner-text span {
        font-size: .75rem;
        color: rgba(255,255,255,.45);
    }

.nfc-banner-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(28,111,255,.25);
    border-top-color: #6fa3ff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 420px) {
    .vc-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .scan-hero h1 {
        font-size: 1.65rem;
    }

    .vendor-info {
        max-width: 90px;
    }
}

/* ── PLAY STORE HEADER BUTTON ── */
.btn-playstore-header {
    display: none; /* shown only on Android via JS */
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: #01875f;
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: .75rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s, transform .2s;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .01em;
}

    .btn-playstore-header:hover {
        opacity: .88;
        transform: translateY(-1px);
    }

    .btn-playstore-header i {
        font-size: 13px;
    }

/* ── ANDROID APP POPUP ── */
.app-popup-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.65);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

    .app-popup-backdrop.open {
        display: flex;
    }

.app-popup-sheet {
    background: var(--card);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 520px;
    padding: 0 0 env(safe-area-inset-bottom, 20px);
    box-shadow: 0 -12px 60px rgba(0,0,0,.22);
    animation: sheetUp .38s cubic-bezier(.22,1,.36,1) forwards;
    overflow: hidden;
}

@keyframes sheetUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.app-popup-drag {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 100px;
    margin: 14px auto 0;
}

.app-popup-body {
    padding: 24px 28px 8px;
}

.app-popup-icon-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.app-popup-app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

    .app-popup-app-icon i {
        font-size: 28px;
        color: var(--accent);
    }

.app-popup-app-meta {
    flex: 1;
}

    .app-popup-app-meta strong {
        display: block;
        font-family:  sans-serif;
        font-weight: 800;
        font-size: 1.1rem;
        letter-spacing: -.02em;
        margin-bottom: 3px;
    }

    .app-popup-app-meta span {
        font-size: .8rem;
        color: var(--muted);
    }

.app-popup-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

    .app-popup-stars i {
        font-size: 11px;
        color: #f5a623;
    }

    .app-popup-stars span {
        font-size: .72rem;
        color: var(--muted);
        margin-left: 3px;
    }

.app-popup-body h2 {
    font-family:  sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -.025em;
    margin-bottom: 10px;
    line-height: 1.25;
}

.app-popup-body p {
    font-size: .875rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 16px;
}

.app-popup-features {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 24px;
}

.app-popup-feat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: 12px;
    font-size: .83rem;
    font-weight: 500;
    color: var(--ink);
}

    .app-popup-feat i {
        width: 18px;
        text-align: center;
        color: var(--accent2);
        font-size: 14px;
        flex-shrink: 0;
    }

.app-popup-actions {
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-popup-playstore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: #01875f;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family:  sans-serif;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s, transform .2s;
    letter-spacing: .01em;
}

    .btn-popup-playstore:hover {
        opacity: .88;
        transform: translateY(-1px);
    }

    .btn-popup-playstore i {
        font-size: 18px;
    }

.btn-popup-webapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
}

    .btn-popup-webapp:hover {
        border-color: var(--ink);
        color: var(--ink);
        background: rgba(10,10,15,.03);
    }

/* ── ICO: inline SVG icon wrapper ── */
.ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    flex-shrink: 0;
}

    .ico svg {
        width: 100%;
        height: 100%;
        display: block;
    }

