/* Wave 143 — PWA install banner */
/*
 * Floating bottom-right card-style banner shown after engagement.
 * Lives outside the rest of the layout — fixed positioning, high
 * z-index, never affects flow. Mobile-first: drops to bottom-center
 * full-width on narrow screens.
 *
 * Companion to assets/js/pwa-install.js. Uses DESIGN.md tokens only.
 */

.pwa-install-banner {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: var(--z-top, 9999);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 22rem;
    padding: 1rem 1.1rem;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius, 12px);
    box-shadow: 0 12px 36px var(--black-40, rgba(0, 0, 0, 0.4));
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.9rem;
    line-height: 1.45;
    animation: pwa-install-slide-up 0.28s ease-out;
}

@keyframes pwa-install-slide-up {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-install-banner__text {
    color: var(--text);
    font-weight: 500;
}

.pwa-install-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pwa-install-btn {
    flex: 1 1 auto;
    min-width: 7rem;
    padding: 0.55rem 0.9rem;
    background: var(--accent);
    color: var(--white, #fff);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm, 7px);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.pwa-install-btn:hover,
.pwa-install-btn:focus-visible {
    opacity: 0.9;
}

.pwa-install-btn:active {
    transform: translateY(1px);
}

.pwa-install-btn:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

.pwa-dismiss-btn {
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem;
    background: transparent;
    color: var(--muted2, var(--muted));
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm, 7px);
    font: inherit;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.pwa-dismiss-btn:hover,
.pwa-dismiss-btn:focus-visible {
    color: var(--text);
    border-color: var(--border3);
}

.pwa-dismiss-btn:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

/* Mobile: full-width strip pinned to the bottom. */
@media (max-width: 600px) {
    .pwa-install-banner {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        max-width: none;
    }
    .pwa-install-banner__actions {
        flex-direction: row;
    }
}

/* Reduce motion: skip the slide-in animation. */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-banner {
        animation: none;
    }
}
