/* ===========================================================================
   pwa.css — PWA install flow visual chrome
   ---------------------------------------------------------------------------
   This file owns the visual chrome for the PWA install flow:
     - pwa3 install banner + tutorial modals (bottom-anchored prompt strip)
     - iOS A2HS (Add to Home Screen) tutorial modal (numbered steps for
       Safari users who must install manually)

   The /settings/notifications PWA chrome (pwa5) lives in account_settings.css
   from the sibling extraction in this commit, not here.

   Reference: markdown/design/DESIGN_DECISIONS_CSS_REFACTOR.md
   =========================================================================== */

/* === === === pwa3 install banner + tutorial modals (phase 13) === === === */

/* Bottom-anchored fixed strip. Hidden by default via transform +
   opacity so we can transition into view; pwa_install.js adds
   .is-visible to reveal. body.is-installed hard-hides via display:none
   so the strip is structurally absent for installed users. */
.pwa-install-banner {
    position: fixed;
    left: var(--space-3);
    right: var(--space-3);
    /* --safe-area-bottom clears the iOS home indicator when this
       happens to render on Safari-as-PWA. Wrapped in calc so we add a
       fixed gap on top of whatever the inset is (which is 0 on most
       browsers and devices). */
    bottom: calc(var(--space-3) + var(--safe-area-bottom));
    z-index: 1040; /* Below Bootstrap modal z-index (1050+) so modals
                       stack over the banner when both are open. */
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    background: var(--color-bg-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    /* Hidden default state: pushed below viewport + transparent. */
    transform: translateY(calc(100% + var(--space-4)));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
    /* Width cap on desktop so the banner reads as an attention
       grabber rather than a sticky toolbar. Mobile fills the
       available space via left/right insets above. */
    max-width: 520px;
    margin: 0 auto;
}

.pwa-install-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Hard-hide for installed users — pwa_install_detect.js sets
   body.is-installed when matchMedia('(display-mode: standalone)') or
   navigator.standalone is true. display:none wins over the transform
   transition; no flicker possible. */
body.is-installed .pwa-install-banner {
    display: none;
}

.pwa-install-banner-body {
    flex: 1 1 auto;
    font-size: var(--font-size-md);
    line-height: 1.35;
}

.pwa-install-banner-cta {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Dismiss ✕ — visually quiet, generous 44x44 touch target so it
   meets WCAG AA on mobile despite the small glyph. */
.pwa-install-banner-dismiss {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pwa-install-banner-dismiss:hover,
.pwa-install-banner-dismiss:focus-visible {
    background: var(--color-bg-subtle);
    color: var(--color-text);
    outline: none;
}

/* === iOS A2HS tutorial modal === */

.pwa-install-modal-intro {
    font-size: var(--font-size-md);
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.pwa-install-modal-footer-note {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-3);
    margin-bottom: 0;
}

/* Numbered step list. Reset default <ol> padding/margins, replace
   the marker with our own counter so we can style + align it. */
.pwa-install-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pwa-step;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.pwa-install-step {
    counter-increment: pwa-step;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    position: relative;
}

.pwa-install-step::before {
    content: counter(pwa-step);
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pwa-install-step-glyph {
    flex: 0 0 auto;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.pwa-install-step-body {
    flex: 1 1 auto;
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--color-text);
}

