/* ========================================================
   QR Code Modal Stylesheet (Review Link & Amber Wi-Fi Theme)
   (Shared: Web + Native Android App)
   ======================================================== */

.qr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 7, 6, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.19s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.19s;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body.is-native-app .qr-overlay {
    background: rgba(8, 7, 6, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.qr-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

/* Defensive isolation when closed */
.qr-overlay:not(.active),
.qr-overlay:not(.active) * {
    pointer-events: none !important;
}

.qr-overlay:not(.active):not(.closing):not(.handoff-enter):not(.handoff-exit) {
    visibility: hidden !important;
    opacity: 0 !important;
}

.qr-modal {
    width: 100%;
    max-width: 320px;
    background: rgba(28, 25, 23, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 28px;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(124, 58, 237, 0.2);
    transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
    transform-origin: center center;
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.19s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.qr-overlay.active .qr-modal {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
    opacity: 1;
}

.qr-modal.theme-wifi {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.25);
}

.qr-modal.theme-wifi .btn-qr-download {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    color: #0c0a09;
    font-weight: 800;
}

.qr-modal.theme-wifi .btn-qr-download svg {
    fill: #0c0a09;
}

.qr-modal.theme-wifi .btn-qr-download:active {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.qr-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.qr-desc {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.qr-box-wrapper {
    background: #ffffff;
    padding: 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.qr-box-wrapper canvas,
.qr-box-wrapper img {
    display: block;
    border-radius: 8px;
}

.qr-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-qr-download {
    width: 100%;
    height: 48px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-btn);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-qr-download:active {
    transform: scale(0.97);
}

.btn-qr-download svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

.btn-qr-close {
    width: 100%;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    color: var(--text-sub);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-qr-close:active {
    background: rgba(255, 255, 255, 0.15);
}
