/* ============================================================
   📱 PWA Install Popup + ✒️ Text Format — ملف إضافي لا يمس style.css
   ============================================================ */

/* ---------- تنسيق النصوص العام (التسوية + رموز السطور) ---------- */
.fmt-out { display: block; overflow-wrap: anywhere; }
.fmt-line { display: block; }
.fmt-line + .fmt-line { margin-top: 2px; }
.fmt-bullet {
  color: var(--primary, #0ea5e9);
  font-weight: 900;
  margin-inline-end: 8px;
  display: inline-block;
}

/* ---------- نافذة تثبيت التطبيق ---------- */
.pwa-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0; transition: opacity 0.35s ease;
}
.pwa-backdrop.show { opacity: 1; }

.pwa-popup {
  position: fixed;
  z-index: 9999;
  bottom: 18px; right: 18px; left: 18px;
  margin-inline: auto;
  max-width: 430px;
  background: var(--pwa-bg, #fff);
  color: #0f172a;
  border-radius: 24px;
  padding: 22px 20px 18px;
  box-shadow: 0 25px 70px rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(14, 165, 233, 0.18);
  font-family: 'Cairo', tahoma, sans-serif;
  transform: translateY(130%); opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.pwa-popup.show { transform: none; opacity: 1; }
.pwa-popup.hide { transform: translateY(130%); opacity: 0; }

@media (min-width: 640px) {
  .pwa-popup { right: auto; left: 26px; bottom: 26px; margin: 0; }
}

.pwa-close {
  position: absolute; top: 10px; left: 10px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: #f1f5f9; color: #475569;
  font-size: 16px; font-weight: 900; line-height: 1;
  cursor: pointer; transition: 0.25s;
  display: flex; align-items: center; justify-content: center;
}
.pwa-close:hover { background: #fee2e2; color: #dc2626; transform: rotate(90deg); }

.pwa-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; padding-left: 30px; }
.pwa-icon {
  width: 64px; height: 64px; border-radius: 18px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
  border: 2px solid #e0f2fe; background: #fff;
}
.pwa-icon-fallback {
  width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9, #0a2540);
  color: #fff; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
}
.pwa-head h3 { font-size: 18px; font-weight: 900; color: #0a2540; margin: 0; }
.pwa-head small { color: #64748b; font-weight: 700; font-size: 12px; }

.pwa-text { font-size: 14.5px; color: #334155; margin: 6px 0 12px; }

.pwa-ios {
  background: #f0f9ff; border: 1.5px dashed #0ea5e9;
  border-radius: 14px; padding: 12px 14px;
  font-size: 14px; color: #0c4a6e; margin-bottom: 12px;
}

.pwa-actions { display: flex; gap: 10px; }
.pwa-install {
  flex: 1.4; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--pwa-btn, #0ea5e9), #1d4ed8);
  color: #fff; font-weight: 900; font-family: inherit; font-size: 15.5px;
  padding: 13px 10px; border-radius: 14px;
  box-shadow: 0 10px 22px -6px rgba(14, 165, 233, 0.55);
  transition: 0.25s;
}
.pwa-install:hover { transform: translateY(-2px); }
.pwa-later {
  flex: 1; cursor: pointer; font-family: inherit;
  background: #f1f5f9; color: #475569; border: 0;
  font-weight: 800; font-size: 14.5px;
  padding: 13px 10px; border-radius: 14px; transition: 0.25s;
}
.pwa-later:hover { background: #e2e8f0; }

.pwa-manual {
  display: none; margin-top: 10px; font-size: 13px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 12px; padding: 10px 12px; font-weight: 700;
}
.pwa-manual.show { display: block; }

/* ---------- سياقات مضمّنة: النص المنسّق يبقى سطرياً داخل الروابط والشريط ---------- */
a .fmt-out, .tick .fmt-out, .pwa-head .fmt-out, button .fmt-out { display: inline; }
a .fmt-line, .tick .fmt-line, .pwa-head .fmt-line, button .fmt-line { display: inline; }
