/* ─────────────────────────────────────────────────────────
   گواهی — نمای نمایش و چاپ
   طراحی نهایی در انتظار نمونه‌ی کارفرما (D-167)؛ این نسخه
   ساختار و سلسله‌مراتب را می‌سازد تا جای‌گذاری طرح آسان باشد.
   ───────────────────────────────────────────────────────── */
.cert-page { max-width: 900px; margin: 0 auto; padding: 28px 20px 60px; }

.cert-bar { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 22px; }

.cert {
  --cert-accent: #5B4BE8;
  --cert-ink: #191A32;
  --cert-bg: none;
  position: relative;
  background: #fff var(--cert-bg) center/cover no-repeat;
  color: var(--cert-ink);
  border: 1px solid #D6D3EC;
  border-radius: 18px;
  padding: 52px 56px 44px;
  box-shadow: 0 2px 4px rgba(25,26,50,.04), 0 18px 40px -28px rgba(25,26,50,.45);
  /* نسبت A4 افقی تا آنچه روی صفحه دیده می‌شود همان باشد که چاپ می‌شود */
  aspect-ratio: 297 / 210;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* نوار رنگی لبه — تنها عنصر تزئینی؛ جایش را طرح نهایی می‌گیرد */
.cert::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 8px; background: linear-gradient(180deg, var(--cert-accent), #1E9FC4);
}

.cert-head { display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 26px; }
.cert-brand { font-family: "Sora", system-ui, sans-serif; font-weight: 700;
  font-size: 1.35rem; letter-spacing: .12em; color: var(--cert-accent); }
.cert-brand-logo { height: 46px; width: auto; max-width: 200px; object-fit: contain; }
.cert-serial { text-align: left; direction: ltr; }
.cert-serial span { display: block; font-size: .72rem; color: #7B7D9C;
  direction: rtl; text-align: left; }
.cert-serial b { font-family: "JetBrains Mono", monospace; font-size: 1rem;
  letter-spacing: .04em; }

.cert-title { font-size: 1.9rem; font-weight: 800; text-align: center;
  margin: 0 0 6px; }
.cert-intro { text-align: center; color: #4A4C6E; font-size: .96rem; margin: 0 0 22px; }

.cert-body { font-size: 1.12rem; line-height: 2.4; text-align: center;
  margin: 0 auto 26px; max-width: 46em; }

.cert-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 40px; margin: 0 auto 26px; max-width: 40em; width: 100%; }
.cert-facts > div { display: flex; justify-content: space-between; gap: 14px;
  padding-bottom: 9px; border-bottom: 1px dotted #D6D3EC; }
.cert-facts dt { font-size: .84rem; color: #7B7D9C; margin: 0; }
.cert-facts dd { margin: 0; font-weight: 600; font-size: .94rem; text-align: left; }

.cert-sign { margin-top: auto; display: flex; justify-content: space-between;
  align-items: flex-end; gap: 30px; min-height: 76px; }
.cert-signature { max-height: 68px; width: auto; }
.cert-seal { max-height: 88px; width: auto; opacity: .92; }

.cert-disclaimer { font-size: .78rem; color: #7B7D9C; line-height: 1.9;
  margin: 20px 0 4px; text-align: center; }
.cert-footer { font-size: .76rem; color: #7B7D9C; text-align: center; margin: 0; }

.serial { font-family: "JetBrains Mono", monospace; direction: ltr;
  display: inline-block; letter-spacing: .03em; }

/* گواهی همیشه روشن است — سند چاپی حالت تیره ندارد */
@media print {
  .site-hd, .site-ft, .cert-bar { display: none !important; }
  body { background: #fff; }
  .cert-page { max-width: none; padding: 0; }
  .cert { border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto;
    min-height: 100vh; padding: 40px 46px; }
  @page { size: A4 landscape; margin: 10mm; }
}

@media (max-width: 700px) {
  .cert { padding: 32px 24px; aspect-ratio: auto; }
  .cert-facts { grid-template-columns: 1fr; }
  .cert-body { font-size: 1rem; line-height: 2.1; }
}

/* ── شناسه‌ی نامرئی (D-410، D-411) ─────────────────────────
 * کنتراست عمداً بسیار کم است: روی کاغذ و در PDF هست، در نگاه
 * عادی نیست. استگانوگرافی نیست و ادعایش را هم نمی‌کنیم — هدف
 * تشخیص فایل جعلی است، نه پنهان‌کاری کامل.
 *
 * `print-color-adjust` لازم است وگرنه مرورگر هنگام چاپ رنگ کم‌رنگ
 * را «بهینه» می‌کند و شناسه از فایل حذف می‌شود. */
.cert-fingerprint {
  margin: 18px 0 0;
  text-align: center;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 7px;
  letter-spacing: .18em;
  color: rgba(0, 0, 0, .07);
  user-select: all;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cert-fp-help {
  max-width: 720px;
  margin: 16px auto 0;
  text-align: center;
  font-size: .78rem;
  color: #6b7280;
  line-height: 1.9;
}

@media print {
  .cert-fp-help { display: none; }
}

/* ── صفحه‌ی استعلامِ اصالت (D-451، بازطراحی D-655) ─────────────
 *
 * مقیاسِ متن یکدست: h1 = 1.75rem · h2 = 1.12rem · متن = .92rem ·
 * راهنما = .82rem. همه‌ی رنگ‌ها توکن‌اند تا حالتِ تاریک را بگیرند —
 * نسخه‌ی پیشین برای کادرِ فایل و نتیجه رنگِ ثابت داشت.
 */
.vf-page { max-width: 1040px; margin: 0 auto; padding: 56px 20px 72px; }

.vf-hero { text-align: center; max-width: 620px; margin: 0 auto 36px; }
.vf-seal {
  display: inline-grid; place-items: center; width: 64px; height: 64px;
  border-radius: 20px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--signal));
  box-shadow: 0 14px 30px -14px var(--accent);
}
.vf-hero h1 { margin: 0 0 10px; font-size: 1.75rem; line-height: 1.5; color: var(--ink); }
.vf-lede { margin: 0; font-size: .98rem; line-height: 2; color: var(--ink-soft); }

.vf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.vf-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-l); padding: 26px; box-shadow: var(--shadow-m);
}
.vf-card-hd { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.vf-ico {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 14px; background: var(--accent-wash); color: var(--accent-ink);
}
.vf-card-hd h2 { margin: 2px 0 4px; font-size: 1.12rem; line-height: 1.6; color: var(--ink); }
.vf-card-hd p { margin: 0; font-size: .86rem; line-height: 1.9; color: var(--ink-soft); }

.vf-form { display: flex; flex-direction: column; gap: 8px; }
.vf-label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.vf-input {
  width: 100%; padding: 13px 16px; font-size: 1.05rem; letter-spacing: .06em;
  text-align: left; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.vf-input::placeholder { color: var(--ink-faint); letter-spacing: .1em; }
.vf-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.vf-hint { display: block; font-size: .82rem; line-height: 1.9; color: var(--ink-faint); }
.vf-form .vf-hint { margin-bottom: 10px; }
.vf-card > .vf-hint { margin: 14px 0 0; }

/* ── نتیجه‌ی استعلام با شماره ── */
.verify-ok { margin-top: 20px; padding: 20px; border-radius: 16px;
  background: var(--ok-wash); border: 1px solid var(--ok); }
.verify-badge { display: flex; align-items: center; gap: 8px; font-weight: 700;
  color: var(--ok); font-size: 1rem; margin-bottom: 14px; }
.verify-facts { display: grid; gap: 10px; margin: 0; }
.verify-facts > div { display: flex; justify-content: space-between; gap: 16px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line-soft); }
.verify-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.verify-facts dt { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.verify-facts dd { margin: 0; font-weight: 600; font-size: .9rem; text-align: left; }
.verify-note { margin: 14px 0 0; font-size: .8rem; color: var(--ink-soft); line-height: 1.9; }

/* ── کادرِ فایل: یک کادر، سه حالت؛ رنگ فقط روی دکمه ── */
.vfile-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; margin-bottom: 6px; cursor: pointer; text-align: center;
  border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.vfile-drop:hover, .vfile-drop.is-over { border-color: var(--accent); background: var(--accent-wash); }
.vfile-drop.has-file { border-style: solid; border-color: var(--accent); }
.vfile-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); color: var(--accent); box-shadow: var(--shadow-s);
}
.vfile-text { font-size: .95rem; font-weight: 600; color: var(--ink); word-break: break-all; }
.vfile-sub { font-size: .78rem; color: var(--ink-faint); letter-spacing: .04em; }

.vbtn { transition: background .2s, border-color .2s; }
.vbtn:disabled { opacity: .5; cursor: not-allowed; }
.vbtn-ok, .vbtn-ok:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.vbtn-bad, .vbtn-bad:hover { background: var(--live); border-color: var(--live); color: #fff; }

.vresult { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  font-size: .86rem; line-height: 1.9; }
.vresult.ok { background: var(--ok-wash); border: 1px solid var(--ok); color: var(--ink); }
.vresult.bad { background: var(--live-wash); border: 1px solid var(--live); color: var(--ink); }

.vf-trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
  list-style: none; padding: 0; margin: 32px 0 0;
}
.vf-trust li { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink-soft); }
.vf-trust svg { color: var(--accent); flex: none; }

@media (max-width: 860px) {
  .vf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .vf-page { padding: 36px 16px 56px; }
  .vf-hero h1 { font-size: 1.45rem; }
  .vf-lede { font-size: .92rem; }
  .vf-card { padding: 20px; }
  .vf-trust { flex-direction: column; align-items: center; }
}
