/* ==========================================================================
   Pages without a design of their own: contact, developers, privacy, errors.
   They use the About page's head and shell
   (portal/css/components/about-page.css) and the design's tokens; only what
   that file lacks is here (the search results' extras: portal.css).
   Logical properties keep RTL and LTR alike.
   ========================================================================== */

/* ---------- buttons ---------- */
.pg-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1.5px solid var(--color-blue-500);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.pg-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-btn--primary {
  background: var(--color-blue-500);
  color: var(--color-white);
  box-shadow: 0 14px 26px -16px rgba(59, 117, 150, .8);
}
.pg-btn--ghost {
  background: var(--color-white);
  color: var(--color-blue-500);
  border-color: var(--color-line);
}
.pg-btn:hover {
  background: var(--hover-cream);
  border-color: var(--hover-cream-border);
  color: var(--hover-cream-ink);
}
.pg-btn:active { transform: translateY(1px); }

/* ---------- brand panel (the About page's vision panel) ---------- */
.pg-panel {
  justify-content: flex-start;
  gap: 18px;
}
.pg-panel__mark {
  position: absolute;
  z-index: -1;
  inset-block-end: -60px;
  inset-inline-end: -50px;
  width: 280px;
  height: 280px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  opacity: .1;
  pointer-events: none;
}
.pg-panel__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--color-on-navy-muted, rgba(255, 255, 255, .78));
}
.pg-panel__socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.pg-panel__socials .ft__soc { color: var(--color-white); }
.pg-panel__socials .ft__soc:hover { background: rgba(255, 255, 255, .16); }

/* ---------- contact form ---------- */
.pg-form-card { justify-content: flex-start; gap: 22px; background: var(--color-white); }
.pg-form { display: grid; gap: 22px; }
.pg-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.pg-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pg-field--wide { grid-column: 1 / -1; }
.pg-field__label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
  color: var(--color-navy-700);
}
.pg-field__req { color: var(--color-gold-600); }
.pg-field__opt { font-weight: 600; font-size: 13px; color: var(--color-ink-500); }
.pg-field__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  background: var(--color-sky-50);
  font: inherit;
  font-size: 16px;
  color: var(--color-navy-700);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
/* a field written left to right keeps the page side's alignment */
.pg-field__input[dir="ltr"] { text-align: start; }
html[dir="rtl"] .pg-field__input[dir="ltr"] { text-align: right; }
.pg-field__input--area { min-height: 160px; resize: vertical; line-height: 1.8; }
.pg-field__input:hover { border-color: var(--color-blue-300); }
.pg-field__input:focus {
  outline: none;
  background: var(--color-white);
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 4px rgba(59, 117, 150, .14);
}
.pg-field__input[aria-invalid="true"] { border-color: var(--color-error); background: #fff7f7; }
.pg-field__err { margin: 0; font-size: 14px; font-weight: 700; color: var(--color-error); }
.pg-form__send { justify-self: start; min-width: 200px; }
/* the field only bots see */
.pg-trap { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.pg-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 12px;
  text-align: center;
  outline: none;
}
.pg-sent__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--color-blue-500), var(--color-navy-700));
  color: var(--color-white);
  box-shadow: 0 18px 34px -18px rgba(28, 68, 112, .8);
  animation: pg-pop .5s var(--ease-out-soft, ease-out) both;
}
.pg-sent__icon svg { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pg-sent__title { margin: 0; font-family: 'Almarai', 'Cairo', sans-serif; font-weight: 800; font-size: 26px; color: var(--color-navy-700); }
.pg-sent__text { margin: 0 0 8px; font-size: 17px; line-height: 1.9; color: var(--color-ink-600); max-width: 42ch; }
@keyframes pg-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- developers ---------- */
.pg-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pg-facts li {
  position: relative;
  padding-inline-start: 30px;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .86);
}
.pg-facts li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: .45em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-cream-400) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4470' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.pg-start { justify-content: flex-start; gap: 22px; background: var(--color-white); }
.pg-copyrow { display: grid; gap: 10px; }
.pg-copyrow__label { font-weight: 800; color: var(--color-navy-700); }
.pg-copyrow__hint { margin: 0; font-size: 14px; color: var(--color-ink-500); }

.pg-code {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: var(--color-navy-800, #14243b);
  color: #e8eef6;
  font-family: var(--font-mono, ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace);
  font-size: 14px;
}
.pg-code code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  font: inherit;
  padding: 6px 0;
}
.pg-copy {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pg-copy svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-copy:hover { background: rgba(255, 255, 255, .16); }
.pg-copy.is-copied { background: var(--color-success, #1F8A55); color: var(--color-white); }

.pg-dls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pg-dl {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--color-sky-50);
  border: 1px solid var(--color-line-soft);
  color: var(--color-navy-700);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.pg-dl:hover { border-color: var(--color-blue-300); transform: translateY(-2px); box-shadow: 0 16px 30px -22px rgba(28, 68, 112, .6); }
.pg-dl__icon {
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--color-blue-500); color: var(--color-white);
}
.pg-dl__icon svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-dl__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-dl__title { font-weight: 800; }
.pg-dl__sub { font-size: 14px; color: var(--color-ink-500); }
.pg-dl__ext {
  position: absolute; inset-block-start: 10px; inset-inline-end: 12px;
  font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700;
  color: var(--color-blue-500); opacity: .7;
}

.pg-section { background: var(--color-white); }
.pg-section__wrap {
  box-sizing: border-box;
  max-width: var(--cww, 1320px);
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.pg-section__title {
  margin: 0 0 28px;
  text-align: center;
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: var(--fs-section-title);
  line-height: 1.25;
  color: var(--color-navy-700);
}
.pg-section__title span { color: var(--color-blue-500); }

.pg-endpoints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pg-api {
  --pg-theme: var(--color-theme-verses);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--color-sky-50), var(--color-white) 60%);
  border: 1px solid var(--color-line-soft);
  box-shadow: inset 0 4px 0 var(--pg-theme);
  min-width: 0;
}
.pg-api--materials { --pg-theme: var(--color-blue-500); grid-column: 1 / -1; }
.pg-api--hadith { --pg-theme: var(--color-theme-hadith); }
.pg-api--benefits { --pg-theme: var(--color-theme-benefits); }
.pg-api--names { --pg-theme: var(--color-theme-names); }
.pg-api__head { display: flex; align-items: flex-start; gap: 14px; }
.pg-api__icon {
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--pg-theme); color: var(--color-white);
}
.pg-api__icon svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-api__title { margin: 0; font-family: 'Almarai', 'Cairo', sans-serif; font-weight: 800; font-size: 22px; color: var(--color-navy-700); }
.pg-api__text { margin: 4px 0 0; font-size: 15px; line-height: 1.7; color: var(--color-ink-600); }
.pg-ep { display: grid; gap: 10px; }
.pg-ep__method {
  flex: none;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--pg-theme);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.pg-ep__q { color: #9fb6cf; }
.pg-ep__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pg-ep__one { margin: 0; font-size: 14px; color: var(--color-ink-500); }
.pg-params { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pg-param {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: var(--color-white);
  border: 1px solid var(--color-line-soft);
  font-size: 13px;
  color: var(--color-ink-600);
}
.pg-param code {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--color-sky-50);
  color: var(--pg-theme);
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}
.pg-try {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--pg-theme);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  background: var(--color-white);
  border: 1px solid var(--color-line-soft);
  transition: background .2s ease;
}
.pg-try:hover { background: var(--hover-cream); }
.pg-try svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- privacy: contents column + text ---------- */
.ab-inner.pg-doc { grid-template-columns: minmax(0, 4fr) minmax(0, 10fr); align-items: start; }
.pg-toc {
  position: sticky;
  top: calc(var(--hdr-h, 64px) + 24px);
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(155deg, var(--color-blue-500) 0%, var(--color-blue-700) 45%, var(--color-navy-700) 100%);
  color: var(--color-white);
}
.pg-toc__title { margin: 0 0 14px; font-family: 'Almarai', 'Cairo', sans-serif; font-weight: 800; font-size: 18px; color: var(--color-cream-400); }
.pg-toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pg-toc__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease;
}
.pg-toc__link:hover { background: rgba(255, 255, 255, .1); }
.pg-toc__n {
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); font-size: 13px;
}
.pg-legal { justify-content: flex-start; gap: 18px; background: var(--color-white); }
.pg-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--color-cream-200);
  border: 1px solid var(--color-line-gold-soft, var(--color-line));
  color: var(--color-navy-700);
  font-weight: 700;
}
.pg-note svg { flex: none; fill: none; stroke: var(--color-gold-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-legal__body { display: grid; gap: 8px; text-align: start; }
.pg-legal__part { scroll-margin-top: calc(var(--hdr-h, 64px) + 24px); padding-block: 12px; border-block-end: 1px solid var(--color-line-soft); }
.pg-legal__part:last-child { border-block-end: 0; }
.pg-legal__h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--color-navy-700);
}
.pg-legal__n { font-size: 14px; color: var(--color-blue-500); padding: 4px 10px; border-radius: 999px; background: var(--color-sky-50); }
.pg-legal__body p { margin: 0 0 10px; font-size: 17px; line-height: 1.9; color: var(--color-ink-700); }

/* ---------- error pages ---------- */
.pg-error { min-height: calc(100vh - 360px); }
.pg-error--alone { min-height: 100vh; margin-top: 0; padding-top: 0; display: flex; align-items: center; }
.pg-error__head { position: relative; overflow-x: clip; width: 100%; }
.pg-error__inner {
  position: relative;
  box-sizing: border-box;
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--page-head-space) + 8px) 24px calc(var(--page-head-space) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.pg-error__logo { width: 190px; height: auto; margin-bottom: 8px; }
.pg-error__code {
  margin: 0;
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: clamp(96px, 18vw, 180px);
  line-height: .9;
  letter-spacing: -.02em;
  background: linear-gradient(160deg, var(--color-blue-300) 0%, var(--color-blue-500) 45%, var(--color-navy-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 18px 30px rgba(28, 68, 112, .18));
}
.pg-error__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
  margin-top: 8px;
  padding: 6px 6px 6px 18px;
  padding-inline-start: 18px;
  padding-inline-end: 6px;
  border-radius: 999px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  box-shadow: 0 18px 36px -28px rgba(28, 68, 112, .6);
  box-sizing: border-box;
}
.pg-error__search svg { flex: none; fill: none; stroke: var(--color-blue-500); stroke-width: 2; stroke-linecap: round; }
.pg-error__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--color-navy-700);
}
.pg-error__search .pg-btn { min-height: 44px; padding: 0 22px; }
.pg-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .pg-endpoints { grid-template-columns: minmax(0, 1fr); }
  .ab-inner.pg-doc { grid-template-columns: minmax(0, 1fr); }
  .pg-toc { position: static; }
}
@media (max-width: 640px) {
  .pg-form__row, .pg-dls { grid-template-columns: minmax(0, 1fr); }
  .pg-form__send { justify-self: stretch; }
  .pg-api { padding: 18px; }
  .pg-ep__foot { flex-direction: column; }
  .pg-error__search { flex-wrap: wrap; border-radius: 24px; padding: 10px; }
  .pg-error__search .pg-btn { width: 100%; }
  .pg-error__actions .pg-btn { flex: 1 1 100%; }
}
