/* ============================================================================
   Tờ GIẤY CHỨNG NHẬN — bản chuyển thể 1:1 từ design/Main2.dc.html.
   Khổ A4 ngang ở 96 dpi = 1123 × 794 px. Mọi giá trị dưới đây chép từ thuộc
   tính style="…" của bản thiết kế; sửa con số nào thì đối chiếu lại với nó.

   Mọi lớp mang tiền tố c- và nằm dưới .cert: tờ chứng nhận được nhúng vào trang
   quản trị, trang in và trang tra cứu — không được ăn CSS của trang chủ nhà, và
   cũng không được để CSS của nó lấn ra ngoài.
   ========================================================================== */

.cert {
  position: relative;
  width: 1123px;
  height: 794px;
  box-sizing: border-box;
  overflow: hidden;
  background: #FBF9F4;
  color: #1B2A44;
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  /* Các đường kẻ vàng, viền, nền giấy đều là màu NỀN: thiếu dòng này thì hộp
     thoại in mặc định ("Background graphics" tắt) xóa sạch chúng. */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* Trang chủ nhà có thể đặt *{box-sizing:border-box}. Bản thiết kế dựa vào
   content-box ở mọi chỗ không ghi rõ, nên trả lại mặc định cho cả cây. */
.cert * { box-sizing: content-box; }
.cert img, .cert svg { max-width: none; }

/* In giấy: nền trắng (giấy đã có màu, và máy in văn phòng không in tràn lề).
   PDF: nền giấy kem như bản thiết kế. */
.cert.v-print { background: #FFFFFF; }

.cert .c-frame1 { position: absolute; inset: 18px; border: 1.5px solid #1B2A44; }
.cert .c-gl { position: absolute; display: block; }
.cert .c-gl-t { left: 44px; top: 20px; width: 1035px; height: 24px; }
.cert .c-gl-b { left: 44px; top: 750px; width: 1035px; height: 24px; }
.cert .c-gl-l { left: 20px; top: 44px; width: 24px; height: 706px; }
.cert .c-gl-r { left: 1079px; top: 44px; width: 24px; height: 706px; }
.cert .c-dia { position: absolute; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cert .c-dia i { display: block; width: 9px; height: 9px; background: #9C7A3C; transform: rotate(45deg); }
.cert .c-dia-tl { left: 20px; top: 20px; }
.cert .c-dia-tr { left: 1079px; top: 20px; }
.cert .c-dia-bl { left: 20px; top: 750px; }
.cert .c-dia-br { left: 1079px; top: 750px; }
.cert .c-frame2 { position: absolute; inset: 44px; border: 1px solid #9C7A3C; }
.cert .c-micro {
  position: absolute; left: 64px; right: 64px; bottom: 52px; height: 6px;
  overflow: hidden; white-space: nowrap;
  font-size: 4px; line-height: 6px; letter-spacing: 0.3px; color: #2B65B0;
}

.cert .c-body {
  position: absolute; inset: 44px; box-sizing: border-box;
  padding: 26px 52px 22px;
  display: flex; flex-direction: column; align-items: center;
}

.cert .c-head { align-self: stretch; display: flex; justify-content: space-between; align-items: center; }
.cert .c-brand { display: flex; align-items: center; gap: 12px; }
.cert .c-logo { display: block; height: 34px; width: auto; }
.cert .c-vr { width: 1px; height: 34px; background: #9C7A3C; }
.cert .c-org { display: flex; flex-direction: column; gap: 1px; }
.cert .c-org-vi { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; }
.cert .c-org-en { font-size: 12px; font-style: italic; color: #5E6678; }
.cert .c-partner { display: block; height: 76px; width: auto; }
.cert .c-partner-none { width: 1px; }

.cert .c-title {
  max-width: 100%; white-space: nowrap;
  margin: 4px 0 0; padding: 0;
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600;
  font-size: 44px; line-height: 1; letter-spacing: 0.1em; color: inherit;
}
.cert .c-sub { margin-top: 8px; display: flex; align-items: center; gap: 14px; }
.cert .c-rule { width: 56px; height: 1px; background: #9C7A3C; }
.cert .c-sub-t { font-size: 13px; font-weight: 500; letter-spacing: 0.32em; white-space: nowrap; }

.cert .c-lead {
  padding: 0;
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
  font-size: 19px; color: #3E4A5E;
}
.cert .c-lead span { color: #6B7385; }
.cert .c-lead1 { margin: 14px 0 0; max-width: 100%; white-space: nowrap; }
.cert .c-lead2 { margin: 10px 0 0; max-width: 100%; white-space: nowrap; }

/* white-space:nowrap + max-width: tên dài thì tràn (scrollWidth > clientWidth)
   chứ không xuống dòng — fit.js thấy tràn là thu cỡ chữ lại cho vừa một dòng. */
.cert .c-name {
  max-width: 100%; white-space: nowrap;
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 600;
  font-size: 54px; line-height: 1.1;
}
.cert .c-name-rule { width: 420px; height: 1px; margin-top: 2px; background: #9C7A3C; }
.cert .c-dob { margin-top: 6px; font-size: 13px; }
.cert .c-dob span { font-style: italic; color: #6B7385; }

.cert .c-course {
  max-width: 100%; white-space: nowrap;
  margin-top: 4px;
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700;
  font-size: 32px; line-height: 1.1; color: #2B65B0;
}
.cert .c-course-en {
  max-width: 100%; white-space: nowrap;
  margin-top: 3px; font-size: 13px; letter-spacing: 0.1em; color: #5E6678;
  text-transform: uppercase;
}

.cert .c-facts { margin-top: 14px; display: flex; align-items: center; gap: 26px; }
.cert .c-fact { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cert .c-fact-l { font-size: 12px; font-weight: 600; }
.cert .c-fact-e { font-size: 12px; font-style: italic; color: #6B7385; }
.cert .c-fact-v { margin-top: 2px; font-size: 14px; font-weight: 600; }
.cert .c-fact-sep { width: 1px; height: 40px; background: #9C7A3C; }

.cert .c-foot {
  align-self: stretch; margin-top: auto;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.cert .c-verify { display: flex; align-items: center; gap: 14px; }
.cert .c-qr { display: block; flex: none; width: 88px; height: 88px; }
.cert .c-qr-ph {
  box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #9AA3B5; color: #9AA3B5; font-size: 13px; letter-spacing: 0.1em;
}
.cert .c-ids { display: flex; flex-direction: column; gap: 2px; }
.cert .c-id { font-size: 12px; }
.cert .c-id span { font-style: italic; color: #6B7385; }
.cert .c-id .c-b { font-style: normal; color: inherit; }
.cert .c-b { font-weight: 700; }
.cert .c-id .c-url { color: #2B65B0; }
.cert .c-id-gap { margin-top: 4px; }
.cert .c-code { font-size: 16px; font-weight: 700; letter-spacing: 0.08em; }

.cert .c-sign { width: 310px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cert .c-place { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 17px; color: #3E4A5E; }
.cert .c-stitle { margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; }
.cert .c-stitle-en { font-size: 12px; font-style: italic; color: #6B7385; }
.cert .c-sarea { position: relative; width: 300px; height: 96px; }
.cert .c-sname { font-size: 15px; font-weight: 600; }
.cert .c-sname-missing { color: #B3261E; }

/* Vùng đóng dấu (bản in) / ô chữ ký số (bản PDF): chỉ là dấu căn chỉnh, mặc định
   ẩn. Bật bằng lớp show-guides để in thử một tờ rồi đặt dấu/ô ký cho đúng chỗ. */
.cert .c-guide { display: none; }
.cert.show-guides.v-print .c-stamp-guide,
.cert.show-guides.v-pdf .c-sig-guide { display: flex; }
.cert .c-stamp-guide {
  position: absolute; left: 30px; top: -8px; width: 122px; height: 122px; box-sizing: border-box;
  border: 1.5px dashed #B3261E; border-radius: 50%;
  align-items: center; justify-content: center; text-align: center;
  font-size: 12px; line-height: 1.3; color: #B3261E;
}
.cert .c-sig-guide {
  position: absolute; left: 14px; top: 8px; width: 272px; box-sizing: border-box;
  padding: 10px 12px; border: 1px dashed #1B2A44; background: #FFFFFF;
  gap: 10px; align-items: flex-start; text-align: left;
}
.cert .c-check { flex: none; display: block; }
.cert .c-sig-t { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.35; }
.cert .c-sig-t span { font-weight: 400; font-style: italic; color: #6B7385; }

.cert .c-note { margin-top: 10px; font-size: 12px; color: #5E6678; text-align: center; }

/* Dấu chìm: bản nháp chưa có số/mã, bản đã thu hồi không còn giá trị. */
.cert .c-mark {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-22deg);
  font-family: "Be Vietnam Pro", sans-serif; font-weight: 700; font-size: 92px; line-height: 1;
  letter-spacing: 0.06em; white-space: nowrap; pointer-events: none;
}
.cert .c-mark-draft { color: rgba(94, 102, 120, 0.13); }
.cert .c-mark-revoked {
  font-size: 66px;
  color: rgba(179, 38, 30, 0.30);
  border: 6px solid rgba(179, 38, 30, 0.30); border-radius: 14px; padding: 6px 30px 10px;
}
