:root {
  --navy: #0b2d5c;
  --navy-2: #153f75;
  --navy-deep: #071f41;
  --sky: #49a8d8;
  --sky-bright: #78c9ee;
  --sky-soft: #e8f5fb;
  --white: #ffffff;
  --surface: #f5f8fc;
  --ink: #132238;
  --muted: #66768c;
  --line: #dce5ef;
  --success: #166534;
  --success-soft: #e7f6ed;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --shadow: 0 18px 55px rgba(17, 43, 78, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: inherit;
  background:
    radial-gradient(circle at 9% 8%, rgba(73, 168, 216, .2), transparent 30rem),
    radial-gradient(circle at 94% 92%, rgba(21, 63, 117, .11), transparent 32rem),
    linear-gradient(145deg, #f9fbfe 0%, #edf5fb 52%, #f7f9fc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background-image:
    linear-gradient(rgba(11, 45, 92, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 45, 92, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.result-dialog {
  width: min(1040px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 30px 100px rgba(7, 31, 65, .34);
}

.result-dialog::backdrop {
  background: rgba(7, 31, 65, .72);
  backdrop-filter: blur(5px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(73, 168, 216, .42);
  outline-offset: 3px;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header { margin-bottom: 38px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 9px 22px rgba(11, 45, 92, .18);
}

.brand span { display: grid; gap: 2px; }
.brand strong {
  color: var(--navy);
  font-size: .94rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.brand small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.portal-link {
  padding: 10px 16px;
  border: 1px solid #bddfeb;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 6px 18px rgba(17, 43, 78, .05);
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.portal-link:hover {
  border-color: var(--sky);
  background: var(--sky-soft);
  transform: translateY(-1px);
}

main { display: grid; gap: 22px; }

.lookup-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(34px, 8vw, 110px);
  align-items: end;
  padding: clamp(36px, 6vw, 72px);
  overflow: hidden;
  color: var(--white);
  border: 1px solid rgba(120, 201, 238, .24);
  border-radius: 30px;
  box-shadow: 0 24px 65px rgba(7, 31, 65, .2);
  background:
    radial-gradient(circle at 86% 10%, rgba(120, 201, 238, .28), transparent 17rem),
    linear-gradient(125deg, var(--navy-deep), var(--navy) 58%, var(--navy-2));
}

.lookup-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(36px, 6vw, 72px);
  width: 116px;
  height: 5px;
  border-radius: 0 0 999px 999px;
  background: var(--sky-bright);
}

.lookup-panel::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -80px;
  bottom: -155px;
  border: 38px solid rgba(255, 255, 255, .065);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sky-bright);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.intro-copy {
  position: relative;
  z-index: 1;
}

.intro-copy h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -.06em;
}

.intro-copy h1 span { color: var(--sky-bright); }

.intro-copy > p:last-child {
  max-width: 580px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.7;
}

.lookup-form {
  position: relative;
  z-index: 1;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 22px;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}

.lookup-form label {
  display: block;
  margin-bottom: 9px;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.input-row { display: grid; gap: 10px; }

.input-row input {
  width: 100%;
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 13px;
  outline: none;
  color: var(--navy-deep);
  background: rgba(255, 255, 255, .98);
  font-weight: 800;
  letter-spacing: .07em;
}

.input-row input:focus {
  border-color: var(--sky-bright);
  box-shadow: 0 0 0 4px rgba(73, 168, 216, .24);
}

.input-row button,
#refreshButton {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}

.input-row button {
  min-height: 52px;
  color: var(--navy-deep);
  background: var(--sky-bright);
  box-shadow: 0 8px 20px rgba(7, 31, 65, .2);
  transition: background .18s ease, transform .18s ease;
}

.input-row button:hover {
  background: #9bddf7;
  transform: translateY(-1px);
}

.input-row button:disabled {
  cursor: wait;
  opacity: .7;
  transform: none;
}

.form-hint {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .66);
  font-size: .74rem;
}

.state-card,
.result-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--sky);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  animation: rise .42s ease both;
}

.state-card {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 150px;
  padding: 32px 38px;
}

.state-card h2 {
  margin: 0 0 7px;
  color: var(--navy);
  font-family: inherit;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -.035em;
}

.state-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.signal-mark {
  display: flex;
  align-items: end;
  gap: 5px;
  width: 54px;
  height: 54px;
  padding: 11px;
  border-radius: 15px;
  background: var(--sky-soft);
}

.signal-mark i {
  display: block;
  width: 7px;
  border-radius: 5px;
  background: var(--sky);
}

.signal-mark i:nth-child(1) { height: 11px; }
.signal-mark i:nth-child(2) { height: 20px; }
.signal-mark i:nth-child(3) { height: 31px; }

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #dceaf2;
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.status-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  color: var(--white);
  border-radius: 50%;
  background: var(--danger);
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 900;
}

.error-state { border-top-color: var(--danger); }

.result-card {
  position: relative;
  padding: clamp(28px, 5vw, 52px);
}

.result-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #bddfeb;
  border-radius: 12px;
  color: var(--navy);
  background: var(--sky-soft);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.result-close:hover { background: #d9eff9; }

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-right: 48px;
}

.result-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: inherit;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -.055em;
}

.result-heading > div > p:last-child {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--muted);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 13px;
}

.status-dot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 7px rgba(34, 160, 107, .15);
}

.status-badge {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.result-card[data-status="ready"] .status-dot {
  background: var(--sky);
  box-shadow: 0 0 0 7px rgba(73, 168, 216, .17);
}

.result-card[data-status="ready"] .status-badge {
  background: var(--sky-soft);
  color: var(--navy-2);
}

.result-card[data-status="expired"] .status-dot {
  background: #d76862;
  box-shadow: 0 0 0 7px rgba(215, 104, 98, .15);
}

.result-card[data-status="expired"] .status-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

.countdown-panel {
  margin: 32px 0;
  padding: 24px 27px;
  border-radius: 18px;
  color: var(--white);
  background:
    radial-gradient(circle at 92% 0%, rgba(120, 201, 238, .2), transparent 14rem),
    linear-gradient(115deg, var(--navy-deep), var(--navy-2));
}

.countdown-panel > span {
  display: block;
  color: rgba(255, 255, 255, .66);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.countdown-panel strong {
  display: block;
  margin-top: 7px;
  font-family: inherit;
  font-size: clamp(2.3rem, 7vw, 4.7rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.progress-track {
  height: 7px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--sky-bright));
  transition: width .5s ease;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}

.detail-grid article {
  min-height: 130px;
  padding: 21px;
  border: 1px solid #cfe4ef;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, var(--sky-soft));
}

.detail-label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  color: var(--navy);
  font-family: inherit;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 900;
  line-height: 1.15;
}

.detail-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .77rem;
}

#refreshButton {
  padding: 10px 14px;
  border: 1px solid #bddfeb;
  color: var(--navy);
  background: var(--sky-soft);
}

#refreshButton:hover { background: #d9eff9; }

.site-footer {
  gap: 20px;
  padding: 24px 5px 0;
  color: var(--muted);
  font-size: .71rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    padding-top: 13px;
  }

  .site-header { margin-bottom: 20px; }

  .lookup-panel {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 34px 24px;
    border-radius: 24px;
  }

  .intro-copy h1 { font-size: clamp(3rem, 14vw, 5rem); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .result-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .result-close {
    top: 13px;
    right: 13px;
    width: 38px;
    height: 38px;
  }

  .result-heading { padding-right: 36px; }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand strong { font-size: .78rem; }
  .brand small { font-size: .6rem; }
  .portal-link {
    padding: 8px 11px;
    font-size: .7rem;
  }

  .lookup-form { padding: 18px; }

  .state-card {
    align-items: flex-start;
    padding: 24px 21px;
  }

  .result-heading { display: grid; }
  .status-badge { justify-self: start; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid article { min-height: 110px; }

  .result-footer,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
