/* منظومة لبدة — صفحة الدفع الإلكتروني (card.lsat.ly/electronic-payments.php)
   تصميم 2026: نسخة جديدة كاملة من lebda-payments-card.css بنفس أسماء العناصر (ep-*).
   لا يلزم تعديل أي كود PHP. مصمم للهاتف أولاً. */

@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;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 22, 38, .04), 0 6px 20px rgba(100, 35, 156, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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);
}
a { color: var(--brand); text-decoration: none; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
button, input, select { font: inherit; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; }
p { line-height: 1.7; }

/* ---------- الهيكل ---------- */
.ep-shell { width: min(600px, 100%); margin: 0 auto; padding: 0 16px 32px; }

/* الشريط العلوي: الشعار يمين، الرجوع يسار */
.ep-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; }
.ep-brand { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding-right: 64px; position: relative; font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ep-brand::before {
  content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 15px;
  background: #fff url("libda-logo-transparent.png") center / 40px no-repeat;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ep-brand small { display: block; font-size: 14px; font-weight: 500; color: var(--gold); margin-top: 2px; }
.ep-nav > a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}

/* العنوان */
.ep-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; margin-bottom: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff;
  box-shadow: 0 8px 22px rgba(100, 35, 156, .22);
}
.ep-hero > div:first-child { flex: 1; min-width: 0; }
.ep-hero h1 { margin: 0; font-size: 23px; font-weight: 700; }
.ep-hero p { margin: 4px 0 0; font-size: 15px; color: rgba(255, 255, 255, .86); }
.ep-tag { display: none; }
.ep-hero-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: rgba(255, 255, 255, .16); flex-shrink: 0; }
.ep-hero-icon svg { width: 28px; height: 28px; }

/* تنبيه */
.ep-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin: 0 0 14px;
  background: var(--gold-soft); border: 1px solid #ecdcb3; border-radius: var(--radius-sm); color: #6d5317;
}
.ep-notice > svg { width: 20px; height: 20px; margin-top: 3px; }
.ep-notice strong, .ep-notice span { display: block; }
.ep-notice strong { font-size: 16px; }
.ep-notice span { font-size: 14px; }

/* مؤشر الخطوات */
.ep-steps { list-style: none; display: flex; padding: 0; margin: 4px 0 14px; counter-reset: s; position: relative; }
.ep-steps li {
  flex: 1 1 0; position: relative; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 2px;
}
.ep-steps li::before { /* الخط الواصل بين الخطوات */
  content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
[dir="ltr"] .ep-steps li::before { left: auto; right: 50%; }
.ep-steps li:first-child::before { display: none; }
.ep-steps b {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto 4px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line); color: var(--muted);
  font-size: 15px; font-weight: 700;
}
.ep-steps .active { color: var(--brand); font-weight: 700; }
.ep-steps .active b { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(139, 57, 197, .15); }
.ep-steps .done b, .ep-steps .complete b { background: var(--ok); border-color: var(--ok); color: #fff; }

/* اللوحات */
.ep-columns { display: flex; flex-direction: column; gap: 14px; }
.ep-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.ep-columns > .ep-panel { margin: 0; }
.ep-columns > .ep-panel:first-child, .ep-shell > .ep-panel { border-top: 4px solid var(--brand); }
h2 { font-size: 21px; font-weight: 700; margin: 0 0 8px; }
.ep-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--gold); background: var(--gold-soft); padding: 2px 10px; border-radius: 999px; }
.ep-panel > .ep-eyebrow + h2 { margin: 10px 0 4px; }
.ep-panel > .ep-eyebrow + h2 + p { margin: 0 0 14px; font-size: 15px; color: var(--muted); }

/* الحقول */
form { display: grid; gap: 14px; margin-top: 12px; }
label { display: block; font-size: 16px; font-weight: 700; color: var(--ink-2); }
input, select {
  display: block; width: 100%; min-height: 56px; margin-top: 6px;
  padding: 12px 14px; border: 1.5px solid #d9cfe2; border-radius: var(--radius-sm);
  background: #fdfcfe; color: var(--ink); font-size: 19px; font-weight: 500;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a99bb6; font-weight: 400; font-size: 16px; }
input:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(139, 57, 197, .14); background: #fff; }
input[type="hidden"] { display: none; }
select { appearance: none; -webkit-appearance: none; padding-left: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%);
  background-position: 18px 50%, 24px 50%; background-size: 6px 6px; background-repeat: no-repeat; }
/* رمز التأكيد OTP: أرقام كبيرة متباعدة */
input[name*="otp"], input[name*="code"], input[autocomplete="one-time-code"] { text-align: center; font-size: 26px; letter-spacing: 8px; direction: ltr; }

/* الأزرار: الزر الأساسي ممتلئ وواضح */
button, .ep-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 58px; 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; line-height: 1.4; text-align: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(100, 35, 156, .25);
  transition: transform .15s, box-shadow .15s, background .15s;
}
button:not(:disabled):active, .ep-button:active { transform: scale(.98); }
button:disabled { background: #efebf3; color: #9a90a4; box-shadow: none; cursor: not-allowed; }
.ep-panel form > button { margin-top: 6px; }

/* زر "عملية دفع جديدة" */
a[href="?new=1"], a[href="/electronic-payments.php?new=1"] {
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; margin: 14px 0; padding: 12px 18px;
  border: 1.5px solid var(--brand-2); border-radius: var(--radius-sm); background: #fff;
  color: var(--brand) !important; font-size: 18px !important; font-weight: 700; text-decoration: none !important;
}
a[href="?new=1"]::before, a[href="/electronic-payments.php?new=1"]::before { content: "+"; font-size: 24px; line-height: 1; }

.ep-hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* اختيار الباقة: صفوف كبيرة سهلة اللمس */
.ep-packs { display: grid; gap: 10px; margin: 12px 0 4px; }
.ep-pack {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 72px; padding: 12px 16px !important; text-align: right !important;
  background: #fff !important; color: var(--ink) !important;
  border: 1.5px solid var(--line) !important; border-radius: var(--radius-sm); box-shadow: none !important;
}
.ep-pack:hover, .ep-pack:focus-visible { border-color: var(--brand-2) !important; background: #fdfaff !important; }
.ep-pack span { display: block; }
.ep-pack b { display: block; font-size: 18px; color: var(--ink); line-height: 1.4; }
.ep-pack span small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.ep-pack strong { white-space: nowrap; color: var(--brand); font-size: 22px; font-weight: 700; }
.ep-pack strong small { font-size: 14px; font-weight: 500; }

/* ملخص الطلب */
.ep-summary h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ep-summary dl { margin: 0 0 14px; }
.ep-summary dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.ep-summary dl > div:last-child { border-bottom: 0; }
.ep-summary dt { color: var(--muted); flex-shrink: 0; }
.ep-summary dd { margin: 0; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.ep-summary .ep-total { margin-top: 8px; padding: 14px; border: 0 !important; border-radius: var(--radius-sm); background: var(--brand-soft); }
.ep-summary .ep-total dt { color: var(--brand); font-weight: 700; }
.ep-summary .ep-total dd { color: var(--brand); font-size: 22px; }

/* حالات فارغة ورسائل */
.ep-empty { text-align: center; padding: 18px 8px; color: var(--muted); }
.ep-empty svg { width: 34px; height: 34px; color: var(--brand-2); }
.ep-empty p { font-size: 16px; margin: 8px 0; }
.ep-empty.compact { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 0 16px; }
.ep-empty.compact p { margin: 0; font-size: 15px; }
.ep-empty h2 { color: var(--ink); }
.ep-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border: 1px solid #f2c9c9; background: var(--bad-soft); border-radius: var(--radius-sm); color: var(--bad); font-size: 15px; }
.ep-error::before { content: "!"; display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 700; font-size: 14px; line-height: 1; margin-top: 2px; }
.ep-lock { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.ep-lock svg { width: 16px; height: 16px; color: var(--gold); }

/* المساعدة وحالة العمليات */
.ep-help { margin: 14px 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.ep-help > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 16px; font-size: 17px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.ep-help > summary::-webkit-details-marker { display: none; }
.ep-help > summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--brand); }
.ep-help[open] > summary { color: var(--brand); border-bottom: 1px solid var(--line); }
.ep-help[open] > summary::after { content: "−"; }
.ep-status-grid { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; }
.ep-status-grid > div { padding: 10px 12px; border-radius: var(--radius-sm); background: #faf8fc; }
.ep-status-grid b, .ep-status-grid span { display: block; }
.ep-status-grid b { font-size: 15px; color: var(--ink-2); }
.ep-status-grid span { font-size: 14px; color: var(--muted); }

footer { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }
footer small { font-size: 12px; }

@media (min-width: 560px) {
  .ep-shell { padding: 0 24px 40px; }
  .ep-hero { padding: 22px 24px; }
  .ep-hero h1 { font-size: 27px; }
  .ep-panel { padding: 24px; }
  .ep-status-grid { grid-template-columns: 1fr 1fr; }
}

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