/* CLARIO Cash — bandeau d'installation et marche a suivre (module PWA).
   Autonome : utilise sur le site, la connexion, l'espace commercant et
   l'admin, qui n'ont pas les memes feuilles de style. */

.pwa-banner, .pwa-sheet, .pwa-toast {
    --pwa-bg: #FFFFFF;
    --pwa-text: #1E2F26;
    --pwa-muted: #55675D;
    --pwa-border: rgba(11, 94, 52, .14);
    --pwa-green: #0E8C4F;
    --pwa-orange: #FF6B00;
    font-family: inherit;
    box-sizing: border-box;
}
body.dark-mode .pwa-banner, body.dark-mode .pwa-sheet, body.dark-mode .pwa-toast {
    --pwa-bg: #0B221A;
    --pwa-text: #E8F5EE;
    --pwa-muted: #9DB3A7;
    --pwa-border: rgba(148, 196, 168, .2);
    --pwa-green: #34D399;
}
.pwa-banner *, .pwa-sheet * { box-sizing: border-box; }
[data-pwa-install][hidden], [data-pwa-installed][hidden], [data-pwa-unsupported][hidden] { display: none !important; }

/* --- Bandeau --- */
.pwa-banner {
    position: fixed; z-index: 99990; left: 16px; bottom: 16px;
    width: min(420px, calc(100vw - 32px));
    display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px 14px; align-items: center;
    padding: 16px; border-radius: 20px;
    background: var(--pwa-bg); color: var(--pwa-text);
    border: 1px solid var(--pwa-border);
    box-shadow: 0 24px 60px -20px rgba(6, 24, 18, .55);
    transform: translateY(24px); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.pwa-banner.is-in { transform: none; opacity: 1; }
.pwa-banner-icon { width: 48px; height: 48px; border-radius: 12px; display: block; }
.pwa-banner-text strong { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.25; color: var(--pwa-text); }
.pwa-banner-text span { display: block; font-size: 13.5px; line-height: 1.45; color: var(--pwa-muted); margin-top: 3px; }
.pwa-banner-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.pwa-banner-actions .pwa-btn { flex: 1 1 auto; }

.pwa-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
    font: inherit; font-weight: 700; font-size: 14.5px; line-height: 1.2;
    transition: background .2s ease, transform .2s ease;
}
.pwa-btn-primary { background: #FF6B00; color: #fff; box-shadow: 0 10px 24px -12px rgba(255, 107, 0, .9); }
.pwa-btn-primary:hover { background: #E85F00; transform: translateY(-1px); }
.pwa-btn-ghost { background: transparent; color: var(--pwa-muted); border: 1px solid var(--pwa-border); }
.pwa-btn-ghost:hover { color: var(--pwa-text); }
.pwa-btn:focus-visible, .pwa-sheet-close:focus-visible { outline: 3px solid rgba(255, 107, 0, .45); outline-offset: 2px; }

@media (max-width: 575px) {
    .pwa-banner { left: 10px; right: 10px; bottom: 10px; width: auto; }
}

/* --- Marche a suivre (iPhone, iPad, Safari Mac) --- */
.pwa-sheet-overlay {
    position: fixed; inset: 0; z-index: 99995; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(3, 14, 10, .55); opacity: 0; transition: opacity .25s ease; padding: 12px;
}
.pwa-sheet-overlay.is-in { opacity: 1; }
.pwa-sheet {
    width: min(460px, 100%); padding: 22px; border-radius: 24px;
    background: var(--pwa-bg); color: var(--pwa-text); border: 1px solid var(--pwa-border);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6);
    transform: translateY(30px); transition: transform .25s ease;
}
.pwa-sheet-overlay.is-in .pwa-sheet { transform: none; }
@media (min-width: 768px) { .pwa-sheet-overlay { align-items: center; } }
.pwa-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pwa-sheet-head img { width: 44px; height: 44px; border-radius: 11px; }
.pwa-sheet-head strong { flex: 1 1 auto; font-size: 17px; font-weight: 800; }
.pwa-sheet-close { border: 0; background: transparent; color: var(--pwa-muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.pwa-sheet ol { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.pwa-sheet li { display: flex; gap: 12px; align-items: flex-start; }
.pwa-sheet li > span {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
    background: var(--pwa-green); color: #fff; font-weight: 800; font-size: 14px;
}
body.dark-mode .pwa-sheet li > span { color: #061812; }
.pwa-sheet li p { margin: 3px 0 0; font-size: 15px; line-height: 1.5; color: var(--pwa-text); }
.pwa-share { vertical-align: -3px; color: #0A84FF; }
.pwa-sheet-ok { width: 100%; }

/* --- Confirmation --- */
.pwa-toast {
    position: fixed; z-index: 99996; left: 50%; bottom: 20px; transform: translate(-50%, 20px);
    max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
    background: var(--pwa-bg); color: var(--pwa-text); border: 1px solid var(--pwa-border);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45); font-size: 14.5px; font-weight: 600;
    opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.pwa-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    .pwa-banner, .pwa-sheet, .pwa-sheet-overlay, .pwa-toast, .pwa-btn { transition: none; }
}
