:root {
  --bg: #f7f9ff;
  --surface: #edf2ff;
  --ink: #050538;
  --ink60: rgba(5, 5, 56, 0.62);
  --ink35: rgba(5, 5, 56, 0.58);
  --border: #dde5f7;
  --grad: linear-gradient(125deg, #060197 0%, #0d6eff 100%);
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/26px var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8%;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(13, 110, 255, 0.16), transparent 68%);
  pointer-events: none;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 66px;
  display: flex;
  align-items: center;
  padding: 0 30px;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(247, 249, 255, 0.86);
  backdrop-filter: blur(10px);
}

.logo img { height: 30px; width: auto; display: block; }

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: safe center;
  padding: 48px 30px 32px;
}

.topic {
  margin: 0 0 18px;
  font: 500 12px/16px var(--sans);
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  text-transform: uppercase;
  color: var(--ink35);
}

h1 {
  margin: 0;
  max-width: 14ch;
  font-weight: 600;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  margin: 22px 0 0;
  color: var(--ink60);
  font-size: 18px;
  line-height: 28px;
}

#check {
  margin-top: 36px;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.check-row {
  display: flex;
  gap: 10px;
}

.scan-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink60);
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
}

.scan-consent input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  padding: 0;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--border);
  accent-color: #0d6eff;
  cursor: pointer;
}

.check-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 50px;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  appearance: none;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.06);
  font: 400 16px/50px var(--sans);
}

.check-row input::placeholder { color: var(--ink35); }

.check-row input[aria-invalid="true"] {
  box-shadow: 0 0 0 1px #b42318, 0 1px 2px rgba(0, 0, 0, 0.06);
}

.field-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

button {
  height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: var(--bg);
  font: 500 14px/22px var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(-1px) scale(0.96); }
button:disabled { opacity: 0.72; cursor: progress; transform: none; }

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
.scan-consent input:focus-visible,
.logo:focus-visible,
#result:focus-visible {
  outline: 2px solid #0d6eff;
  outline-offset: 3px;
}

#captcha {
  margin-top: 22px;
  min-height: 65px;
}

#outcome {
  width: min(560px, 100%);
  margin-top: 28px;
}

#outcome.outcome-split {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
  text-align: left;
}

#result,
#help {
  padding: 22px 24px;
  text-align: left;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(5, 5, 56, 0.06);
}

#result h2,
#help h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

#help h2 { font-size: 18px; }

#result-detail {
  margin: 6px 0 0;
  color: var(--ink60);
}

#result[data-status="ok"] {
  box-shadow: inset 4px 0 0 #067647, 0 0 0 1px var(--border), 0 8px 24px rgba(5, 5, 56, 0.06);
}
#result[data-status="ok"] h2 { color: #067647; }

#result[data-status="potentially_vulnerable"] {
  box-shadow: inset 4px 0 0 #b42318, 0 0 0 1px var(--border), 0 8px 24px rgba(5, 5, 56, 0.06);
}
#result[data-status="potentially_vulnerable"] h2 { color: #b42318; }

#offer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

#offer p { margin: 0; color: var(--ink60); }
.site-label {
  margin-top: 14px !important;
  font: 500 13px/18px var(--sans);
  color: var(--ink) !important;
}
#help-site {
  margin-top: 2px !important;
  color: var(--ink) !important;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.form-note {
  margin: 8px 0 0;
  color: var(--ink60);
  font-size: 14px;
  line-height: 22px;
}

#contact {
  display: flex;
  flex-direction: column;
}

#contact label {
  margin-top: 12px;
  font: 500 14px/20px var(--sans);
  color: var(--ink);
}

.optional {
  font-weight: 400;
  color: var(--ink60);
}

#contact input,
#contact textarea {
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--border);
  font: 400 16px/26px var(--sans);
}

#contact textarea { min-height: 96px; resize: vertical; }
#contact button { align-self: flex-start; margin-top: 16px; }
#help-done { margin: 16px 0 0; color: #067647; font-weight: 500; }
#help-error { margin: 12px 0 0; color: #b42318; }

footer {
  position: relative;
  z-index: 1;
  padding: 24px 30px 28px;
  text-align: center;
  color: var(--ink35);
  font-size: 14px;
  line-height: 22px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

@media (max-width: 800px) {
  #outcome.outcome-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { padding: 0 16px; }
  main { padding: 32px 16px; }
  .check-row { flex-direction: column; align-items: stretch; }
  .check-row input { flex: none; }
  #check button,
  #contact button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
