/* =============================================
   iCare PWA — 更新提示 / 安裝引導
   （元素都是 icare-pwa.js 動態產生的，平常頁面上不存在）

   注意：這支 CSS 刻意獨立於 icare-public.css，
   因為登入頁、忘記密碼頁沒有載入 icare-public.css，
   但一樣需要安裝引導，所以這裡不使用 --icare-* 變數。
   ============================================= */

.icare-pwa-toast,
.icare-pwa-sheet {
    --icare-pwa-primary: #2D6BE4;
    --icare-pwa-text:    #1E293B;
    --icare-pwa-muted:   #64748B;
    --icare-pwa-border:  #E2E8F0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

/* ---------- 共用按鈕 ---------- */
.icare-pwa-btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.icare-pwa-btn-primary {
    background: var(--icare-pwa-primary);
    color: #fff;
}
.icare-pwa-btn-primary:disabled {
    opacity: .6;
    cursor: default;
}
.icare-pwa-btn-text {
    background: transparent;
    color: var(--icare-pwa-muted);
}

/* ---------- 新版本提示（右下角小浮條） ---------- */
.icare-pwa-toast {
    position: fixed;
    z-index: 100000;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
    background: #fff;
    color: var(--icare-pwa-text);
    border: 1px solid var(--icare-pwa-border);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: icare-pwa-slide-up .25s ease-out;
}
.icare-pwa-toast-text {
    font-size: 15px;
    font-weight: 600;
}
.icare-pwa-toast-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.icare-pwa-toast .icare-pwa-btn {
    padding: 8px 14px;
    font-size: 14px;
}

/* ---------- 安裝引導（底部彈出面板） ---------- */
.icare-pwa-sheet {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 100001;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.icare-pwa-sheet-panel {
    background: #fff;
    color: var(--icare-pwa-text);
    width: 100%;
    max-width: 480px;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .2);
    animation: icare-pwa-slide-up .28s ease-out;
}
@media (min-width: 600px) {
    .icare-pwa-sheet {
        align-items: center;
    }
    .icare-pwa-sheet-panel {
        border-radius: 16px;
        padding-bottom: 20px;
    }
}

.icare-pwa-sheet-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.icare-pwa-sheet-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex: 0 0 auto;
    object-fit: contain;
    background: #F4F6FA;
}
.icare-pwa-sheet-headtext {
    flex: 1 1 auto;
    min-width: 0;
}
.icare-pwa-sheet-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}
.icare-pwa-sheet-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--icare-pwa-muted);
}
.icare-pwa-sheet-close {
    appearance: none;
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    color: var(--icare-pwa-muted);
    cursor: pointer;
    padding: 4px;
    flex: 0 0 auto;
}

/* iOS 手動加入主畫面的步驟說明 */
.icare-pwa-steps {
    margin: 16px 0 0;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--icare-pwa-text);
}

.icare-pwa-sheet-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

@keyframes icare-pwa-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .icare-pwa-toast,
    .icare-pwa-sheet-panel {
        animation: none;
    }
}
