/* ==========================================================
   PWA: install buttons, install pages, installed-app tweaks
   ========================================================== */

/* hide "install" things inside the installed app */
html.is-standalone [data-hide-standalone] { display: none !important; }

/* installed app: no accidental pull-to-refresh, notch-safe top bar */
html.is-standalone body { overscroll-behavior-y: contain; -webkit-text-size-adjust: 100%; }
html.is-standalone .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
}

/* ----- login page: the two install buttons ----- */
.install-block { margin-top: 26px; }
.install-block .divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: .7rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
}
.install-block .divider::before,
.install-block .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.install-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.install-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; min-width: 0;
    border: 1.5px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text);
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.install-btn:hover { color: var(--text); border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.install-btn:active { transform: scale(.97); }
.install-btn i { font-size: 1.7rem; flex-shrink: 0; }
.install-btn.android i { color: #3ddc84; }
.install-btn.ios i { color: var(--text); }
.install-btn span { display: block; line-height: 1.2; font-weight: 800; font-size: .9rem; min-width: 0; }
.install-btn small {
    display: block; font-size: .6rem; font-weight: 700; color: var(--muted);
    letter-spacing: .1em; text-transform: uppercase;
}
@media (max-width: 400px) { .install-btns { grid-template-columns: 1fr; } }

/* ----- install pages ----- */
.pwa-page {
    background: var(--bg); color: var(--text);
    min-height: 100vh; min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.pwa-top {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    border-bottom: 1px solid rgba(212, 175, 55, .45);
    padding: calc(env(safe-area-inset-top) + 14px) 16px 78px;
}
.pwa-top-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; color: #fff; }
.pwa-back {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px;
    background: rgba(255, 255, 255, .12); color: #fff;
    display: grid; place-items: center; text-decoration: none; font-size: 1.1rem;
}
.pwa-back:hover { color: #fff; background: rgba(255, 255, 255, .2); }
.pwa-brand { line-height: 1.15; }
.pwa-brand strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.pwa-brand small { color: var(--gold); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.pwa-main { max-width: 720px; margin: -54px auto 0; padding: 0 16px calc(env(safe-area-inset-bottom) + 36px); }
.pwa-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px; box-shadow: var(--shadow-md);
    padding: 22px; margin-bottom: 16px;
}
.pwa-card h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 12px; }

.pwa-hero { text-align: center; padding: 28px 20px 26px; }
.pwa-hero .app-icon {
    width: 92px; height: 92px; border-radius: 24px; margin-bottom: 14px;
    box-shadow: 0 14px 30px rgba(35, 41, 98, .35);
}
.pwa-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; margin: 0 0 6px; }
.pwa-hero p { color: var(--muted); margin: 0 auto 20px; max-width: 460px; }
.install-main { width: 100%; max-width: 380px; height: 56px; font-size: 1.05rem; border-radius: 16px; }

.status {
    display: flex; align-items: flex-start; gap: 10px; text-align: left;
    max-width: 460px; margin: 0 auto 14px; padding: 12px 14px;
    border-radius: 14px; font-size: .86rem; font-weight: 600; line-height: 1.45;
}
.status i { margin-top: 2px; flex-shrink: 0; }
.status.ok   { background: rgba(34, 197, 94, .13); color: #16a34a; }
.status.warn { background: rgba(249, 115, 22, .13); color: #ea580c; }
.status.info { background: var(--primary-soft); color: var(--text); }
.status a { color: inherit; font-weight: 800; text-decoration: underline; }

.perk-list { list-style: none; margin: 0; padding: 0; }
.perk-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 600; font-size: .92rem; }
.perk-list i {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px;
    display: grid; place-items: center;
    background: rgba(212, 175, 55, .15); color: var(--gold-dark);
}

details.manual summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.manual summary::-webkit-details-marker { display: none; }
details.manual summary::after { content: "\F229"; font-family: "bootstrap-icons"; transition: transform .2s; }
details.manual[open] summary::after { transform: rotate(180deg); }
details.manual .step-list { margin-top: 10px; }

.pwa-foot { text-align: center; color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.pwa-foot a { color: var(--text); font-weight: 800; }

/* steps */
.step-list { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px dashed var(--border); }
.step:first-child { padding-top: 4px; }
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-no {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: var(--navy-dark);
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { font-size: 1rem; font-weight: 800; margin: 3px 0 4px; }
.step-body p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.step-body p b { color: var(--text); }
.inline-ic {
    display: inline-grid; place-items: center; width: 26px; height: 26px;
    border-radius: 8px; vertical-align: middle; font-size: .9rem;
    background: var(--primary-soft); color: var(--text);
}

/* tiny iPhone mock-ups */
.mock { margin-top: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); overflow: hidden; }
.mock-bar { display: flex; justify-content: space-around; align-items: center; padding: 10px 8px; font-size: 1.25rem; color: var(--muted); }
.mock-bar .hot {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: var(--navy-dark);
    animation: pulseRing 1.8s infinite;
}
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, .6); }
    70%  { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}
.mock-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: .9rem; color: var(--muted);
}
.mock-row:last-child { border-bottom: 0; }
.mock-row.hot { background: rgba(212, 175, 55, .17); color: var(--text); font-weight: 800; }
.mock-add { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 700; }
.mock-add .cancel { color: var(--muted); }
.mock-add .add { background: var(--gold); color: var(--navy-dark); padding: 6px 18px; border-radius: 20px; font-weight: 800; }
.mock-app { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.mock-app img { width: 46px; height: 46px; border-radius: 12px; }
.mock-app span { font-weight: 800; }

@media (max-width: 575.98px) {
    .pwa-card { padding: 18px; border-radius: 20px; }
    .pwa-hero h1 { font-size: 1.5rem; }
}