/* PWA Install Button – Frontend */

/* ── Install Button ─────────────────────────────── */
.pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .4rem 1rem;
    border-radius: 16px;
    border: .5px solid currentColor;
    background: var(--pwa-accent, #aadd00);
    color: var(--pwa-dark, #141410);
    font-size: .82rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .18s, transform .18s;
    white-space: nowrap;
}
.pwa-install-btn:hover { opacity: .88; }
.pwa-install-btn:active { transform: scale(.97); }
.pwa-install-btn[hidden] { display: none; }

/* FAB variant */
#pwa-install-fab-wrap {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    right: 20px;
    z-index: 9000;
}
.pwa-install-fab {
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    border-radius: 24px;
    padding: .55rem 1.1rem;
}

/* ── Toast ──────────────────────────────────────── */
#pwa-ib-toast {
    position: fixed;
    bottom: max(80px, calc(env(safe-area-inset-bottom, 0px) + 80px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20,20,16,.92);
    color: #fff;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 24px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    z-index: 99999;
    backdrop-filter: blur(8px);
}
#pwa-ib-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── iOS Modal Overlay ──────────────────────────── */
#pwa-ib-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
#pwa-ib-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal Sheet ────────────────────────────────── */
#pwa-ib-modal {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    padding: 12px 20px max(24px, env(safe-area-inset-bottom, 24px));
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    position: relative;
}
#pwa-ib-overlay.open #pwa-ib-modal {
    transform: translateY(0);
}

.pwa-ib-handle {
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,.18);
    margin: 0 auto 16px;
}

/* App header row */
.pwa-ib-app-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.pwa-ib-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}
.pwa-ib-app-icon img { width: 100%; height: 100%; object-fit: cover; }
.pwa-ib-app-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
.pwa-ib-app-sub {
    font-size: .78rem;
    opacity: .45;
    margin-top: 3px;
}

/* Steps */
.pwa-ib-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.pwa-ib-step {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.05);
    border-radius: 12px;
    padding: 12px 14px;
    border: .5px solid rgba(255,255,255,.07);
    animation: pwaStepIn .4s ease both;
}
.pwa-ib-step:nth-child(1) { animation-delay: .05s; }
.pwa-ib-step:nth-child(2) { animation-delay: .12s; }
.pwa-ib-step:nth-child(3) { animation-delay: .19s; }
@keyframes pwaStepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pwa-ib-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.pwa-ib-step-body { flex: 1; }
.pwa-ib-step-title {
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: 2px;
}
.pwa-ib-step-desc {
    font-size: .73rem;
    opacity: .5;
    line-height: 1.4;
}
.pwa-ib-step-svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: .35;
}
.pwa-ib-step-svg svg { width: 100%; height: 100%; }

/* Bottom arrow indicator for iOS share sheet */
.pwa-ib-arrow-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .72rem;
    opacity: .4;
    margin-bottom: 16px;
}
.pwa-ib-arrow-hint svg { width: 14px; height: 14px; }

/* Close button */
.pwa-ib-close {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: .5px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: inherit;
    font-size: .85rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s;
}
.pwa-ib-close:hover { background: rgba(255,255,255,.1); }
