﻿/*
    "Download App" footer prompt.

    Whether this appears on desktop is decided by SHOW_ON_DESKTOP in pwa-install.js,
    not here — one switch, not two that can disagree.

    Everything is scoped under .pwa-* so it cannot collide with backend.css or
    Common.css. Nothing here touches an existing selector.
*/

.pwa-install-bar {
    display: none;                 /* JS turns this on only when it makes sense */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;                 /* above content, below Bootstrap modals (1050) */
    background: #ffffff;
    border-top: 1px solid #DCDFE8;
    box-shadow: 0 -2px 12px rgba(17, 10, 87, .10);
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));  /* iPhone home bar */
    font-family: inherit;
    line-height: 1.35;
}

.pwa-install-bar.is-visible {
    display: block;
    animation: pwaSlideUp .28s ease-out;
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.pwa-install-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
    border: 1px solid #E7EAF1;
    background: #fff;
    object-fit: contain;
    padding: 4px;
}

.pwa-install-text {
    flex: 1 1 auto;
    min-width: 0;                  /* lets the text ellipsis instead of pushing the button off */
}

.pwa-install-title {
    font-size: 14px;
    font-weight: 600;
    color: #110A57;
    margin: 0 0 2px;
}

.pwa-install-sub {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pwa-btn-install {
    background: #110A57;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-btn-install:hover,
.pwa-btn-install:focus {
    background: #1B1178;
    color: #fff;
}

.pwa-btn-dismiss {
    background: transparent;
    border: 0;
    color: #9AA1B1;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.pwa-btn-dismiss:hover {
    color: #4B5563;
}

/* ---- iOS instruction sheet -------------------------------------------------
   Safari has no install prompt API, so the only thing we can do is tell the user
   where the button is. This is that panel. */

.pwa-ios-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(17, 10, 87, .45);
}

.pwa-ios-sheet.is-visible {
    display: block;
}

.pwa-ios-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 14px;
    padding: 20px 18px 16px;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}

.pwa-ios-panel h5 {
    font-size: 15px;
    font-weight: 600;
    color: #110A57;
    margin: 0 0 12px;
}

.pwa-ios-steps {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 13.5px;
    color: #374151;
}

.pwa-ios-steps li {
    margin-bottom: 8px;
}

.pwa-ios-share {
    display: inline-block;
    vertical-align: -3px;
    margin: 0 2px;
}

.pwa-ios-close {
    display: block;
    width: 100%;
    background: #F3F4F6;
    border: 0;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

/* Desktop is NOT hidden here any more — whether it shows is decided in JavaScript
   by SHOW_ON_DESKTOP in pwa-install.js, so there is one switch rather than two that
   can disagree. Hiding it here as well meant flipping the constant appeared to do
   nothing. */

/* When the app is already running from the home screen there is nothing to install. */
@media (display-mode: standalone) {
    .pwa-install-bar,
    .pwa-ios-sheet {
        display: none !important;
    }
}
