/* Pinglo — support UI (js/support.js): floating «تحتاج مساعدة؟» button, the report / contact / about window
 * (a centred dialog on desktop, a bottom sheet on phones), the homepage #contact section. Loaded after redesign.css,
 * uses its tokens (paper, ink, blue, red sun). Logical properties → RTL and LTR mirror. */

html.sp-lock { overflow: hidden; }

/* ---------- floating button ---------- */
.sp-fab {
  position: fixed; z-index: 240; inset-inline-end: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 9px; height: 52px; padding-inline: 14px 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font: 600 14.5px/1 inherit; font-family: inherit; cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(20, 24, 33, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .2s ease, box-shadow .2s ease;
  --i-fill: #fff; --i-fill-o: .16;
}
.sp-fab .pg-i { width: 26px; height: 26px; stroke-width: 1.6; }
.sp-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(20, 24, 33, .6); }
.sp-fab:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sp-fab-s { display: none; }
@media (max-width: 640px) {
  .sp-fab { height: 48px; padding-inline: 11px 15px; inset-inline-end: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 13.5px; }
  .sp-fab-l { display: none; }
  .sp-fab-s { display: inline; }
}
@media print { .sp-fab { display: none; } }

/* ---------- window ---------- */
.sp-overlay {
  position: fixed; inset: 0; z-index: 450; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(22, 26, 35, .46); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .18s ease;
}
.sp-overlay.show { opacity: 1; }
/* the overlay sets display:flex, which beats the browser's own [hidden] rule — without this a closed window stays
   on top of the page, invisible, and swallows every click and scroll */
.sp-overlay[hidden] { display: none; }
.sp-sheet {
  position: relative; width: min(640px, 100%); max-height: min(90vh, 860px); display: flex; flex-direction: column;
  background: #fff; border-radius: 26px; box-shadow: 0 40px 80px -30px rgba(20, 24, 33, .5);
  transform: translateY(14px) scale(.985); transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
.sp-overlay.show .sp-sheet { transform: none; }
.sp-sheet.sp-v-about { width: min(720px, 100%); }
.sp-body { overflow-y: auto; overscroll-behavior: contain; padding: 30px 30px 28px; }
.sp-x {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.sp-x .pg-i { width: 18px; height: 18px; stroke-width: 2; }
.sp-x:hover { background: var(--paper); }
@media (max-width: 640px) {
  .sp-overlay { align-items: flex-end; padding: 0; }
  .sp-sheet, .sp-sheet.sp-v-about { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; transform: translateY(40px); }
  .sp-sheet::before { content: ""; position: absolute; top: 8px; inset-inline: 0; margin: auto; width: 42px; height: 4px; border-radius: 4px; background: var(--line-strong); }
  .sp-body { padding: 30px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .sp-overlay, .sp-sheet { transition: none; } }

.sp-head { padding-inline-end: 44px; margin-bottom: 20px; }
.sp-head h2 { margin: 10px 0 0; font-size: clamp(20px, 3.4vw, 25px); line-height: 1.4; color: var(--ink); font-weight: 600; }
.sp-head p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.sp-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--blue);
  background: var(--blue-tint); border-radius: 999px; padding: 5px 12px 5px 12px;
}
.sp-eyebrow .pg-i { width: 18px; height: 18px; stroke-width: 1.7; color: var(--ink); }
.sp-cat-chip.is-urgent { color: #B42D33; background: #FDEDEC; }
.sp-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.sp-back::before { content: "→"; }
[dir="ltr"] .sp-back::before { content: "←"; }
.sp-back:hover { color: var(--ink); }

/* step 1: problem tiles */
.sp-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sp-cat {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 112px; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font: inherit; text-align: start; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s;
}
.sp-cat .pg-i { width: 30px; height: 30px; stroke-width: 1.5; }
.sp-cat span { font-size: 14px; font-weight: 600; line-height: 1.5; }
.sp-cat small { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 11px; font-weight: 600; color: #B42D33; background: #FDEDEC; border-radius: 999px; padding: 2px 8px; }
.sp-cat.is-other { border-style: dashed; background: var(--paper); }
.sp-cat.is-other small { color: var(--muted); background: #fff; }
.sp-cat:hover { border-color: var(--blue-200); transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(26, 42, 80, .45); }
.sp-cat:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 640px) {
  .sp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-cat { min-height: 104px; padding: 12px; }
  .sp-cat.is-other { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
  .sp-cat.is-other small { position: static; margin-inline-start: auto; }
}
.sp-ask {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: start;
}
.sp-ask .pg-i { width: 24px; height: 24px; }
.sp-ask b { margin-inline-start: auto; color: var(--blue); }
[dir="ltr"] .sp-ask b { transform: scaleX(-1); }
.sp-ask:hover { border-color: var(--blue-200); }

/* self-help tip */
.sp-tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 16px; background: #FFF9EC; border: 1px solid #F2E2BE; }
.sp-tip .pg-i { width: 28px; height: 28px; flex: none; color: var(--ink); --i-fill: #E0A21A; --i-fill-o: .22; }
.sp-tip strong { display: block; font-size: 13.5px; color: #7A5600; }
.sp-tip p { margin: 4px 0 0; font-size: 14px; line-height: 1.8; color: var(--ink); }

/* forms */
.sp-form { display: grid; gap: 14px; }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sp-grid .sp-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .sp-grid { grid-template-columns: minmax(0, 1fr); } }
.sp-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.sp-lbl { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sp-lbl em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.sp-input {
  width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 13px;
  background: #fff; color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea.sp-input { height: auto; min-height: 110px; padding: 12px 14px; line-height: 1.75; resize: vertical; }
.sp-input::placeholder { color: #9A9EA8; }
.sp-input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 111, 224, .12); }
.sp-field.bad .sp-input { border-color: var(--red); box-shadow: 0 0 0 4px rgba(224, 69, 58, .1); }
.sp-hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.sp-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-linked { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 13px; background: var(--green-tint); color: var(--green-text); font-size: 14px; font-weight: 600; --i-fill: var(--green); }
.sp-linked .pg-i { width: 22px; height: 22px; color: var(--green-text); }
.sp-seg { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-seg legend { padding: 0; margin-bottom: 8px; width: 100%; }
.sp-seg label { position: relative; cursor: pointer; }
.sp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sp-seg label span { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 14px; color: var(--ink); transition: all .15s; }
.sp-seg label span .pg-i { width: 18px; height: 18px; }
.sp-seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; --i-fill: #fff; --i-sun: #fff; }
.sp-seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.sp-err { padding: 10px 14px; border-radius: 12px; background: #FDEDEC; color: #9E1F25; font-size: 14px; }
.sp-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 54px; border: 0; border-radius: 15px;
  background: var(--blue); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s;
  --i-fill: #fff; --i-fill-o: .25;
}
.sp-submit .pg-i { width: 22px; height: 22px; }
[dir="rtl"] .sp-submit .pg-i { transform: scaleX(-1); }
.sp-submit:hover { background: var(--blue-deep); }
.sp-submit:disabled { opacity: .75; cursor: progress; }
.sp-spin { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: sp-spin .7s linear infinite; }
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* done: a boarding-pass style stub with the ticket number */
.sp-done { text-align: center; padding: 8px 0 4px; display: grid; justify-items: center; gap: 10px; }
.sp-done-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; position: relative; --i-fill: #fff; --i-fill-o: .2; }
.sp-done-ic::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--green); animation: jr-ping 2.4s ease-out infinite; }
.sp-done-ic .pg-i { width: 40px; height: 40px; stroke-width: 1.7; }
.sp-done h2 { margin: 8px 0 0; font-size: 24px; color: var(--ink); font-weight: 600; }
.sp-done p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.8; max-width: 420px; }
.sp-ticket {
  position: relative; width: min(360px, 100%); margin: 10px 0 8px; padding: 18px 20px; display: grid; gap: 4px; box-sizing: border-box;
  border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--paper);
}
.sp-ticket::before, .sp-ticket::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #fff; border: 1.5px dashed var(--line-strong); }
.sp-ticket::before { inset-inline-start: -10px; }
.sp-ticket::after { inset-inline-end: -10px; }
.sp-ticket span { font-size: 12.5px; color: var(--muted); }
.sp-ticket strong { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 28px; letter-spacing: .06em; color: var(--ink); }
.sp-ticket small { font-size: 12px; color: var(--muted); }
.sp-done .sp-submit { width: min(360px, 100%); margin-top: 4px; }

/* ---------- about: story + an official-document card with a hanko-style seal ---------- */
.sp-about-hero { padding-inline-end: 40px; }
.sp-about-hero img { display: block; height: 30px; width: auto; margin-bottom: 16px; }
.sp-about-hero h2 { margin: 10px 0 0; font-size: clamp(21px, 3.6vw, 27px); line-height: 1.4; color: var(--ink); font-weight: 600; }
.sp-about-hero p { margin: 10px 0 0; font-size: 15px; line-height: 1.95; color: var(--text); }
.sp-values { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sp-values span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink); background: #fff; }
.sp-values .pg-i { width: 19px; height: 19px; }
.sp-idcard {
  position: relative; margin-top: 22px; border: 1px solid var(--line); border-radius: 20px; padding: 6px 18px 8px; overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(224, 69, 58, .06) 0 90px, transparent 91px),
    repeating-linear-gradient(135deg, rgba(38, 42, 51, .022) 0 2px, transparent 2px 9px),
    var(--paper);
}
.sp-idcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); }
.sp-idcard-head strong { font-size: 15px; color: var(--ink); }
.sp-seal {
  flex: none; width: 74px; height: 74px; margin: 8px 0 -4px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  color: var(--red); border: 2.5px solid var(--red); box-shadow: 0 0 0 3px #fff inset, 0 0 0 4.5px var(--red) inset;
  transform: rotate(-12deg); opacity: .9; mix-blend-mode: multiply;
}
.sp-seal span { font-size: 17px; font-weight: 700; line-height: 1.1; }
.sp-seal small { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 8.5px; font-weight: 600; letter-spacing: .12em; margin-top: 2px; }
.sp-id-row { display: grid; grid-template-columns: 26px minmax(0, 11rem) minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sp-id-row:last-child { border-bottom: 0; }
.sp-id-row .pg-i { width: 22px; height: 22px; color: var(--ink); }
.sp-id-row > span { font-size: 13.5px; color: var(--muted); }
.sp-id-row b { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.sp-id-row b[dir="ltr"] { font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .03em; unicode-bidi: isolate; }
.sp-id-row a { color: var(--blue); font-weight: 600; text-decoration: none; unicode-bidi: isolate; }
.sp-id-row .sp-verify { display: inline-block; margin-inline-start: 10px; font-size: 13px; }
.sp-pending { display: inline-block; font-weight: 500 !important; font-size: 12.5px !important; color: var(--muted) !important; border: 1px dashed var(--line-strong); border-radius: 999px; padding: 2px 10px; }
.sp-id-loading { height: 180px; margin: 12px 0; border-radius: 12px; background: linear-gradient(90deg, #eeebe4 0 30%, #f6f5f1 50%, #eeebe4 70%) 0 0 / 300% 100%; animation: sp-shimmer 1.2s linear infinite; }
@keyframes sp-shimmer { to { background-position: -300% 0; } }
@media (max-width: 560px) {
  .sp-id-row { grid-template-columns: 24px minmax(0, 1fr); row-gap: 2px; }
  .sp-id-row > div { grid-column: 2; }
  .sp-seal { width: 64px; height: 64px; }
}
.sp-about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sp-btn-ghost { flex: 1 1 200px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.sp-btn-ghost .pg-i { width: 22px; height: 22px; }
.sp-btn-ghost:hover { border-color: var(--blue-200); background: var(--paper); }

/* ---------- homepage #contact ---------- */
.ct-wrap { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ct-wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 22px; } }
.ct-info {
  position: relative; overflow: hidden; border-radius: 24px; padding: clamp(24px, 3.4vw, 36px); color: #fff; background: var(--ink);
  display: flex; flex-direction: column; gap: 18px; --i-fill: #fff; --i-fill-o: .14;
}
.ct-info::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: var(--red); opacity: .92; inset-inline-end: -90px; top: -90px; }
.ct-info::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px); background-size: 16px 16px; pointer-events: none; }
.ct-info > * { position: relative; z-index: 1; }
.ct-info .eyebrow { color: #FFB4AE; }
.ct-info h2 { margin: 0; color: #fff; font-size: clamp(24px, 3vw, 34px); line-height: 1.35; max-width: 16ch; }
.ct-info p { margin: 0; color: rgba(255, 255, 255, .78); line-height: 1.85; }
.ct-items { display: grid; gap: 10px; margin-top: auto; }
.ct-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font: inherit; text-align: start; cursor: pointer; width: 100%; box-sizing: border-box; }
.ct-item .pg-i { width: 26px; height: 26px; flex: none; --i-sun: #FF8A80; }
.ct-item strong { display: block; font-size: 14.5px; font-weight: 600; }
.ct-item span { display: block; font-size: 13px; color: rgba(255, 255, 255, .7); margin-top: 2px; }
.ct-item b { margin-inline-start: auto; color: #fff; opacity: .7; }
[dir="ltr"] .ct-item b { transform: scaleX(-1); }
.ct-item:hover { background: rgba(255, 255, 255, .12); }
.ct-item [dir="ltr"] { unicode-bidi: isolate; }
.ct-form { border-radius: 24px; background: #fff; border: 1px solid var(--line); padding: clamp(22px, 3.2vw, 34px); }
.ct-form h3 { margin: 0 0 4px; font-size: 20px; color: var(--ink); font-weight: 600; }
.ct-form > p { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.sp-page-done { display: flex; gap: 14px; align-items: flex-start; padding: 22px; border-radius: 18px; background: var(--green-tint); color: var(--ink); --i-fill: var(--green); }
.sp-page-done .pg-i { width: 34px; height: 34px; flex: none; color: var(--green-text); }
.sp-page-done strong { font-size: 17px; }
.sp-page-done p { margin: 4px 0 0; color: var(--text); line-height: 1.8; }

/* order page: report button above the support email */
.ac-report { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.ac-report .pg-i { width: 28px; height: 28px; flex: none; }
.ac-report strong { display: block; font-size: 15px; font-weight: 600; }
.ac-report small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.ac-report:hover { border-color: var(--blue-200); background: #fff; }
@media (max-width: 640px) { .ct-info::before { width: 170px; height: 170px; inset-inline-end: -70px; top: -70px; } }

/* ---------- Cloudflare Turnstile «تحقق سريع» panel (js/turnstile.js) — shown only when Cloudflare asks for a click ---------- */
.ts-panel { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); background: rgba(22, 26, 35, .32); }
.ts-panel[hidden] { display: none; }
.ts-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 30px 60px -24px rgba(20, 24, 33, .45); display: grid; gap: 14px; justify-items: center; animation: ts-up .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes ts-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ts-card { animation: none; } }
.ts-head { display: flex; gap: 10px; align-items: flex-start; width: 100%; }
.ts-dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(224, 69, 58, .14); }
.ts-head strong { display: block; font-size: 15.5px; color: var(--ink); }
.ts-head div span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.ts-widget { min-height: 65px; display: grid; place-items: center; }
.ts-cancel { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
