/*
 * The "install the app" popup (#scInstall in includes/header.php, driven by
 * app.js): a centred card over a dimmed page, the app's icon at the top,
 * what installing gives, and two buttons. On an iPhone (.is-ios) the install
 * button gives way to the three steps of the share menu.
 */

.sci {
  position: fixed; inset: 0; z-index: 100000;
  display: grid; place-items: center; padding: 16px;
  font-family: inherit; direction: rtl;
}
.sci[hidden] { display: none; }

.sci__backdrop {
  position: absolute; inset: 0;
  background: rgba(19, 22, 47, .55);
  opacity: 0; transition: opacity .25s ease;
}
.sci.is-open .sci__backdrop { opacity: 1; }

.sci__card {
  position: relative; width: 100%; max-width: 380px;
  background: #fff; color: #1f2433;
  border-radius: 24px; padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(19, 22, 47, .35);
  text-align: center;
  transform: translateY(16px) scale(.97); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.sci.is-open .sci__card { transform: none; opacity: 1; }

/* A soft band of the site's colours behind the icon. */
.sci__card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 92px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(135deg, #1a2049 0%, #3a2a6b 55%, #7a2335 100%);
}

.sci__x {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .18); color: #fff;
  font-size: 22px; line-height: 36px; cursor: pointer;
}
.sci__x:hover, .sci__x:focus-visible { background: rgba(255, 255, 255, .3); }

.sci__icon {
  position: relative; display: block; margin: 12px auto 14px;
  width: 84px; height: 84px; border-radius: 22px;
  background: #fff; box-shadow: 0 8px 22px rgba(19, 22, 47, .25);
  border: 4px solid #fff;
}

.sci__title { font-size: 21px; font-weight: 800; color: #1a2049; margin: 0 0 6px; line-height: 1.4; }
.sci__lead { font-size: 15px; color: #5f6472; margin: 0 0 16px; line-height: 1.7; }

.sci__perks { list-style: none; margin: 0 0 20px; padding: 14px 16px; background: #f6f3ec; border-radius: 16px; text-align: start; }
.sci__perks li { position: relative; padding-inline-start: 28px; font-size: 14.5px; line-height: 1.6; margin: 6px 0; color: #2d3346; }
.sci__perks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #1d6b40; color: #fff; font-size: 12px; line-height: 20px; text-align: center; font-weight: 700;
}

/* The iPhone steps. */
.sci__steps { display: none; list-style: none; margin: 0 0 20px; padding: 0; text-align: start; counter-reset: sci; }
.sci.is-ios .sci__steps { display: block; }
.sci.is-ios .sci__perks { display: none; }
.sci__steps li {
  counter-increment: sci; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 0 0 8px; border-radius: 14px; background: #f6f3ec;
  font-size: 15px; line-height: 1.5;
}
.sci__steps li::before {
  content: counter(sci); flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #1a2049; color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.sci__steps svg { display: inline-block; width: 20px; height: 20px; margin: 0 2px; vertical-align: -4px; color: #1f6fd1; }

.sci__actions { display: flex; flex-direction: column; gap: 8px; }
.sci__btn {
  border: 0; border-radius: 999px; padding: 14px 18px; min-height: 48px;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .1s ease, background-color .15s ease;
}
.sci__btn:active { transform: scale(.98); }
.sci__btn--main { background: #1a2049; color: #fff; box-shadow: 0 6px 16px rgba(26, 32, 73, .3); }
.sci__btn--main:hover, .sci__btn--main:focus-visible { background: #262e66; }
.sci__btn--ghost { background: transparent; color: #5f6472; font-weight: 600; }
.sci__btn--ghost:hover, .sci__btn--ghost:focus-visible { background: #f2f0ea; color: #1f2433; }
.sci__btn:focus-visible, .sci__x:focus-visible { outline: 3px solid #e0b25a; outline-offset: 2px; }

/* Install on Android and computers; "got it" on an iPhone. */
.sci [data-sci-ok] { display: none; }
.sci.is-ios [data-sci-ok] { display: block; }
.sci.is-ios [data-sci-install] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sci__card, .sci__backdrop { transition: none; }
}
