.lookup-page {
  --icp-blue: #1358c8;
  --icp-blue-dark: #0e3f91;
  --icp-navy: #123a6b;
  --icp-ink: #1f2d3d;
  --icp-muted: #667a92;
  --icp-line: #e4ecf7;
  --icp-bg: #f2f7fd;
  --icp-green: #16a34a;
  --icp-green-soft: #eaf8ef;
  --icp-red: #dc2626;
  --icp-red-soft: #fef2f2;
  /* font-family: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif; */
  color: var(--icp-ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--icp-bg) 45%, #e8f1fb 100%);
  position: relative;
  overflow: hidden;
  padding-bottom: 64px;
}

.lookup-page *,
.lookup-page *::before,
.lookup-page *::after {
  box-sizing: border-box;
}

/* ---------- Tương thích theme ----------
   Theme (Flatsome và nhiều theme khác) style thẳng vào dl/dt/dd, input, button
   ở phạm vi toàn site. Các rule dưới đây vô hiệu hóa chúng, chỉ bên trong widget. */
.lookup-page dl {
  font-size: inherit;
  opacity: 1;
  text-transform: none;
  margin: 0;
}

.lookup-page dt,
.lookup-page dd {
  display: block;
  margin: 0;
  text-transform: none;
  opacity: 1;
}

.lookup-page form {
  margin: 0;
}

.lookup-page svg {
  vertical-align: middle;
}

.lookup-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* ---------- Card chung ---------- */
.lookup-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(24, 66, 124, 0.08);
  margin-top: 36px;
}

/* ---------- Form tra cứu ---------- */
.lookup-form-card {
  padding: 28px 32px 24px;
}

.lookup-form-card .label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--icp-navy);
  margin-bottom: 12px;
}

.lookup-form {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.lookup-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 0 18px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.lookup-input:focus-within {
  border-color: var(--icp-blue);
  box-shadow: 0 0 0 3px rgba(19, 88, 200, 0.12);
}

.lookup-input .barcode {
  color: #9fb3ca;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

/* height/box-shadow/margin-bottom come from the theme's global input styles and
   would otherwise clip the text and add an inner shadow to this borderless field. */
.lookup-page .lookup-input input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--icp-ink);
  padding: 17px 0;
  margin: 0;
  height: auto;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
}

.lookup-page .lookup-input input:focus {
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.lookup-input input::placeholder {
  color: #9aabc0;
}

/* Themes give bare <button> an uppercase transform, letter-spacing, a 1em right
   margin and a 1em bottom margin — all of which break this flex row. */
.lookup-page .lookup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 200px;
  min-height: 0;
  padding: 0 30px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: var(--icp-blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s;
}

.lookup-page .lookup-btn:hover {
  background: var(--icp-blue-dark);
  color: #fff;
}

.lookup-btn[disabled] {
  opacity: .65;
  cursor: default;
}

.lookup-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.lookup-icon {
  display: block;
  line-height: 0;
}

/* The magnifier never animates — while loading it is swapped out for the
   spinner, which is the only element that rotates. */
.lookup-icon-loading {
  display: none;
}

.lookup-btn.is-loading .lookup-icon-search {
  display: none;
}

.lookup-btn.is-loading .lookup-icon-loading {
  display: block;
  animation: dsn-spin .8s linear infinite;
}

@keyframes dsn-spin {
  to {
    transform: rotate(360deg);
  }
}

.lookup-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--icp-muted);
}

.lookup-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #9fb3ca;
}

/* ---------- Kết quả ---------- */
.result-card {
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--icp-green-soft);
  border-bottom: 1px solid #d8f0e2;
  padding: 22px 32px;
}

.result-head-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-check {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: var(--icp-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-check svg {
  width: 26px;
  height: 26px;
}

.result-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--icp-navy);
}

.result-head p {
  margin: 0;
  font-size: 14px;
  color: var(--icp-muted);
}

.result-head p b {
  color: var(--icp-blue);
  font-weight: 600;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--icp-navy);
  box-shadow: 0 2px 8px rgba(22, 163, 74, .12);
}

.result-badge svg {
  width: 18px;
  height: 18px;
  color: var(--icp-green);
}

.result-body {
  padding: 12px 32px 32px;
}

.result-table {
  padding-top: 16px;
  padding-right: 40px;
  margin: 0;
}

.result-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--icp-line);
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row dt {
  font-size: 15px;
  color: var(--icp-muted);
}

.result-row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--icp-navy);
}

.result-kythi-loai,
.result-kythi-ten {
  display: block;
}

/* ---------- Điểm thi ---------- */
.result-diem {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-diem-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--icp-line);
  border-radius: 8px;
  background: #f7fafd;
}

.result-diem-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--icp-muted);
}

.result-diem-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--icp-blue);
}

.result-kythi-ten {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 500;
  color: var(--icp-muted);
}

.tag-pass {
  display: inline-block;
  background: var(--icp-green-soft);
  color: var(--icp-green);
  border-radius: 6px;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
}

.tag-pass.is-fail {
  background: var(--icp-red-soft);
  color: var(--icp-red);
}

.lookup-page .btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--icp-blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 24px;
  margin: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s;
}

.lookup-page .btn-download:hover {
  background: var(--icp-blue-dark);
  color: #fff;
  text-decoration: none;
}

.btn-download svg {
  width: 18px;
  height: 18px;
}

/* ---------- Trạng thái ---------- */
.lookup-message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 32px;
  font-size: 15px;
}

.lookup-message svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 1px;
}

.lookup-message strong {
  display: block;
  font-size: 17px;
  color: var(--icp-navy);
  margin-bottom: 4px;
}

.lookup-message.is-empty svg {
  color: #e0a800;
}

.lookup-message.is-error svg {
  color: var(--icp-red);
}

.lookup-message p {
  margin: 0;
  color: var(--icp-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {

  .result-body {
    padding: 12px 22px 26px;
  }

  .result-table {
    padding-right: 0;
  }
}

@media (max-width: 640px) {

  .lookup-form {
    flex-direction: column;
  }

  /* Must match the specificity of the base .lookup-page .lookup-btn rule,
     otherwise the desktop padding/min-width win and the button collapses. */
  .lookup-page .lookup-btn {
    width: 100%;
    min-width: 0;
    padding: 15px 20px;
  }

  .lookup-form-card {
    padding: 22px 18px 20px;
  }

  .result-head {
    padding: 18px 20px;
  }

  .lookup-message {
    padding: 20px;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 13px 0;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 550px) {
  .lookup-page {
    padding-bottom: 40px;
  }

  .lookup-wrap {
    padding: 0 16px;
  }

  .lookup-card {
    border-radius: 12px;
    margin-top: 22px;
  }

  .lookup-form-card {
    padding: 18px 16px 16px;
  }

  .lookup-form-card .label {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .lookup-input {
    padding: 0 14px;
    gap: 10px;
  }

  .lookup-page .lookup-input input {
    font-size: 16px; /* under 16px iOS zooms the page on focus */
    padding: 14px 0;
  }

  .lookup-page .lookup-btn {
    padding: 14px 20px;
    font-size: 15px;
  }

  .lookup-note {
    font-size: 13px;
    align-items: flex-start;
  }

  .lookup-note svg {
    margin-top: 1px;
  }

  /* Badge drops onto its own line under the heading. */
  .result-head {
    padding: 16px;
    gap: 12px;
  }

  .result-head-left {
    gap: 12px;
  }

  .result-check {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .result-check svg {
    width: 20px;
    height: 20px;
  }

  .result-head h2 {
    font-size: 18px;
  }

  .result-head p {
    font-size: 13px;
  }

  .result-badge {
    padding: 7px 14px;
    font-size: 13px;
  }

  .result-body {
    padding: 6px 16px 20px;
  }

  .result-table {
    padding-top: 8px;
  }

  .result-row {
    padding: 12px 0;
  }

  .result-row dt {
    font-size: 13px;
  }

  .result-row dd {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .result-kythi-ten {
    font-size: 13px;
  }

  .result-diem {
    gap: 6px;
  }

  .result-diem-item {
    padding: 4px 10px;
    gap: 6px;
  }

  .result-diem-label {
    font-size: 12px;
  }

  .result-diem-value {
    font-size: 14px;
  }

  .lookup-page .btn-download {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
  }

  .lookup-message {
    padding: 16px;
    gap: 10px;
  }

  .lookup-message strong {
    font-size: 15px;
  }

  .lookup-message p {
    font-size: 14px;
  }
}