:root {
  color-scheme: light;
  --navy: #0b3b66;
  --blue: #1264a3;
  --blue-dark: #084671;
  --cyan: #36a9d6;
  --line: #c9d8e4;
  --ink: #17324a;
  --soft: #eef5f9;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    linear-gradient(rgba(245, 249, 252, .92), rgba(245, 249, 252, .96)),
    url("/static/hinh-dep.webp") center / cover fixed no-repeat,
    #f4f8fb;
  font: 15px/1.45 "Segoe UI", Arial, sans-serif;
}

button, input { font: inherit; }

.site-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid #d7e2ea;
  background: rgba(255, 255, 255, .96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: #5d7182; }

.login-link {
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: clamp(28px, 6vh, 72px) auto 34px;
  flex: 1;
}

.lookup-band {
  min-height: 370px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #0b4d7d;
  border-radius: 8px;
  background: linear-gradient(118deg, #084b78, #1373ad 62%, #0b5687);
  box-shadow: 0 18px 45px rgba(12, 55, 87, .18);
  color: #fff;
}

.lookup-content { padding: 42px clamp(26px, 5vw, 68px); }

.eyebrow {
  margin: 0 0 8px;
  color: #bdeaff;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  max-width: 760px;
  margin: 0 0 34px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.6fr) minmax(150px, .7fr) 220px 112px;
  gap: 12px;
  align-items: end;
}

.field, .captcha-box { min-width: 0; }
.field > span, .captcha-box > span {
  display: block;
  margin-bottom: 6px;
  color: #d9f2ff;
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #a7cbdf;
  border-radius: 4px;
  outline: none;
  color: #17324a;
  background: #fff;
}

.field input:focus { border-color: #ffca47; box-shadow: 0 0 0 3px rgba(255, 202, 71, .24); }

.captcha-controls {
  height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 176px) 38px;
  gap: 6px;
}

.captcha-controls img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border: 1px solid #a7cbdf;
  border-radius: 4px;
  background: #fff;
}

.captcha-controls button {
  border: 1px solid #a7cbdf;
  border-radius: 4px;
  color: var(--navy);
  background: #e9f5fb;
  cursor: pointer;
  font-size: 24px;
}

.lookup-button {
  height: 48px;
  border: 1px solid #f3b928;
  border-radius: 4px;
  color: #1d3650;
  background: #ffcc4d;
  cursor: pointer;
  font-weight: 800;
}

.lookup-button:disabled { cursor: wait; opacity: .72; }
.form-message { min-height: 24px; margin: 14px 0 0; color: #fff; font-weight: 650; }
.form-message.error { color: #ffe0d7; }

.certificate-visual { display: grid; place-items: center; padding: 26px 36px 26px 0; }
.certificate-sheet {
  width: 210px;
  height: 260px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 8px double rgba(255,255,255,.88);
  color: #fff;
  transform: rotate(3deg);
}
.certificate-seal {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 3px solid #ffcf59;
  border-radius: 50%;
  color: #ffcf59;
  font-size: 38px;
  font-style: normal;
  font-weight: 900;
}
.certificate-sheet i { width: 120px; height: 3px; background: rgba(255,255,255,.76); }
.certificate-sheet i:nth-of-type(2) { width: 148px; }
.certificate-sheet b { margin-top: 4px; font-family: Georgia, serif; font-size: 14px; }

.result-section {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 30px rgba(24, 60, 86, .1);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.result-head small { color: var(--blue); font-weight: 800; }
.result-head h2 { margin: 2px 0 0; font-size: 22px; }
.status-badge { padding: 6px 12px; border: 1px solid #6ab38a; border-radius: 4px; color: #12653a; background: #e8f7ef; font-weight: 800; }

.result-body.has-photo {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
}
.result-photo {
  margin: 0;
  padding: 18px;
  border-right: 1px solid #dde6ed;
  text-align: center;
}
.result-photo img {
  width: 132px;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  border: 1px solid #a9bdcc;
  background: #edf3f7;
}
.result-photo figcaption { margin-top: 7px; color: #65798a; font-size: 13px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.result-grid div { min-height: 84px; padding: 15px 18px; border-right: 1px solid #dde6ed; border-bottom: 1px solid #dde6ed; }
.result-grid div:nth-child(4n) { border-right: 0; }
.result-grid .wide { grid-column: span 4; border-right: 0; border-bottom: 0; }
.result-grid dt { margin-bottom: 5px; color: #65798a; font-size: 13px; }
.result-grid dd { margin: 0; overflow-wrap: anywhere; color: #142e45; font-size: 16px; font-weight: 700; }

footer {
  display: grid;
  gap: 3px;
  padding: 18px 24px;
  border-top: 1px solid #d7e2ea;
  color: #526777;
  background: rgba(255,255,255,.95);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 980px) {
  .lookup-band { grid-template-columns: 1fr; }
  .certificate-visual { display: none; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .lookup-button { align-self: end; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid div:nth-child(4n) { border-right: 1px solid #dde6ed; }
  .result-grid div:nth-child(2n) { border-right: 0; }
  .result-grid .wide { grid-column: span 2; }
}

@media (max-width: 620px) {
  .site-head { align-items: flex-start; padding: 10px 14px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 11px; }
  .login-link { max-width: 72px; text-align: right; font-size: 12px; }
  main { width: calc(100% - 20px); margin-top: 18px; }
  .lookup-content { padding: 28px 18px; }
  h1 { font-size: 27px; }
  h1 br { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .captcha-controls { grid-template-columns: minmax(0, 1fr) 44px; }
  .result-head { align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr; }
  .result-body.has-photo { grid-template-columns: 1fr; }
  .result-photo { border-right: 0; border-bottom: 1px solid #dde6ed; }
  .result-photo img { margin: 0 auto; }
  .result-grid div, .result-grid div:nth-child(2n), .result-grid div:nth-child(4n) { border-right: 0; }
  .result-grid .wide { grid-column: span 1; }
}
