:root {
  --cfavn-blue: #0d4c8b;
  --cfavn-deep: #06284f;
  --cfavn-red: #b80d2c;
  --cfavn-red-dark: #8f0a22;
  --cfavn-gold: #d9a53a;
  --cfavn-ink: #1d2b3c;
  --cfavn-muted: #667386;
  --cfavn-line: #dfe5ed;
  --cfavn-soft: #f4f6f9;
  --cfavn-white: #ffffff;
  --cfavn-success: #14734b;
  --cfavn-shadow: 0 20px 48px rgba(5, 28, 58, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cfavn-soft);
  color: var(--cfavn-ink);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--cfavn-soft);
  color: var(--cfavn-ink);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.query-header {
  position: relative;
  z-index: 10;
  min-height: 84px;
  background: var(--cfavn-white);
  border-bottom: 1px solid rgba(223, 229, 237, 0.9);
  box-shadow: 0 3px 14px rgba(5, 28, 58, 0.08);
}

.query-header-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.query-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.query-brand img {
  width: 176px;
  height: 50px;
  flex: 0 0 176px;
  object-fit: contain;
}

.query-brand-copy {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--cfavn-line);
}

.query-brand-copy strong,
.query-brand-copy span {
  display: block;
}

.query-brand-copy strong {
  color: var(--cfavn-deep);
  font-size: 19px;
  line-height: 1.28;
}

.query-brand-copy span {
  margin-top: 4px;
  color: var(--cfavn-muted);
  font-size: 12px;
  line-height: 1.35;
  text-transform: uppercase;
}

.query-header-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4c5a6c;
  font-size: 13px;
  font-weight: 700;
}

.query-header-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--cfavn-success);
  box-shadow: 0 0 0 4px rgba(20, 115, 75, 0.12);
}

.query-hero {
  position: relative;
  min-height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--cfavn-deep);
  background-image: url("../images/verification-hero.jpg");
  background-position: center 44%;
  background-size: cover;
}

.query-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 30, 61, 0.77);
}

.query-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: var(--cfavn-red);
}

.query-home-inner {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 32px));
  margin: auto;
  padding: 58px 0 68px;
}

.query-intro {
  max-width: 770px;
  margin: 0 auto 32px;
  color: var(--cfavn-white);
  text-align: center;
}

.query-kicker,
.result-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f0c45e;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
}

.query-kicker::before,
.result-kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--cfavn-gold);
}

.query-intro h1 {
  margin: 15px 0 12px;
  font-size: 48px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0;
}

.query-intro p {
  max-width: 690px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.7;
}

.query-tool {
  width: 100%;
  background: var(--cfavn-white);
  border-top: 4px solid var(--cfavn-red);
  border-radius: 4px;
  box-shadow: var(--cfavn-shadow);
}

.query-tool-header {
  min-height: 88px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--cfavn-line);
}

.query-tool-index {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cfavn-deep);
  color: var(--cfavn-white);
  font-size: 14px;
  font-weight: 700;
}

.query-tool-header h2 {
  margin: 0;
  color: var(--cfavn-deep);
  font-size: 21px;
  line-height: 1.3;
}

.query-tool-header p {
  margin: 4px 0 0;
  color: var(--cfavn-muted);
  font-size: 13px;
  line-height: 1.55;
}

.query-form {
  padding: 27px 28px 24px;
}

.query-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 156px;
  gap: 18px;
  align-items: end;
}

.query-field {
  min-width: 0;
  display: block;
}

.query-field-label {
  display: block;
  margin-bottom: 8px;
  color: #35475e;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.query-control {
  position: relative;
  min-width: 0;
}

.query-control input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cfd7e2;
  border-radius: 2px;
  background: #fbfcfd;
  color: var(--cfavn-ink);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.query-control input::placeholder {
  color: #98a2b0;
}

.query-control input:hover {
  border-color: #aeb9c8;
}

.query-control input:focus {
  border-color: var(--cfavn-blue) !important;
  background: var(--cfavn-white);
  box-shadow: 0 0 0 3px rgba(13, 76, 139, 0.12);
}

.query-submit {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--cfavn-red);
  border-radius: 2px;
  background: var(--cfavn-red);
  color: var(--cfavn-white);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.query-submit:hover {
  border-color: var(--cfavn-red-dark);
  background: var(--cfavn-red-dark);
  box-shadow: 0 8px 18px rgba(184, 13, 44, 0.22);
}

.query-submit:focus-visible,
.record-action:focus-visible,
.query-brand:focus-visible {
  outline: 3px solid rgba(217, 165, 58, 0.65);
  outline-offset: 3px;
}

.query-helper {
  min-height: 42px;
  padding: 11px 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--cfavn-line);
  background: var(--cfavn-soft);
  color: var(--cfavn-muted);
  font-size: 12px;
  line-height: 1.5;
}

.query-footer {
  position: relative;
  z-index: 2;
  min-height: 48px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2e3033;
  color: #d9dde3;
  text-align: center;
}

.query-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.result-page {
  min-height: calc(100vh - 84px - 48px);
  background: var(--cfavn-soft);
}

.result-hero {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background-color: var(--cfavn-deep);
  background-image: url("../images/verification-hero.jpg");
  background-position: center 48%;
  background-size: cover;
}

.result-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 30, 61, 0.82);
}

.result-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 32px));
  min-height: 210px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--cfavn-white);
}

.result-hero h1 {
  margin: 12px 0 8px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
}

.result-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.65;
}

.result-main {
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.certificate-record {
  position: relative;
  overflow: hidden;
  background: var(--cfavn-white);
  border: 1px solid var(--cfavn-line);
  border-top: 4px solid var(--cfavn-red);
  border-radius: 4px;
  box-shadow: 0 14px 36px rgba(5, 28, 58, 0.1);
}

.record-status {
  min-height: 88px;
  padding: 18px 26px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--cfavn-line);
}

.record-status-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 115, 75, 0.1);
  border: 1px solid rgba(20, 115, 75, 0.28);
  color: var(--cfavn-success);
}

.record-status-icon {
  font-size: 24px;
  font-weight: 700;
}

.record-status-label {
  display: block;
  margin-bottom: 3px;
  color: var(--cfavn-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.record-status h2 {
  margin: 0;
  color: var(--cfavn-deep);
  font-size: 21px;
  line-height: 1.32;
}

.record-badge {
  min-width: 104px;
  min-height: 34px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cfavn-success);
  border-radius: 2px;
  color: var(--cfavn-success);
  font-size: 13px;
  font-weight: 700;
}

.record-subject {
  min-height: 190px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  gap: 26px;
  background: #f8fafc;
  border-bottom: 1px solid var(--cfavn-line);
}

.record-photo {
  width: 126px;
  height: 158px;
  flex: 0 0 126px;
  margin: 0;
  overflow: hidden;
  border: 4px solid var(--cfavn-white);
  box-shadow: 0 0 0 1px #cfd7e2, 0 8px 20px rgba(5, 28, 58, 0.12);
}

.record-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-subject-copy {
  min-width: 0;
}

.record-subject-type {
  display: block;
  margin-bottom: 9px;
  color: var(--cfavn-red);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
}

.record-subject h1 {
  margin: 0;
  color: var(--cfavn-deep);
  font-size: 30px;
  line-height: 1.28;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.record-subject-number {
  margin: 11px 0 0;
  color: var(--cfavn-muted);
  font-size: 14px;
  line-height: 1.6;
}

.record-subject-number strong {
  color: #33465e;
}

.record-content {
  padding: 10px 30px 28px;
}

.record-section {
  padding-top: 26px;
}

.record-section + .record-section {
  margin-top: 4px;
  border-top: 1px solid var(--cfavn-line);
}

.record-section h3 {
  margin: 0 0 15px;
  padding-left: 12px;
  border-left: 4px solid var(--cfavn-red);
  color: var(--cfavn-deep);
  font-size: 17px;
  line-height: 1.4;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 44px;
}

.record-row {
  min-width: 0;
  min-height: 58px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  border-bottom: 1px dashed #d7dee7;
}

.record-label {
  color: var(--cfavn-muted);
  font-size: 13px;
  line-height: 1.55;
}

.record-value {
  min-width: 0;
  color: #26384e;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.record-actions {
  min-height: 76px;
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--cfavn-soft);
  border-top: 1px solid var(--cfavn-line);
}

.record-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.record-action {
  min-height: 40px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cbd4df;
  border-radius: 2px;
  background: var(--cfavn-white);
  color: #35475e;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.record-action:hover {
  border-color: var(--cfavn-red);
  color: var(--cfavn-red);
}

.record-action--primary {
  border-color: var(--cfavn-red);
  background: var(--cfavn-red);
  color: var(--cfavn-white);
}

.record-action--primary:hover {
  border-color: var(--cfavn-red-dark);
  background: var(--cfavn-red-dark);
  color: var(--cfavn-white);
}

.record-note {
  max-width: 510px;
  margin: 0;
  color: #7c8796;
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
}

.no-result-record {
  max-width: 760px;
  margin: 0 auto;
}

.no-result-body {
  padding: 54px 30px 48px;
  text-align: center;
}

.no-result-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 13, 44, 0.08);
  border: 1px solid rgba(184, 13, 44, 0.25);
  color: var(--cfavn-red);
  font-size: 30px;
  font-weight: 700;
}

.no-result-body h2 {
  margin: 0;
  color: var(--cfavn-deep);
  font-size: 25px;
  line-height: 1.35;
}

.no-result-body > p {
  max-width: 570px;
  margin: 12px auto 0;
  color: var(--cfavn-muted);
  font-size: 14px;
  line-height: 1.7;
}

.no-result-query {
  max-width: 560px;
  margin: 26px auto 0;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  background: var(--cfavn-soft);
  border: 1px solid var(--cfavn-line);
  text-align: left;
}

.no-result-query span,
.no-result-query strong {
  display: block;
}

.no-result-query span {
  margin-bottom: 4px;
  color: var(--cfavn-muted);
  font-size: 11px;
}

.no-result-query strong {
  color: #35475e;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .query-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-submit {
    grid-column: 1 / -1;
  }

  .record-grid {
    grid-template-columns: 1fr;
  }

  .record-row {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .record-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-note {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .query-header,
  .query-header-inner {
    min-height: 74px;
  }

  .query-brand img {
    width: 132px;
    height: 42px;
    flex-basis: 132px;
  }

  .query-brand-copy {
    padding-left: 12px;
  }

  .query-brand-copy strong {
    font-size: 14px;
  }

  .query-brand-copy span,
  .query-header-status {
    display: none;
  }

  .query-hero {
    min-height: calc(100vh - 74px);
    background-position: 61% center;
  }

  .query-home-inner {
    padding: 42px 0 54px;
  }

  .query-intro {
    margin-bottom: 24px;
    text-align: left;
  }

  .query-intro h1 {
    margin-top: 12px;
    font-size: 36px;
  }

  .query-intro p {
    font-size: 15px;
  }

  .query-kicker::before,
  .result-kicker::before {
    width: 24px;
  }

  .query-tool-header,
  .query-form,
  .query-helper {
    padding-right: 20px;
    padding-left: 20px;
  }

  .query-tool-header {
    min-height: 80px;
  }

  .query-fields {
    grid-template-columns: 1fr;
  }

  .query-submit {
    grid-column: auto;
  }

  .result-page {
    min-height: calc(100vh - 74px - 48px);
  }

  .result-hero,
  .result-hero-inner {
    min-height: 176px;
  }

  .result-hero h1 {
    font-size: 29px;
  }

  .result-main {
    padding: 24px 0 38px;
  }

  .record-status {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 16px 20px;
  }

  .record-status-icon {
    width: 44px;
    height: 44px;
  }

  .record-status h2 {
    font-size: 18px;
  }

  .record-badge {
    grid-column: 2;
    width: fit-content;
    min-width: 92px;
  }

  .record-subject {
    min-height: 0;
    padding: 24px 20px;
    align-items: flex-start;
  }

  .record-photo {
    width: 100px;
    height: 128px;
    flex-basis: 100px;
  }

  .record-subject h1 {
    font-size: 24px;
  }

  .record-content {
    padding: 6px 20px 22px;
  }

  .record-row {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 12px;
  }

  .record-actions {
    padding: 16px 20px;
  }
}

@media (max-width: 500px) {
  .query-header-inner,
  .query-home-inner,
  .result-hero-inner,
  .result-main {
    width: min(100% - 24px, 1160px);
  }

  .query-brand {
    gap: 0;
  }

  .query-brand img {
    width: 142px;
    height: 42px;
    flex-basis: 142px;
  }

  .query-brand-copy {
    display: none;
  }

  .query-intro h1 {
    font-size: 32px;
  }

  .query-tool-index {
    display: none;
  }

  .query-tool-header {
    min-height: 76px;
  }

  .query-tool-header h2 {
    font-size: 19px;
  }

  .query-form {
    padding-top: 22px;
  }

  .query-helper {
    align-items: flex-start;
  }

  .result-hero,
  .result-hero-inner {
    min-height: 164px;
  }

  .result-hero h1 {
    font-size: 26px;
  }

  .record-subject {
    flex-direction: column;
    gap: 18px;
  }

  .record-photo {
    width: 92px;
    height: 116px;
    flex-basis: 116px;
  }

  .record-row {
    min-height: 0;
    padding: 11px 0;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .record-actions-group {
    width: 100%;
  }

  .record-action {
    flex: 1 1 auto;
  }

  .no-result-body {
    padding: 42px 20px 38px;
  }

  .no-result-query {
    grid-template-columns: 1fr;
  }
}

@media print {
  .query-header,
  .result-hero,
  .record-actions,
  .query-footer {
    display: none !important;
  }

  html,
  body,
  .result-page {
    background: var(--cfavn-white) !important;
  }

  .result-main {
    width: 100%;
    padding: 0;
  }

  .certificate-record {
    border: 1px solid #aab4c2;
    box-shadow: none;
  }
}
