/* منظومة لبدة — صفحة الاستعلام (card.lsat.ly/)
   تصميم 2026: ملف واحد يحل محل style.css و card-readability-v2.css و card-modern.css
   و card-frequencies.css و card-technicians.css. مصمم للهاتف أولاً. بدون JavaScript (سياسة CSP). */

@font-face { font-family: "IBM Plex Sans Arabic"; src: url("assets/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("assets/fonts/IBMPlexSansArabic-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("assets/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --brand: #64239c;
  --brand-2: #8b39c5;
  --brand-soft: #f4ecfb;
  --gold: #a8802f;
  --gold-soft: #fbf5e6;
  --ink: #1d1626;
  --ink-2: #4a3f55;
  --muted: #776b84;
  --line: #e9e2ef;
  --bg: #f7f5fa;
  --card: #ffffff;
  --ok: #157347;
  --ok-soft: #e8f6ee;
  --bad: #b42323;
  --bad-soft: #fdecec;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 22, 38, .04), 0 6px 20px rgba(100, 35, 156, .06);
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
button, input, select { font: inherit; }
a, button, summary, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
.ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

/* ---------- الهيكل ---------- */
.site-shell { width: min(720px, 100%); margin: 0 auto; padding: 0 var(--gutter) 32px; }

.topbar { padding: 20px 0 8px; }
.identity { display: flex; align-items: center; gap: 12px; }
.logo-frame {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.logo-frame img { width: 44px; height: auto; }
.identity strong { display: block; font-size: 21px; font-weight: 700; }
.identity span { display: block; font-size: 15px; color: var(--gold); font-weight: 500; }

/* شريط الأقسام: ثابت أعلى الشاشة وقابل للسحب أفقياً */
.quicknav {
  position: sticky; top: 0; z-index: 10;
  margin: 8px calc(-1 * var(--gutter)) 16px;
  padding: 10px var(--gutter);
  background: rgba(247, 245, 250, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.quicknav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.quicknav ul::-webkit-scrollbar { display: none; }
.quicknav li { flex: 0 0 auto; scroll-snap-align: start; }
.quicknav a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2);
  font-size: 15px; font-weight: 500; white-space: nowrap;
}
.quicknav a:active { background: var(--brand-soft); }

/* كل الأقسام بطاقات متشابهة */
.public-directory, .band {
  margin: 0 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- الأقسام القابلة للفتح (الأبراج، الموزعون، الفنيون) ---------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.public-directory > details > summary.secure-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 14px 18px;
  font-size: 18px; font-weight: 700; color: var(--ink);
}
.public-directory > details[open] > summary.secure-pill { border-bottom: 1px solid var(--line); color: var(--brand); }
.public-directory > details > p { margin: 14px 18px 4px; color: var(--muted); font-size: 15px; }

/* ---------- الاستعلام ---------- */
#subscriber-service { border-top: 4px solid var(--brand); }
#subscriber-service > .service-disclosure[open] > summary.secure-pill { display: none; } /* العنوان الكبير يغني عنه */
.portal, .portal-inner { display: block; margin: 0; padding: 0; }

.hero-panel { padding: 22px 18px 4px; }
.hero-panel .eyebrow { display: none; }
.hero-panel h1 { font-size: 24px; font-weight: 700; }
.hero-panel h1 span { color: var(--brand); }
.hero-copy { margin: 6px 0 0; color: var(--muted); font-size: 16px; }

.query-panel { padding: 8px 18px 18px; }
.query-panel .panel-heading { display: none; } /* تكرار لنفس المعلومة */

form { display: grid; gap: 14px; margin-top: 14px; }
form label { display: block; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.label-row b { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.label-row small { font-size: 13px; color: var(--muted); }

.field { position: relative; display: block; }
.field input {
  display: block; width: 100%;
  min-height: 56px; padding: 12px 48px 12px 14px;
  border: 1.5px solid #d9cfe2; border-radius: var(--radius-sm);
  background: #fdfcfe; color: var(--ink);
  font-size: 19px; font-weight: 500; letter-spacing: .5px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #a99bb6; font-weight: 400; letter-spacing: 0; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(139, 57, 197, .14); background: #fff; }
.field svg { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--brand-2); width: 22px; height: 22px; pointer-events: none; }

/* حقل المصيدة يبقى مخفياً دائماً */
.trap { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; opacity: 0 !important; pointer-events: none !important; }

form button[type="submit"] {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; margin-top: 4px; padding: 12px 18px;
  border: 0; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 19px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(100, 35, 156, .25);
  transition: transform .15s, box-shadow .15s;
}
form button[type="submit"]:active { transform: scale(.98); box-shadow: 0 3px 8px rgba(100, 35, 156, .25); }
form button[type="submit"] svg { transform: scaleX(-1); width: 20px; height: 20px; }

/* رسالة الخطأ */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft); color: var(--bad); border: 1px solid #f2c9c9;
  font-size: 15px;
}
.notice > span {
  display: grid; place-items: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bad); color: #fff; font-weight: 700; font-size: 15px; line-height: 1;
}
.notice p { margin: 0; }

/* نتيجة الاستعلام */
.query-panel .result { margin-top: 16px; border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--line); }
.query-panel .result .status-line { display: flex; align-items: center; gap: 12px; padding: 16px; }
.query-panel .result .status-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; color: #fff; }
.query-panel .result .status-icon svg { width: 26px; height: 26px; }
.query-panel .result .status-label { margin: 0; font-size: 13px; opacity: .8; }
.query-panel .result h3 { font-size: 22px; font-weight: 700; }
.query-panel .result.success { border-color: #b9e2c9; }
.query-panel .result.success .status-line { background: var(--ok-soft); color: var(--ok); }
.query-panel .result.success .status-icon { background: var(--ok); }
.query-panel .result.expired { border-color: #f2c9c9; }
.query-panel .result.expired .status-line { background: var(--bad-soft); color: var(--bad); }
.query-panel .result.expired .status-icon { background: var(--bad); }

.query-panel .result dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.query-panel .result dl > div { padding: 12px 16px; border-top: 1px solid var(--line); }
.query-panel .result dl > div:not(.wide) + div:not(.wide) { border-inline-start: 1px solid var(--line); }
.query-panel .result dl > .wide { grid-column: 1 / -1; }
.query-panel .result dt { font-size: 13px; color: var(--muted); }
.query-panel .result dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.query-panel .result dd.ltr { text-align: right; }

/* التجديد مباشرة من نتيجة الاستعلام: كل باقة تنقل لاختيار طريقة الدفع */
.query-panel .result .renew { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: #fcfaff; }
.renew-title { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--brand); }
.renew-packs { display: grid; gap: 8px; }
.renew-packs .renew-pack {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 60px; margin: 0; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  font-size: 16px; color: var(--ink); text-align: right; text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.renew-packs .renew-pack:hover { border-color: var(--brand-2); background: #fdfaff; }
.renew-packs .renew-pack:active { transform: scale(.98); }
.renew-pack > span { flex: 1; min-width: 0; }
.renew-pack b { display: block; font-size: 17px; font-weight: 700; }
.renew-pack small { display: block; font-size: 13px; color: var(--muted); }
.renew-pack small bdi { white-space: nowrap; }
.renew-pack strong { font-size: 17px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.renew-pack::after {
  content: "←"; display: grid; place-items: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
}
.renew-packs .renew-pack { gap: 10px; padding: 10px 12px; }
.logout-form { display: block; margin: 12px 0 0; }
.logout-form button.logout-button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin: 0;
  padding: 8px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-2); box-shadow: none; font-size: 15px; font-weight: 500;
}
.logout-form button.logout-button:hover { border-color: #d9cfe2; background: #faf8fc; }
.logout-form button.logout-button:active { transform: scale(.98); box-shadow: none; }
.renew-note {margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.trust-row > div { display: inline-flex; align-items: center; gap: 5px; }
.trust-row svg { width: 16px; height: 16px; color: var(--gold); }

/* ---------- الباقات ---------- */
.band { padding: 18px; }
.sec-head h2 { font-size: 20px; font-weight: 700; }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.pk-radio { display: none; }
.pk-grid { display: grid; gap: 10px; margin-top: 14px; }
.pk-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.pk-card header small { display: block; font-size: 13px; color: var(--muted); }
.pk-card header b { display: block; font-size: 18px; font-weight: 700; }
.pk-card dl { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: left; }
.pk-card dl > div { display: block; }
.pk-card dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pk-card dd { margin: 0; }
.pk-card .price { font-size: 20px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.pk-card .chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.pk-card.new { background: var(--gold-soft); border-color: #ecdcb3; }
.pk-card.new .price { color: var(--gold); font-size: 15px; }
.pk-card.new .chip { background: #f3e6c3; color: #7a5a17; }
.pk-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* الباقة رابط: الضغط عليها يفتح الدفع الإلكتروني */
a.pk-card { color: var(--ink); min-height: 68px; transition: border-color .15s, background .15s, transform .15s; }
a.pk-card header { flex: 1; min-width: 0; }
a.pk-card::after {
  content: "←"; display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 17px; font-weight: 700;
}
a.pk-card.new::after { background: var(--gold); }
a.pk-card:hover { border-color: var(--brand-2); background: #fdfaff; }
a.pk-card.new:hover { border-color: #d9bf7c; background: #fbf2dc; }
a.pk-card:active { transform: scale(.98); }

/* ---------- الخدمات ---------- */
.svc-grid { display: grid; gap: 10px; margin-top: 14px; }
.svc-card {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; column-gap: 12px;
  padding: 14px; min-height: 76px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  transition: background .15s, transform .15s;
}
.svc-card:active { transform: scale(.99); background: #faf8fc; }
.svc-card .ic { grid-row: 1 / 3; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.svc-card h3 { font-size: 17px; font-weight: 700; grid-column: 2; }
.svc-card p { grid-column: 2; margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.svc-card .more { grid-column: 3; grid-row: 1 / 3; font-size: 14px; font-weight: 700; color: var(--brand); white-space: nowrap; }
#electronic-renewal { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; }
#electronic-renewal .ic { background: rgba(255, 255, 255, .18); color: #fff; }
#electronic-renewal p { color: rgba(255, 255, 255, .85); }
#electronic-renewal .more { color: #fff; }
.svc-card.gold .ic { background: var(--gold-soft); color: var(--gold); }
.svc-card.gold .more { color: var(--gold); }
.svc-card.dark .ic { background: #e8f8ef; color: #1f8f4e; }
.svc-card.dark .more { color: #1f8f4e; }

/* ---------- الأبراج والترددات ---------- */
.freq-intro { padding: 14px 18px 4px; }
.freq-hint { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.freq-common { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.freq-common > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid #efe2bf; }
.freq-common span { display: block; font-size: 13px; color: var(--muted); }
.freq-common b { display: block; font-size: 17px; }
.freq-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

#frequencies details.result { margin: 8px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
#frequencies details.result:last-child { margin-bottom: 18px; }
#frequencies details.result > summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 10px 14px; font-size: 17px; font-weight: 700; color: var(--ink-2);
}
#frequencies details.result > summary::after { content: "+"; font-size: 22px; color: var(--brand); font-weight: 400; }
#frequencies details.result[open] > summary { background: var(--brand-soft); color: var(--brand); }
#frequencies details.result[open] > summary::after { content: "−"; }
#frequencies details.result dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 12px; }
#frequencies details.result dl > div { padding: 8px 10px; border-radius: 10px; background: #faf8fc; text-align: center; }
#frequencies details.result dt { font-size: 13px; color: var(--muted); }
#frequencies details.result dd { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }

/* ---------- الموزعون والفنيون ---------- */
.dealer-grid { display: grid; gap: 8px; padding: 10px 18px 18px; }
.dealer-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.dealer-card h3 { font-size: 16px; font-weight: 700; grid-column: 1; }
.dealer-card p { grid-column: 1; margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.dealer-phone, .dealer-card .missing-phone { grid-column: 2; grid-row: 1 / span 3; }
.dealer-phone {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 12px; border-radius: 999px;
  background: #e8f6ee; color: var(--ok); font-weight: 700; font-size: 15px; white-space: nowrap;
}
.dealer-phone::before { content: "☎"; font-size: 15px; }
.dealer-card .missing-phone { font-size: 12px; color: #a99bb6; text-align: center; max-width: 90px; }

/* ---------- التذييل ---------- */
.page-footer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 20px 0 8px; color: var(--muted); font-size: 13px; text-align: center; }
.brand-mark { font-weight: 700; color: var(--ink-2); font-size: 14px; }

/* ---------- الإضافة للشاشة الرئيسية (آيفون) ---------- */
.install-hint {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  margin: 8px 0 4px; padding: 12px 40px 12px 12px;
  border: 1px solid #e3d3f1; border-radius: var(--radius);
  background: linear-gradient(135deg, #fbf7ff, #f4ecfb); box-shadow: var(--shadow);
}
.install-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.install-text { flex: 1; min-width: 0; }
.install-text b { display: block; font-size: 16px; font-weight: 700; color: var(--brand); }
.install-text p { margin: 2px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.install-text strong { font-weight: 700; color: var(--ink); }
.install-share { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; color: #0a84ff; }
form.install-close { position: absolute; top: 6px; left: 6px; display: block; margin: 0; }
form.install-close button {
  display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; box-shadow: none;
  color: var(--muted); font-size: 22px; font-weight: 400; line-height: 1;
}
form.install-close button:hover { background: rgba(100, 35, 156, .08); }
/* عند الفتح من أيقونة الشاشة الرئيسية: لا داعي للاقتراح، ومراعاة حواف الآيفون */
@media (display-mode: standalone) {
  .install-hint { display: none; }
  .site-shell { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* ---------- شاشات أكبر ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .hero-panel { padding: 28px 28px 4px; }
  .hero-panel h1 { font-size: 30px; }
  .query-panel { padding: 8px 28px 24px; }
  .band { padding: 24px; }
  .pk-grid, .svc-grid { grid-template-columns: 1fr 1fr; }
  .svc-card#electronic-renewal { grid-column: 1 / -1; }
  .dealer-grid { grid-template-columns: 1fr 1fr; }
  #frequencies details.result dl { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
