/* ============================================================
   PTFV Đà Nẵng — Trang tra cứu + template chứng thư điện tử
   Phong cách văn bản chính thống: serif, khung kép, watermark logo
   ============================================================ */

.lookup-wrap { padding: 56px 0 80px; }

/* Ô nhập mã */
.lookup-box {
  max-width: 620px; margin: 0 auto; background: #fff;
  border: 1px solid var(--line-soft); border-top: 5px solid var(--orange-500);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 34px 34px 30px;
}
.lookup-box h2 { font-size: 22px; margin-bottom: 6px; }
.lookup-box p { color: var(--muted); font-size: 14.5px; }
.lookup-box form { display: flex; gap: 10px; margin-top: 16px; }
.lookup-box input {
  flex: 1; min-width: 0; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 15px; letter-spacing: .05em; text-transform: uppercase;
}
.lookup-box input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(34,115,199,.15); }
@media (max-width: 520px) { .lookup-box form { flex-direction: column; } }
.lookup-status { max-width: 620px; margin: 22px auto 0; text-align: center; }

/* ---------- Chứng thư điện tử ---------- */
.certificate {
  max-width: 860px; margin: 40px auto 0; background: #FDFDFB; position: relative;
  border: 1.5px solid var(--navy-800); border-radius: 4px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.certificate::before { /* khung kép cổ điển */
  content: ''; position: absolute; inset: 7px; border: 1px solid rgba(14, 58, 102, .35); pointer-events: none; border-radius: 2px;
}
.certificate::after { /* watermark logo */
  content: ''; position: absolute; inset: 0;
  background: url('/assets/img/logo_PTF.gif') center 46% / 55% no-repeat;
  opacity: .05; pointer-events: none; filter: grayscale(35%);
}

.cert-head {
  display: flex; align-items: center; gap: 18px; padding: 26px 34px 20px;
  border-bottom: 3px double var(--navy-800); position: relative; z-index: 1;
}
.cert-head img { height: 48px; background: #fff; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-soft); }
.cert-head .org { font-family: var(--font-serif); }
.cert-head .org .l1 { font-weight: 700; font-size: 15.5px; color: var(--navy-900); text-transform: uppercase; letter-spacing: .02em; }
.cert-head .org .l2 { font-size: 13.5px; color: var(--blue-600); font-weight: 600; }
.cert-verified {
  margin-left: auto; text-align: center; flex: none;
}
.cert-verified .seal {
  width: 78px; height: 78px; border-radius: 50%; border: 2.5px solid var(--ok);
  display: grid; place-items: center; margin: 0 auto 4px; color: var(--ok);
  font-size: 30px; background: var(--ok-bg); position: relative;
}
.cert-verified .seal::after {
  content: ''; position: absolute; inset: 4px; border: 1px dashed var(--ok); border-radius: 50%;
}
.cert-verified .txt { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--ok); text-transform: uppercase; }

.cert-title { text-align: center; padding: 26px 34px 6px; position: relative; z-index: 1; }
.cert-title h2 {
  font-family: var(--font-serif); font-weight: 700; font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: .08em; text-transform: uppercase; color: var(--navy-900); margin: 0;
}
.cert-title .sub { font-family: var(--font-serif); font-style: italic; color: var(--muted); font-size: 14px; }
.cert-title .rule { width: 130px; height: 3px; margin: 14px auto 0; background: linear-gradient(90deg, transparent, var(--orange-500), transparent); }

.cert-body { padding: 22px 40px 8px; position: relative; z-index: 1; }
.cert-table { width: 100%; border-collapse: collapse; font-family: var(--font-serif); }
.cert-table th, .cert-table td { text-align: left; vertical-align: top; padding: 13px 10px; border-bottom: 1px dotted #C7CFDA; }
.cert-table tr:last-child th, .cert-table tr:last-child td { border-bottom: 0; }
.cert-table th { width: 190px; font-weight: 600; color: var(--muted); font-size: 14px; white-space: nowrap; }
.cert-table td { font-weight: 600; color: var(--ink); font-size: 15.5px; line-height: 1.6; }
.cert-table td.hl { color: var(--navy-800); font-size: 17px; }
.cert-table td .mono { font-family: var(--font-mono); letter-spacing: .04em; color: var(--blue-600); }
.cert-table td.cert-value { color: var(--orange-600); font-weight: 700; font-size: 18px; }
.cert-table td.cert-value .cert-value-words { display: block; font-weight: 500; font-style: italic; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 620px) {
  .cert-body { padding: 16px 20px 4px; }
  .cert-table th { width: 120px; font-size: 12.5px; }
  .cert-table td { font-size: 14px; }
}

.cert-foot {
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  padding: 20px 40px 28px; position: relative; z-index: 1; flex-wrap: wrap;
}
.cert-issuer { font-family: var(--font-serif); font-size: 13.5px; color: var(--muted); line-height: 1.7; max-width: 520px; }
.cert-issuer strong { color: var(--navy-900); }
.cert-qr { text-align: center; flex: none; }
.cert-qr .qr-frame { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: inline-block; }
.cert-qr .qr-frame img, .cert-qr .qr-frame canvas { display: block; }
.cert-qr .lbl { font-size: 10.5px; color: var(--muted); margin-top: 5px; letter-spacing: .06em; text-transform: uppercase; }

.cert-note {
  max-width: 860px; margin: 16px auto 0; font-size: 12.5px; color: var(--muted);
  text-align: center; font-style: italic;
}

/* ---------- Mobile: canh giữa header + QR, tránh tên công ty bị bó dọc ---------- */
@media (max-width: 620px) {
  .cert-head {
    flex-direction: column; text-align: center; gap: 10px; padding: 22px 18px 16px;
  }
  .cert-head img { height: 44px; }
  .cert-head .org { text-align: center; }
  .cert-head .org .l1 { font-size: 13.5px; line-height: 1.35; }
  .cert-head .org .l2 { font-size: 12.5px; }
  .cert-verified { margin-left: 0; }
  .cert-verified .seal { width: 62px; height: 62px; font-size: 25px; }
  .cert-foot {
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 18px; padding: 18px 20px 26px;
  }
  .cert-issuer { max-width: 100%; text-align: center; }
}

/* Trạng thái chứng thư bị thu hồi/khóa */
.cert-disabled-band {
  background: var(--err-bg); color: var(--err); border: 1px solid #F2C3BC;
  padding: 12px; text-align: center; font-weight: 700; position: relative; z-index: 1;
}

/* In chứng thư: ẩn khung web, giữ chứng thư */
@media print {
  .topbar, .site-header, .site-footer, .page-hero, .lookup-box, .lookup-status, .no-print { display: none !important; }
  .lookup-wrap { padding: 0; }
  .certificate { box-shadow: none; margin: 0 auto; }
  body { background: #fff; }
}
