/* محلولة: تصميم المنتجات الجاهزة (صفحات A4 تُعرض في المعاينة وتُطبع PDF).
   القياسات بالبكسل على أساس 96 نقطة للبوصة: A4 = 794 × 1123. */

.tp-doc { counter-reset: pg; }
.tp-page {
  --p: #0F5C4A; --a: #C59B3C; --s: #EAF3EF; --d: #0A3D31;
  width: 794px; height: 1123px; position: relative; overflow: hidden;
  background: #fff; color: #1F2633; direction: rtl; text-align: right;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 14px; line-height: 1.75;
  display: flex; flex-direction: column; padding: 34px 44px 26px;
  counter-increment: pg; box-sizing: border-box;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.tp-page.land { width: 1123px; height: 794px; }
.tp-page *, .tp-page *::before, .tp-page *::after { box-sizing: border-box; }
.tp-page h1, .tp-page h2, .tp-page h3, .tp-page h4 { font-family: "El Messiri", "IBM Plex Sans Arabic", sans-serif; margin: 0; line-height: 1.35; color: var(--d); }
.tp-page p { margin: 0; }
.tp-page img.moe { display: block; max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.tp-pat { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* الترويسة */
.tp-hd { display: grid; grid-template-columns: 1fr 176px 1fr; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--p); position: relative; }
.tp-hd::after { content: ""; position: absolute; bottom: -2px; right: 0; width: 120px; height: 2px; background: var(--a); }
.tp-hd-r { font-size: 12.5px; line-height: 1.6; color: #3B4456; }
.tp-hd-r b { display: block; font-size: 13.5px; color: var(--d); }
.tp-hd-c { display: grid; place-items: center; height: 76px; }
.tp-hd-c img { max-width: 168px; max-height: 76px; object-fit: contain; }
.tp-hd-c svg { width: 62px; height: 62px; }
.tp-hd-l { text-align: left; font-size: 12.5px; line-height: 1.6; color: #3B4456; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tp-hd-l .sl { width: 62px; height: 62px; flex: none; display: grid; place-items: center; }
.tp-hd-l .sl img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tp-hd-l b { display: block; font-size: 15px; color: var(--p); font-weight: 700; }
.tp-hd-l .tag { display: inline-block; background: var(--s); color: var(--d); border-radius: 20px; padding: 0 10px; font-weight: 600; margin-top: 2px; }

/* المتن والتذييل */
.tp-body { flex: 1; min-height: 0; padding-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.tp-ft { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #6B7487; border-top: 1px solid #DDE2EA; padding-top: 8px; margin-top: 10px; }
.tp-ft .tp-pn { background: var(--p); color: #fff; border-radius: 4px; min-width: 26px; text-align: center; font-weight: 700; padding: 0 6px; }
.tp-ft .tp-pn::after { content: counter(pg); }

/* العناوين */
.tp-title { text-align: center; }
.tp-title h2 { font-size: 26px; }
.tp-title p { color: #5A6376; font-size: 13.5px; }
.tp-h { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.tp-h span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--p); color: #fff; font-size: 14px; font-family: "IBM Plex Sans Arabic", sans-serif; flex: none; }
.tp-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, var(--a), transparent); }
.tp-lead { color: #3B4456; font-size: 14px; }

/* صناديق */
.tp-box { background: var(--s); border-radius: 12px; padding: 14px 18px; position: relative; }
.tp-box h4 { font-size: 15.5px; margin-bottom: 4px; color: var(--p); }
.tp-box.tp-ln { background: #fff; border: 1.5px solid var(--s); border-right: 5px solid var(--p); }
.tp-box.tp-acc { border-right-color: var(--a); }
.tp-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tp-g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tp-ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.tp-ul li { padding-right: 18px; position: relative; }
.tp-ul li::before { content: ""; position: absolute; right: 2px; top: .72em; width: 7px; height: 7px; border-radius: 2px; background: var(--a); transform: rotate(45deg); }
.tp-ol { margin: 0; padding: 0; list-style: none; counter-reset: li; display: grid; gap: 6px; }
.tp-ol li { counter-increment: li; padding-right: 32px; position: relative; }
.tp-ol li::before { content: counter(li); position: absolute; right: 0; top: 2px; width: 23px; height: 23px; border-radius: 50%; background: var(--p); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.tp-chip { display: inline-block; background: #fff; border: 1px solid var(--p); color: var(--p); border-radius: 20px; padding: 0 10px; font-size: 12.5px; font-weight: 600; margin: 2px; }

/* الجداول */
.tp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; line-height: 1.55; }
.tp-table th { background: var(--p); color: #fff; font-weight: 600; padding: 8px 10px; text-align: right; }
.tp-table th:first-child { border-radius: 0 8px 0 0; }
.tp-table th:last-child { border-radius: 8px 0 0 0; }
.tp-table td { padding: 7px 10px; border-bottom: 1px solid #E3E7EE; vertical-align: top; }
.tp-table tr:nth-child(even) td { background: #FAFBFC; }
.tp-table td.m { font-weight: 700; color: var(--d); background: var(--s) !important; white-space: nowrap; }
.tp-table td.c, .tp-table th.c { text-align: center; }
.tp-table.grid td { border: 1px solid #E3E7EE; border-top: 0; border-left: 0; height: 34px; }
.tp-table.grid td:first-child { border-right: 1px solid #E3E7EE; }
.tp-table.tall td { height: 44px; }
.tp-table.compact td { height: auto; padding: 4px 9px; font-size: 12.5px; }

/* حقول النماذج */
.tp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.tp-f { display: flex; align-items: end; gap: 8px; font-size: 13.5px; }
.tp-f b { white-space: nowrap; color: var(--d); font-weight: 600; }
.tp-f span { flex: 1; border-bottom: 1.5px dotted #9AA3B5; min-height: 24px; padding: 0 4px; }
.tp-f.full { grid-column: 1 / -1; }
.tp-lines { display: grid; gap: 0; }
.tp-lines i { display: block; height: 30px; border-bottom: 1.5px dotted #9AA3B5; }
.tp-check { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
.tp-check span::before { content: ""; display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--p); border-radius: 3px; margin-left: 6px; vertical-align: -2px; }

/* التوقيعات */
.tp-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 24px; margin-top: auto; padding-top: 10px; text-align: center; font-size: 13.5px; }
.tp-sign div { display: grid; gap: 4px; }
.tp-sign small { color: #6B7487; }
.tp-sign b { color: var(--d); }
.tp-sign i { display: block; border-bottom: 1.5px dotted #9AA3B5; height: 30px; margin: 0 18px; font-style: normal; }

/* الغلاف */
.tp-page.cover { padding: 0; }
.cv-band { position: absolute; top: 0; bottom: 0; left: 0; width: 300px; background: var(--p); overflow: hidden; }
.cv-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.25)); }
.cv-ring { position: absolute; border-radius: 50%; border: 2px solid var(--a); opacity: .55; }
.cv-in { position: relative; height: 100%; display: flex; flex-direction: column; padding: 46px 52px 44px; }
.cv-top { display: flex; justify-content: space-between; align-items: start; }
.cv-off { color: #fff; font-size: 13px; line-height: 1.75; width: 210px; position: relative; }
.cv-off b { font-size: 15px; display: block; }
.cv-logos { display: flex; gap: 10px; position: relative; }
.cv-logo { width: 196px; height: 112px; padding: 14px 18px; border-radius: 22px; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); position: relative; }
.cv-logo img { max-width: 100%; max-height: 84px; object-fit: contain; }
.cv-logo.sch { width: 112px; padding: 12px; }
.cv-logo svg { width: 70px; height: 70px; }
.cv-mid { margin: auto 0; padding-left: 250px; position: relative; }
.cv-mid .k { display: inline-block; background: var(--a); color: #fff; font-weight: 700; padding: 3px 16px; border-radius: 30px; font-size: 15px; }
.cv-mid h1 { font-size: 60px; line-height: 1.2; color: var(--d); margin: 18px 0 10px; font-weight: 700; }
.cv-mid p { font-size: 18px; color: #4A5368; max-width: 420px; }
.cv-ico { position: absolute; left: 52px; top: 50%; transform: translateY(-50%); width: 196px; height: 196px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; border: 2px solid rgba(255,255,255,.35); }
.cv-ico svg { width: 104px; height: 104px; stroke: #fff; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cv-school { padding-left: 250px; position: relative; margin-bottom: 18px; }
.cv-school small { color: var(--a); font-weight: 700; font-size: 14px; }
.cv-school b { display: block; font-family: "El Messiri", sans-serif; font-size: 27px; color: var(--d); line-height: 1.4; }
.cv-info { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-left: 250px; position: relative; }
.cv-info div { border-top: 3px solid var(--p); padding-top: 8px; }
.cv-info div + div { border-color: var(--a); }
.cv-info small { display: block; color: #6B7487; font-size: 12.5px; }
.cv-info b { font-size: 15px; color: var(--d); }
.land .cv-band { width: 340px; }
.land .cv-mid, .land .cv-school, .land .cv-info { padding-left: 300px; }

/* الملصقات والشهادات */
.tp-frame { position: absolute; inset: 22px; border: 2px solid var(--p); border-radius: 6px; pointer-events: none; }
.tp-frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--a); border-radius: 3px; }
.tp-corner { position: absolute; width: 120px; height: 120px; pointer-events: none; }
.tp-corner svg { width: 100%; height: 100%; }
.tp-corner.tr { top: 0; right: 0; }
.tp-corner.tl { top: 0; left: 0; transform: scaleX(-1); }
.tp-corner.br { bottom: 0; right: 0; transform: scaleY(-1); }
.tp-corner.bl { bottom: 0; left: 0; transform: scale(-1, -1); }

.cert { padding: 54px 80px 46px; text-align: center; align-items: center; }
.cert .tp-hd { width: calc(100% - 110px); border: 0; }
.cert .tp-hd::after { display: none; }
.cert .ct-k { font-family: "El Messiri", sans-serif; color: var(--a); font-size: 20px; letter-spacing: 2px; margin-top: 6px; }
.cert h1 { font-size: 58px; color: var(--p); }
.cert .ct-to { font-size: 18px; color: #4A5368; margin-top: 8px; }
.cert .ct-name { font-family: "El Messiri", sans-serif; font-size: 44px; font-weight: 700; color: var(--d); margin: 4px 0 2px; padding: 0 40px 6px; border-bottom: 2px solid var(--a); min-width: 420px; line-height: 1.4; }
.cert .ct-txt { font-size: 18px; line-height: 2; color: #2F3747; max-width: 760px; margin-top: 12px; }
.cert .tp-sign { width: 80%; }
.cert .ct-seal { position: absolute; left: 92px; bottom: 82px; width: 104px; height: 104px; }

/* ملصق */
.poster { padding: 0; }
.ps-top { background: var(--p); color: #fff; padding: 46px 52px 120px; position: relative; overflow: hidden; }
.ps-top h1 { color: #fff; font-size: 64px; line-height: 1.15; position: relative; }
.ps-top .k { position: relative; display: inline-block; background: var(--a); color: #fff; padding: 3px 16px; border-radius: 30px; font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.ps-top p { position: relative; font-size: 19px; opacity: .92; margin-top: 10px; max-width: 520px; }
.ps-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; }
.ps-body { padding: 0 52px 40px; flex: 1; display: flex; flex-direction: column; gap: 18px; margin-top: -60px; position: relative; }

/* علامة المعاينة */
.tp-wm { position: absolute; inset: -40%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 70px 90px; transform: rotate(-28deg); pointer-events: none; z-index: 50; }
.tp-wm span { font: 700 30px "IBM Plex Sans Arabic", sans-serif; color: rgba(20, 33, 61, .10); white-space: nowrap; }

/* الطباعة */
@media print {
  @page { size: A4 portrait; margin: 0; }
  @page land { size: A4 landscape; margin: 0; }
  .tp-page { break-after: page; page-break-after: always; }
  .tp-page.land { page: land; }
}

/* شعار الوزارة على الملصقات */
.ps-logo { position: absolute; top: 34px; left: 40px; z-index: 2; width: 168px; height: 88px; padding: 10px 14px; background: #fff; border-radius: 16px; display: grid; place-items: center; box-shadow: 0 10px 24px -14px rgba(0,0,0,.45); }
