/* Shared artwork for the web app, connection pages and checkout. */
.bg,
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background-color: #000;
    background-image: url("./quanconnect-landscape.png");
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (orientation: portrait) {
    .bg,
    .bg-layer {
        background-image: url("./quanconnect-portrait.png");
    }
}

/* Replace the previous decorative layers with the generated artwork. */
.bg > .bg-grid,
.bg > .bg-orb,
.bg > .bg-particles,
.bg > .bg-scan,
.bg-layer > .bg-grid,
.bg-layer > .bg-orb,
.bg-layer > .bg-orb1,
.bg-layer > .bg-orb2,
.bg-layer > .bg-orb3 {
    display: none;
}

/* Pre-rendered frosted glass: all cards reveal the same viewport-aligned image.
   Only the tint belongs to the card; the artwork stays with the wallpaper. */
:root {
    --quan-card-art: url("./quanconnect-glass-landscape-v1.jpg");
    --quan-card-art-ratio: 1.7777777778;
}

@media (orientation: portrait) {
    :root {
        --quan-card-art: url("./quanconnect-glass-portrait-v1.jpg");
        --quan-card-art-ratio: 0.5625;
    }
}

.scroll-container :is(.glass-card, .menu-item, .stat-cell, .plan-card,
    .device-card, .link-box, .proxy-card),
.subscription-pay :is(.card, .plan, .site-header, .pay-dialog),
.modal-sheet,
.modal-popup,
.confirm-card,
.edit-modal-card {
    /* Longhands also override the older component background shorthands. */
    background-color: #121116 !important;
    background-image: linear-gradient(145deg,
        var(--quan-card-tint, rgba(255, 255, 255, 0.035)),
        rgba(12, 10, 18, 0.38)), var(--quan-card-art) !important;
    background-size: 100% 100%, cover !important;
    background-position: center, center bottom !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Match .bg: viewport-sized cover, centered horizontally, anchored at bottom.
   Border-box clipping leaves a continuous frosted view through separate cards. */
.scroll-container :is(.glass-card, .menu-item, .plan-card,
    .device-card, .link-box, .proxy-card),
.subscription-pay :is(.card, .plan, .site-header) {
    background-attachment: scroll, fixed !important;
}

/* Transforms change the containing block of fixed backgrounds during a tap. */
.scroll-container :is(.menu-item, .plan-card):active {
    transform: none !important;
}

/* iOS ignores background-attachment: fixed. The page's alignment helper syncs cards
   using one scheduled frame per scroll, with no runtime image filtering. */
html[data-quan-glass="synced"] .scroll-container :is(.glass-card, .menu-item,
    .plan-card, .device-card, .link-box, .proxy-card),
html[data-quan-glass="synced"] .subscription-pay :is(.card, .plan, .site-header) {
    background-attachment: scroll !important;
    background-origin: border-box !important;
    background-size: 100% 100%, var(--quan-glass-width) var(--quan-glass-height) !important;
    background-position: center, var(--quan-glass-x) var(--quan-glass-y) !important;
    transition-property: border-color, box-shadow !important;
}

.scroll-container .animated-border-card {
    --quan-card-tint: rgba(108, 60, 215, 0.17);
}

.scroll-container .plan-card[data-days="360"] {
    --quan-card-tint: rgba(173, 119, 18, 0.15);
}

/* Inner fields retain their quieter tint and the QR's white quiet zone. */
.scroll-container .stat-cell {
    background-color: rgba(255, 255, 255, 0.035) !important;
    background-image: linear-gradient(145deg,
        rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)) !important;
}

.scroll-container .qr-wrapper {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.scroll-container .device-card {
    overflow: hidden;
}
