/* ESCALE FITNESS — invitation à installer la PWA (injectée par static/js/pwa.js).
   Autonome : chargée par la vitrine, la SPA et l'ancienne interface ; tout est préfixé `efi-`. */
.efi-root {
  --efi-brand: #db956a;
  --efi-brand-dark: #c8845a;
  --efi-tint: #f6e9e3;
  --efi-ink: #1f1f1f;
  --efi-muted: #6b6b6b;
  --efi-bottom: 16px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--efi-ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.efi-root [hidden] { display: none !important; }
.efi-root *, .efi-root *::before, .efi-root *::after { box-sizing: border-box; }
.efi-root svg { width: 100%; height: 100%; display: block; }
html.efi-locked, html.efi-locked body { overflow: hidden; }

/* ------------------------------------------------------------ pastille persistante */
.efi-pill {
  position: fixed; z-index: 1040;
  right: 14px; bottom: calc(var(--efi-bottom) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(219, 149, 106, .35);
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(31, 31, 31, .14), 0 0 0 0 rgba(219, 149, 106, .45);
  animation: efi-pill-in .5s cubic-bezier(.2, .9, .3, 1.2) both, efi-glow 2.4s ease-out 1s 2;
}
.efi-pill-open {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 5px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1; color: var(--efi-ink); letter-spacing: -.01em;
}
.efi-pill-open img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.efi-pill-close {
  width: 26px; height: 26px; margin-right: 4px; padding: 6px; border: 0; border-radius: 50%;
  background: transparent; color: var(--efi-muted); cursor: pointer;
}
.efi-pill-close:hover, .efi-pill-open:hover span { color: var(--efi-brand-dark); }
.efi-pill-open:focus-visible, .efi-pill-close:focus-visible, .efi-btn:focus-visible, .efi-close:focus-visible {
  outline: 2px solid var(--efi-brand); outline-offset: 2px;
}
@keyframes efi-pill-in { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes efi-glow {
  0% { box-shadow: 0 6px 22px rgba(31, 31, 31, .14), 0 0 0 0 rgba(219, 149, 106, .45); }
  70% { box-shadow: 0 6px 22px rgba(31, 31, 31, .14), 0 0 0 12px rgba(219, 149, 106, 0); }
  100% { box-shadow: 0 6px 22px rgba(31, 31, 31, .14), 0 0 0 0 rgba(219, 149, 106, 0); }
}
/* Laisser la place à l'invitation aux notifications de l'ancienne interface */
#push-invite-banner:not([hidden]) ~ .efi-root .efi-pill { display: none; }

/* ------------------------------------------------------------ feuille */
.efi-backdrop {
  position: fixed; inset: 0; z-index: 1060;
  background: rgba(20, 14, 10, .42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s ease;
}
.efi-sheet {
  position: fixed; z-index: 1061; left: 0; right: 0; bottom: 0;
  margin: 0 auto; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(31, 31, 31, .18);
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .9, .25, 1);
}
.efi-sheet::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 120px; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, var(--efi-tint) 0%, rgba(246, 233, 227, 0) 70%);
  border-radius: inherit;
}
.efi-open .efi-backdrop { opacity: 1; }
.efi-open .efi-sheet { transform: none; }
.efi-grip { display: block; width: 40px; height: 5px; border-radius: 99px; background: rgba(0, 0, 0, .12); margin: 0 auto 10px; }
.efi-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 8px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .05); color: var(--efi-muted); cursor: pointer;
}
.efi-close:hover { background: rgba(0, 0, 0, .09); color: var(--efi-ink); }

.efi-head { display: flex; align-items: center; gap: 14px; padding: 6px 36px 0 0; }
.efi-app-icon { width: 60px; height: 60px; border-radius: 15px; box-shadow: 0 6px 16px rgba(219, 149, 106, .35); flex: 0 0 auto; }
.efi-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--efi-ink); }
.efi-head p { margin: 3px 0 0; font-size: 14px; color: var(--efi-muted); }

.efi-perks { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px 0 4px; }
.efi-perks li {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  padding: 10px 4px; border-radius: 14px; background: #faf6f3;
  font-size: 11.5px; font-weight: 600; color: #4a4a4a; line-height: 1.2;
}
.efi-perks svg { width: 20px; height: 20px; color: var(--efi-brand-dark); }

.efi-body { margin-top: 14px; }
.efi-hint { margin: 0; font-size: 14px; color: var(--efi-muted); text-align: center; }
.efi-steps-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--efi-muted); text-transform: uppercase; letter-spacing: .06em; }

.efi-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: none; }
.efi-steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(0, 0, 0, .07);
  font-size: 14.5px; color: var(--efi-ink);
  animation: efi-step-in .4s ease both;
}
.efi-steps li:nth-child(2) { animation-delay: .06s; }
.efi-steps li:nth-child(3) { animation-delay: .12s; }
.efi-steps li:nth-child(4) { animation-delay: .18s; }
.efi-steps b { font-weight: 700; }
.efi-step-num {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--efi-brand); color: #fff; font-size: 12px; font-weight: 800;
}
.efi-step-icon {
  flex: 0 0 auto; width: 38px; height: 38px; padding: 8px; border-radius: 11px;
  background: #f2f2f7; color: #007aff; /* bleu des icônes système iOS */
}
.efi-root[data-platform="android"] .efi-step-icon, .efi-root[data-platform="desktop"] .efi-step-icon { background: #eef3fd; color: #1a73e8; }
.efi-step-text { flex: 1 1 auto; }
@keyframes efi-step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.efi-foot { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 16px; }
.efi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 18px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
}
.efi-btn svg { width: 20px; height: 20px; }
.efi-btn-primary { background: var(--efi-brand); color: #fff; box-shadow: 0 8px 20px rgba(219, 149, 106, .38); }
.efi-btn-primary:hover { background: var(--efi-brand-dark); }
.efi-btn-ghost { background: transparent; color: var(--efi-muted); padding: 10px; }
.efi-btn-ghost:hover { color: var(--efi-ink); }
.efi-guide-link { text-align: center; font-size: 13px; color: var(--efi-brand-dark); text-decoration: none; font-weight: 600; }
.efi-guide-link:hover { text-decoration: underline; }

/* Flèche vers le bouton Partager (Safari iPhone, barre du bas) */
.efi-pointer {
  position: fixed; z-index: 1062; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); pointer-events: none;
}
.efi-pointer span {
  display: block; width: 44px; height: 44px; padding: 10px; border-radius: 50%;
  background: #fff; color: #007aff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  animation: efi-bounce 1.2s ease-in-out infinite;
}
.efi-open .efi-sheet:has(~ .efi-pointer:not([hidden])) { margin-bottom: 56px; border-radius: 26px; }
@keyframes efi-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

@media (min-width: 640px) {
  .efi-sheet { bottom: 50%; border-radius: 26px; transform: translateY(calc(50% + 40px)); opacity: 0; transition: transform .3s ease, opacity .25s ease; }
  .efi-open .efi-sheet { transform: translateY(50%); opacity: 1; }
  .efi-pill { right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .efi-pill, .efi-steps li, .efi-pointer span { animation: none; }
  .efi-sheet, .efi-backdrop { transition: none; }
}
html[data-pwa-page="installer"] .efi-pill { display: none; }
.efi-sheet:focus { outline: none; }
