/*
 * Asking for notifications (Modules\Push\PushView, includes/js/push.js):
 * the invitation (.spa), the confirmation (.spt) and the settings window (.spp).
 */

/* ---- the invitation: a sheet at the foot of a phone, a corner box on a computer ---- */
.spa {
  position: fixed; z-index: 99990; direction: rtl;
  inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center;
  background: #fff; color: #1f2433;
  border-radius: 18px; padding: 16px;
  box-shadow: 0 12px 40px rgba(19, 22, 47, .28), 0 0 0 1px rgba(19, 22, 47, .05);
  font-size: 15px; line-height: 1.6;
  transform: translateY(24px); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.spa[hidden] { display: none; }
.spa.is-open { transform: none; opacity: 1; }
@media (min-width: 700px) {
  .spa { inset-inline: auto 24px; bottom: 24px; width: 380px; }
}

.spa__bell, .spp__bell {
  display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #1a2049, #3a2a6b); color: #e0b25a;
}
.spa__bell { width: 44px; height: 44px; border-radius: 14px; grid-row: span 1; }
.spa__bell svg { width: 24px; height: 24px; }
.spa__text b { display: block; font-size: 16px; color: #1a2049; }
.spa__text span { display: block; font-size: 14px; color: #5f6472; }
.spa__actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.spa__yes, .spa__later, .spp__btn {
  border: 0; border-radius: 999px; min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.spa__yes { flex: 1; background: #1a2049; color: #fff; }
.spa__yes:hover, .spa__yes:focus-visible { background: #262e66; }
.spa__later { background: #f2efe8; color: #4a4f5c; }
.spa__later:hover, .spa__later:focus-visible { background: #e8e3d8; }

/* ---- the confirmation ---- */
.spt {
  position: fixed; z-index: 100001; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px); opacity: 0;
  max-width: calc(100% - 32px); width: max-content;
  background: #1a2049; color: #fff; direction: rtl;
  padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; line-height: 1.5; text-align: center;
  box-shadow: 0 10px 30px rgba(19, 22, 47, .3);
  transition: transform .3s ease, opacity .3s ease;
}
.spt[hidden] { display: none; }
.spt.is-open { transform: translate(-50%, 0); opacity: 1; }

/* ---- the settings window ---- */
.spp { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; direction: rtl; }
.spp[hidden] { display: none; }
.spp__backdrop { position: absolute; inset: 0; background: rgba(19, 22, 47, .55); opacity: 0; transition: opacity .25s ease; }
.spp.is-open .spp__backdrop { opacity: 1; }
.spp__card {
  position: relative; width: 100%; max-width: 380px; text-align: center;
  background: #fff; color: #1f2433; border-radius: 24px; padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(19, 22, 47, .35);
  transform: translateY(16px) scale(.97); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.spp.is-open .spp__card { transform: none; opacity: 1; }
.spp__x {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #f2efe8; color: #4a4f5c; font-size: 22px; line-height: 36px; cursor: pointer;
}
.spp__bell { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; }
.spp__bell svg { width: 32px; height: 32px; }
.spp__title { font-size: 20px; font-weight: 800; color: #1a2049; margin: 0 0 8px; }
.spp__text { margin: 0 0 14px; color: #5f6472; font-size: 15px; line-height: 1.7; }
.spp__text[hidden], .spp__topics[hidden], .spp__btn[hidden] { display: none; }
.spp__topics { display: grid; gap: 8px; margin: 0 0 16px; text-align: start; }
.spp__topics label {
  display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; background: #f6f3ec; font-weight: 600; font-size: 15px;
}
.spp__topics input { width: 20px; height: 20px; margin: 0; accent-color: #1a2049; }
.spp__actions { display: flex; flex-direction: column; gap: 8px; }
.spp__btn { background: #1a2049; color: #fff; }
.spp__btn:hover, .spp__btn:focus-visible { background: #262e66; }
.spp__btn--ghost { background: transparent; color: #7a2335; }
.spp__btn--ghost:hover, .spp__btn--ghost:focus-visible { background: #f8eef0; }
.spp__btn:disabled { opacity: .6; cursor: wait; }
.spp__msg { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #1d6b40; }
.spp__msg:empty { display: none; }

.spa__yes:focus-visible, .spa__later:focus-visible, .spp__btn:focus-visible, .spp__x:focus-visible { outline: 3px solid #e0b25a; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .spa, .spt, .spp__card, .spp__backdrop { transition: none; }
}
