.bfqr,
.bfqr * {
    box-sizing: border-box;
}

.bfqr {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    color: #f7f7f4;
    font-family: inherit;
}

.bfqr__card {
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(154, 126, 16, 0.62);
    border-radius: 18px;
    background: #0f0f12;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.bfqr__header {
    margin-bottom: 16px;
    text-align: center;
}

.bfqr__title {
    margin: 0 0 7px;
    color: #ffffff;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 700;
    line-height: 1.15;
}

.bfqr__intro {
    margin: 0;
    color: #c9c9c4;
    font-size: 15px;
    line-height: 1.45;
}

.bfqr__viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 17px 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: #070708;
}

.bfqr__viewport[hidden] {
    display: none !important;
}

.bfqr__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #070708;
}

.bfqr__canvas {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.bfqr__frame {
    position: absolute;
    inset: 13%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    pointer-events: none;
}

.bfqr__corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: #c6a82d;
    border-style: solid;
}

.bfqr__corner--tl {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 12px 0 0 0;
}

.bfqr__corner--tr {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
    border-radius: 0 12px 0 0;
}

.bfqr__corner--bl {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 12px;
}

.bfqr__corner--br {
    right: -2px;
    bottom: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 12px 0;
}

.bfqr__scanline {
    position: absolute;
    top: 10%;
    left: 7%;
    width: 86%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c6a82d 18%, #e1c653 50%, #c6a82d 82%, transparent);
    box-shadow: 0 0 12px rgba(198, 168, 45, 0.7);
    animation: bfqr-scanline 2.1s ease-in-out infinite alternate;
}

.bfqr__status {
    min-height: 23px;
    margin: 14px 0 16px;
    color: #d4d4cf;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.bfqr__status--active {
    color: #e2d598;
}

.bfqr__status--success {
    color: #b9e2ba;
}

.bfqr__status--error {
    color: #efb1b1;
}

.bfqr__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.bfqr__button {
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.bfqr__button:hover {
    transform: translateY(-1px);
}

.bfqr__button:focus-visible {
    outline: 3px solid rgba(198, 168, 45, 0.35);
    outline-offset: 3px;
}

.bfqr__button:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.bfqr__button[hidden] {
    display: none !important;
}

.bfqr__button--primary {
    border-color: #b79b29;
    background: #9a7e10;
    color: #ffffff;
}

.bfqr__button--primary:hover {
    background: #aa8c16;
}

.bfqr__button--secondary {
    border-color: rgba(255, 255, 255, 0.18);
    background: #0b0b0e;
    color: #f3f3ef;
}

.bfqr__button--secondary:hover {
    border-color: rgba(198, 168, 45, 0.55);
}

@keyframes bfqr-scanline {
    from {
        top: 12%;
    }
    to {
        top: 86%;
    }
}

@media (max-width: 520px) {
    .bfqr__card {
        padding: 17px;
        border-radius: 16px;
    }

    .bfqr__viewport {
        margin: 14px 0;
        border-radius: 14px;
    }

    .bfqr__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .bfqr__button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bfqr__scanline {
        animation: none;
        top: 50%;
    }

    .bfqr__button {
        transition: none;
    }
}
