/* Fenêtre d'installation de l'application (site et administration) */
.inst { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.inst[hidden], .inst-bar[hidden] { display: none !important; }
.inst__backdrop { position: absolute; inset: 0; background: rgba(4, 14, 26, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s ease; }
.inst__panel { position: relative; width: min(440px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px 24px 22px; border-radius: 22px; background: #fff; color: #0f1f3d; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .25s ease; }
.inst.is-open .inst__backdrop { opacity: 1; }
.inst.is-open .inst__panel { transform: none; opacity: 1; }
.inst__x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.inst__x:hover { background: #e2e8f0; }
.inst__head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; padding-right: 30px; }
.inst__icon { flex: none; width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px rgba(0, 29, 47, .25); }
.inst__kicker { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #0f866c; }
.inst__title { margin: 2px 0 4px; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.inst__sub { margin: 0; font-size: .875rem; line-height: 1.5; color: #64748b; }

.inst__progress { position: relative; height: 12px; border-radius: 99px; background: #e8eef4; overflow: hidden; }
.inst__fill { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #0f866c, #19b08c); transition: width .45s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
.inst__fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%); transform: translateX(-100%); animation: inst-shine 1.4s linear infinite; }
.inst.is-done .inst__fill::after { animation: none; }
@keyframes inst-shine { to { transform: translateX(100%); } }
.inst__pct { display: flex; align-items: baseline; gap: 4px; margin: 10px 0 18px; font-size: .9rem; color: #475569; }
.inst__pct strong { font-size: 1.35rem; color: #0f1f3d; font-variant-numeric: tabular-nums; }
.inst__pct span { margin-left: 8px; }

.inst__steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inst__steps li { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: #94a3b8; transition: color .2s; }
.inst__steps small { color: #94a3b8; font-variant-numeric: tabular-nums; }
.inst__dot { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; transition: all .25s; }
.inst__steps li.is-active { color: #0f1f3d; font-weight: 600; }
.inst__steps li.is-active .inst__dot { border-color: #0f866c; box-shadow: 0 0 0 4px rgba(15, 134, 108, .15); animation: inst-pulse 1.2s ease-in-out infinite; }
.inst__steps li.is-done { color: #0f1f3d; }
.inst__steps li.is-done .inst__dot { border-color: #0f866c; background: #0f866c; }
.inst__steps li.is-done .inst__dot::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.inst__steps li.is-error { color: #b42318; }
.inst__steps li.is-error .inst__dot { border-color: #b42318; }
@keyframes inst-pulse { 50% { box-shadow: 0 0 0 7px rgba(15, 134, 108, .08); } }

.inst__guide { margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; background: #f1f7fb; border: 1px solid #dbe7f0; font-size: .875rem; color: #334155; }
.inst__guide-title { margin: 0 0 8px; font-weight: 700; color: #0f1f3d; }
.inst__guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.inst__share { display: inline-block; width: 14px; height: 16px; vertical-align: -3px; border: 2px solid #0a84ff; border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.inst__share::before { content: ""; position: absolute; left: 4px; top: -7px; width: 2px; height: 11px; background: #0a84ff; }
.inst__share::after { content: ""; position: absolute; left: 1px; top: -7px; width: 6px; height: 6px; border: solid #0a84ff; border-width: 2px 2px 0 0; transform: rotate(-45deg); }

.inst__actions { display: flex; flex-direction: column; gap: 8px; }
.inst__btn { height: 50px; border: 0; border-radius: 999px; background: #001d2f; color: #fff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; }
.inst__btn:hover:not(:disabled) { background: #0f866c; }
.inst__btn:active:not(:disabled) { transform: scale(.98); }
.inst__btn:disabled { opacity: .6; cursor: progress; }
.inst__btn--ghost { height: 42px; background: transparent; color: #64748b; font-size: .9rem; }
.inst__btn--ghost:hover:not(:disabled) { background: #f1f5f9; color: #0f1f3d; }
.inst.is-done .inst__btn { background: #0f866c; }

/* Mobile : panneau qui monte du bas de l'écran */
@media (max-width: 600px) {
  .inst { align-items: flex-end; padding: 0; }
  .inst__panel { width: 100%; border-radius: 22px 22px 0 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .inst__panel::before { content: ""; display: block; width: 40px; height: 4px; margin: -8px auto 16px; border-radius: 99px; background: #cbd5e1; }
}

/* Bandeau discret (site, mobile) */
.inst-bar { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 900; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px; background: #001d2f; color: #fff; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); transform: translateY(20px); opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s; font-family: Inter, system-ui, sans-serif; }
.inst-bar.is-on { transform: none; opacity: 1; }
.inst-bar img { flex: none; border-radius: 10px; }
.inst-bar p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.3; }
.inst-bar p strong { font-size: .9rem; }
.inst-bar p span { font-size: .75rem; color: rgba(255, 255, 255, .7); }
.inst-bar__go { flex: none; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: #19b08c; color: #fff; font: inherit; font-weight: 700; font-size: .875rem; cursor: pointer; }
.inst-bar__x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
html.inst-open { overflow: hidden; }
@media (display-mode: standalone) { .inst-bar { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .inst__panel, .inst__backdrop, .inst-bar, .inst__fill { transition: none; } .inst__fill::after, .inst__steps li.is-active .inst__dot { animation: none; } }
