@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --border: #d8dee7;
  --evergreen: #087a55;
  --evergreen-dark: #056340;
  --evergreen-soft: #eaf4ef;
  --blue: #1768d7;
  --blue-soft: #eaf2fd;
  --amber: #b66e00;
  --amber-soft: #fff2dd;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
  letter-spacing: 0;
}

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

.topbar {
  align-items: center;
  border-bottom: 1px solid rgba(216, 222, 231, 0.82);
  display: flex;
  justify-content: space-between;
  margin-inline: auto;
  min-height: 72px;
  padding: 0 32px;
  width: min(100%, 1180px);
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  font-weight: 780;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  color: var(--evergreen);
  height: 38px;
  width: 38px;
}

.sign-in {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.sign-in:hover {
  color: var(--evergreen);
}

.scan-shell {
  margin-inline: auto;
  max-width: 960px;
  padding: clamp(48px, 6vh, 64px) 32px 48px;
  text-align: center;
}

.scan-intro {
  margin-inline: auto;
  max-width: 840px;
}

h1 {
  font-size: clamp(42px, 4.3vw, 60px);
  font-weight: 790;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 auto;
  max-width: 900px;
  text-wrap: balance;
}

.scan-intro > p {
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  margin: 20px auto 0;
  max-width: 720px;
  text-wrap: pretty;
}

.scan-form {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.10);
  display: grid;
  gap: 8px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  margin: 30px auto 0;
  max-width: 760px;
  padding: 8px;
  text-align: left;
}

.search-icon {
  color: #7d8796;
  margin-left: 10px;
}

.search-icon svg,
.result-check svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 24px;
}

.scan-form input {
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 17px;
  min-width: 0;
  outline: 0;
  padding: 14px 6px;
}

.scan-form input::placeholder {
  color: #8a94a3;
}

.scan-form:focus-within {
  border-color: var(--evergreen);
  box-shadow: 0 0 0 3px rgba(8, 122, 85, 0.12), 0 18px 48px rgba(16, 24, 40, 0.10);
}

.scan-form button,
.primary-action,
.scan-failure button {
  align-items: center;
  background: var(--evergreen);
  border: 1px solid var(--evergreen);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 720;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.scan-form button:hover,
.primary-action:hover,
.scan-failure button:hover {
  background: var(--evergreen-dark);
  border-color: var(--evergreen-dark);
}

.scan-form button:active,
.primary-action:active,
.scan-failure button:active {
  transform: translateY(1px);
}

.scan-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-note {
  font-size: 13px !important;
  margin-top: 14px !important;
}

.form-error {
  color: var(--danger) !important;
  font-size: 14px !important;
  font-weight: 620;
  margin-top: 12px !important;
}

.scan-output {
  margin: 28px auto 0;
  max-width: 820px;
  min-height: 260px;
  position: relative;
}

.scan-idle {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 36px;
}

.scan-idle span {
  background: #dfe4eb;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.scan-loading,
.scan-results,
.scan-failure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(16, 24, 40, 0.07);
  padding: 24px;
  text-align: left;
}

.loading-heading {
  align-items: center;
  display: flex;
  font-size: 17px;
  gap: 12px;
}

.spinner {
  animation: rotate 900ms linear infinite;
  border: 2px solid #cde7dd;
  border-radius: 50%;
  border-top-color: var(--evergreen);
  height: 22px;
  width: 22px;
}

.progress-track {
  background: #edf0f4;
  height: 3px;
  margin-top: 24px;
  overflow: hidden;
}

.progress-track span {
  background: var(--evergreen);
  display: block;
  height: 100%;
  transition: width 500ms ease;
  width: 12%;
}

.loading-steps {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.loading-steps li {
  align-items: center;
  color: #8a94a3;
  display: flex;
  font-size: 14px;
  gap: 10px;
  transition: color 150ms ease;
}

.loading-steps li > span {
  border: 1px solid #cbd2dc;
  border-radius: 50%;
  height: 9px;
  width: 9px;
}

.loading-steps li.is-active {
  color: var(--ink);
  font-weight: 650;
}

.loading-steps li.is-active > span,
.loading-steps li.is-complete > span {
  background: var(--evergreen);
  border-color: var(--evergreen);
}

.loading-steps li.is-complete {
  color: var(--evergreen);
}

.result-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.result-label {
  color: var(--evergreen);
  display: block;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-heading h2,
.scan-failure h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 7px 0 0;
}

.result-check {
  align-items: center;
  background: var(--evergreen-soft);
  border: 1px solid #cce2d8;
  border-radius: 8px;
  color: var(--evergreen);
  display: flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.result-metrics {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
  overflow: hidden;
}

.result-metric {
  border-top: 3px solid var(--evergreen);
  min-width: 0;
  padding: 19px;
}

.result-metric + .result-metric {
  border-left: 1px solid var(--border);
}

.result-metric--blue {
  border-top-color: var(--blue);
}

.result-metric--amber {
  border-top-color: var(--amber);
}

.result-metric strong {
  display: block;
  font-size: clamp(25px, 3.5vw, 34px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.result-metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.35;
  margin-top: 10px;
}

.result-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 16px 0 0;
}

.result-actions {
  align-items: center;
  display: flex;
  gap: 20px;
  margin-top: 22px;
}

.reset-action {
  background: transparent;
  border: 0;
  color: var(--evergreen);
  cursor: pointer;
  font-size: 14px;
  font-weight: 680;
  padding: 12px 0;
}

.scan-failure {
  text-align: center;
}

.failure-icon {
  align-items: center;
  background: #fff0ee;
  border-radius: 50%;
  color: var(--danger);
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.scan-failure p {
  color: var(--muted);
  line-height: 1.5;
  margin: 10px auto 20px;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 680px) {
  .topbar {
    min-height: 64px;
    padding-inline: 20px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    height: 34px;
    width: 34px;
  }

  .scan-shell {
    padding: 56px 20px 40px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 52px);
  }

  .scan-intro > p {
    font-size: 17px;
  }

  .scan-form {
    grid-template-columns: 26px minmax(0, 1fr);
    margin-top: 32px;
  }

  .scan-form button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .scan-output {
    margin-top: 30px;
    min-height: 220px;
  }

  .scan-loading,
  .scan-results,
  .scan-failure {
    padding: 22px;
  }

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

  .result-metric + .result-metric {
    border-left: 0;
    border-top-width: 3px;
  }

  .result-metric {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
  }

  .result-metric span {
    margin-top: 0;
    max-width: 150px;
    text-align: right;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .brand span {
    max-width: 112px;
    line-height: 1.05;
  }

  .scan-shell {
    padding-inline: 16px;
  }

  .result-heading h2 {
    font-size: 21px;
  }

  .result-check {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    animation: none;
  }
}
