/* ─────────────────────────────────────────────────────────────
   GoodMarket — shared "Install app" (PWA) banner styles.

   Used by the homepage (dark indigo canvas) and the wallet page (light
   "Soft Sunrise" canvas), so the palette is self-contained rather than
   depending on either page's theme variables. A deep indigo → violet card
   with a G$ gold action button reads clearly on BOTH surfaces, and the
   button uses dark text on gold so it passes WCAG AA (white on amber fails).

   Behaviour is driven by static/js/pwa-install.js:
     .gm-pwa-banner            → hidden by default, revealed with .show
     .gm-pwa-banner.show       → visible
   ───────────────────────────────────────────────────────────── */

.gm-pwa-banner {
    display: none;
    position: relative;
    align-items: center;
    gap: 0.85rem;
    margin: 0.6rem auto 0.2rem;
    max-width: 720px;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #1b1140 0%, #2a1a5e 55%, #3b2478 100%);
    border: 1px solid rgba(167, 139, 250, 0.42);
    box-shadow: 0 10px 26px rgba(11, 15, 42, 0.42);
    color: #f5f3ff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: left;
}

.gm-pwa-banner.show {
    display: flex;
    flex-wrap: wrap;
}

.gm-pwa-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.gm-pwa-body {
    flex: 1 1 220px;
    min-width: 0;
}

.gm-pwa-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.gm-pwa-copy {
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(245, 243, 255, 0.86);
}

.gm-pwa-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gm-pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f1300;
    border: none;
    border-radius: 40px;
    padding: 0.62rem 1.25rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.gm-pwa-install-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.gm-pwa-install-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

.gm-pwa-dismiss-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #f5f3ff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gm-pwa-dismiss-btn:hover { background: rgba(255, 255, 255, 0.24); }
.gm-pwa-dismiss-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

.gm-pwa-status {
    flex: 1 1 100%;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #fcd34d;
    min-height: 0;
}

.gm-pwa-status:empty { display: none; }

/* ── Strict homepage install gate ──────────────────────────────────────
   Only the homepage renders #gmPwaInstallGate. The early html class hides
   all other body children until standalone mode or a wallet browser is found;
   the wallet's in-flow banner above is unaffected. */
.gm-pwa-gate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem
        max(1.25rem, env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(circle at 18% 16%, rgba(59, 130, 246, 0.28), transparent 34%),
        radial-gradient(circle at 84% 18%, rgba(124, 58, 237, 0.3), transparent 34%),
        linear-gradient(145deg, #080b20 0%, #111038 55%, #1b1040 100%);
    color: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
}
html.gm-pwa-gate-checking .gm-pwa-gate,
html.gm-pwa-gate-required .gm-pwa-gate { display: grid; }
.gm-pwa-gate-card {
    width: min(100%, 34rem);
    padding: clamp(1.6rem, 6vw, 3rem);
    border: 1px solid rgba(196, 181, 253, 0.28);
    border-radius: 28px;
    background: rgba(8, 13, 35, 0.82);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
}
.gm-pwa-gate-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 1.1rem;
    border: 1px solid rgba(251, 191, 36, 0.38);
    border-radius: 24px;
    background: rgba(251, 191, 36, 0.12);
    font-size: 2.15rem;
}
.gm-pwa-gate-eyebrow {
    margin-bottom: 0.65rem;
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}
.gm-pwa-gate h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.65rem, 7vw, 2.35rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.04em;
}
.gm-pwa-gate-copy {
    max-width: 29rem;
    margin: 1rem auto 1.45rem;
    color: rgba(226, 232, 240, 0.88);
    font-size: clamp(0.92rem, 3vw, 1.04rem);
    line-height: 1.65;
}
.gm-pwa-gate-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0 auto 1.4rem;
    text-align: left;
}
.gm-pwa-gate-stat {
    min-width: 0;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(196, 181, 253, 0.2);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
}
.gm-pwa-gate-stat span {
    display: block;
    margin-bottom: 0.35rem;
    color: rgba(203, 213, 225, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
}
.gm-pwa-gate-stat strong {
    display: block;
    color: #fbbf24;
    font-size: clamp(1.05rem, 4vw, 1.4rem);
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.gm-pwa-gate-actions { display: flex; justify-content: center; }
.gm-pwa-gate .gm-pwa-install-btn {
    min-width: min(100%, 17rem);
    justify-content: center;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.24);
}
.gm-pwa-gate-status {
    min-height: 1.4em;
    margin: 1rem auto 0;
    color: #fcd34d;
    font-size: 0.88rem;
    line-height: 1.5;
}
.gm-pwa-gate[data-state="checking"] .gm-pwa-gate-actions,
.gm-pwa-gate[data-state="checking"] .gm-pwa-gate-note { visibility: hidden; }
.gm-pwa-gate-note {
    max-width: 29rem;
    margin: 0.7rem auto 0;
    color: rgba(203, 213, 225, 0.72);
    font-size: 0.77rem;
    line-height: 1.55;
}
.gm-pwa-manual-help {
    width: min(100%, 29rem);
    margin: 1rem auto 0;
    padding: 1rem;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    background: rgba(251, 191, 36, 0.07);
    text-align: left;
}
.gm-pwa-manual-help[hidden] { display: none !important; }
.gm-pwa-manual-help h2 {
    margin: 0 0 0.55rem;
    color: #fde68a;
    font-size: 0.96rem;
    font-weight: 800;
}
.gm-pwa-manual-help p {
    margin: 0.5rem 0;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.8rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.gm-pwa-manual-help .gm-pwa-manual-note {
    color: rgba(203, 213, 225, 0.74);
    font-size: 0.74rem;
}
.gm-pwa-copy-link-btn {
    min-height: 2.65rem;
    margin-top: 0.35rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(196, 181, 253, 0.42);
    border-radius: 11px;
    background: rgba(124, 58, 237, 0.2);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}
.gm-pwa-copy-link-btn:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}
.gm-pwa-continue-browser-btn {
    min-height: 2.65rem;
    margin: 0.55rem 0 0 0.35rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.42);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}
.gm-pwa-continue-browser-btn:hover { background: rgba(255, 255, 255, 0.12); }
.gm-pwa-continue-browser-btn:focus-visible {
    outline: 3px solid #c4b5fd;
    outline-offset: 3px;
}
.gm-pwa-manual-help .gm-pwa-copy-status {
    min-height: 1.2em;
    margin-bottom: 0;
    color: #fde68a;
    font-size: 0.72rem;
}
.gm-pwa-gate .gm-pwa-install-btn:focus-visible {
    outline: 3px solid #c4b5fd;
    outline-offset: 4px;
}
.gm-pwa-gate .gm-pwa-install-btn:disabled {
    cursor: wait;
    opacity: 0.72;
    filter: saturate(0.7);
}
.gm-pwa-gate-progress {
    width: min(100%, 29rem);
    margin: 1.15rem auto 0;
    padding: 0.85rem 0.95rem 0.95rem;
    border: 1px solid rgba(196, 181, 253, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    text-align: left;
}
.gm-pwa-gate-progress[hidden] { display: none; }
.gm-pwa-gate-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
}
.gm-pwa-gate-progress-heading strong {
    color: #fbbf24;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}
.gm-pwa-gate-progress-message {
    min-height: 1.35em;
    margin: 0.65rem 0 0;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.8rem;
    line-height: 1.45;
}
.gm-pwa-gate-progress-message::after {
    content: ' Progress is approximate while your browser prepares the app.';
    display: block;
    margin-top: 0.25rem;
    color: rgba(203, 213, 225, 0.64);
    font-size: 0.7rem;
}
.gm-pwa-gate[data-state="installed-awaiting-launch"] .gm-pwa-gate-progress-message {
    color: #fde68a;
    font-weight: 700;
}
.gm-pwa-gate[data-state="installed-awaiting-launch"] .gm-pwa-gate-progress-message::after {
    content: 'Open the installed app to finish setup.';
    color: rgba(253, 230, 138, 0.76);
}
.gm-pwa-gate-progress progress {
    display: block;
    width: 100%;
    height: 0.62rem;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    accent-color: #fbbf24;
}
.gm-pwa-gate-progress progress::-webkit-progress-bar {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
}
.gm-pwa-gate-progress progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.gm-pwa-gate-progress progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

@media (max-width: 560px) {
    .gm-pwa-banner { margin-left: 0.9rem; margin-right: 0.9rem; }
    .gm-pwa-actions { flex: 1 1 100%; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .gm-pwa-install-btn { transition: none; }
    .gm-pwa-install-btn:hover { transform: none; }
    .gm-pwa-gate-progress progress { transition: none; }
}

/* ── "New version available" toast (revives the old login-page banner) ── */
.gm-pwa-update-toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: min(92vw, 30rem);
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: #1a103d;
    color: #f5f3ff;
    border: 1px solid rgba(196, 181, 253, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    font-size: 0.85rem;
    line-height: 1.35;
}

.gm-pwa-update-toast button {
    flex: 0 0 auto;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f1300;
}

.gm-pwa-update-toast .gm-pwa-update-close {
    background: transparent;
    color: #c4b5fd;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
}

.gm-pwa-update-toast button:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
