/* DPP Verify — "inspection sheet" look: cool label-stock paper, mono-led type,
   signal-blue accent, semantic pass/warn/fail. */

:root {
  --paper: #f3f5f1;
  --card: #ffffff;
  --ink: #141915;
  --muted: #5b635d;
  --line: #d7dcd5;
  --accent: #16418f;
  --accent-soft: #e6ecf7;
  --pass: #1b7a3d;
  --pass-bg: #ecf5ee;
  --warn: #a25a06;
  --warn-bg: #f9f0dd;
  --fail: #b3261e;
  --fail-bg: #f9e8e6;

  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: system-ui, "Segoe UI", -apple-system, Roboto, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 1.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  color: var(--accent);
  display: inline-flex;
}

.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.masthead-side {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  gap: 0.15rem;
}

.lang-switch a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 2px;
}

.lang-switch a:hover {
  color: var(--accent);
}

.lang-switch a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.masthead-refs {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- scanner hero ---------- */

.scanner h1 {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.lede {
  max-width: 44rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.scan-frame {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.5rem 1.75rem 1.4rem;
  overflow: hidden;
}

.corner {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 0 solid var(--accent);
  pointer-events: none;
}

.corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  opacity: 0;
}

.scan-frame.scanning .scan-line {
  opacity: 0.9;
  animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
  from { transform: translateY(0); }
  to { transform: translateY(9.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .scan-frame.scanning .scan-line {
    animation: none;
    top: 50%;
    opacity: 0.5;
  }
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

#url-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

#url-input::placeholder {
  color: #9aa39c;
}

.scan-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}

.live-toggle input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

#verify-btn {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 2px;
  padding: 0.7rem 2.4rem;
  cursor: pointer;
}

#verify-btn:hover {
  background: #103273;
}

#verify-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.samples {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.sample {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: none;
  border: none;
  border-bottom: 1px dashed var(--accent);
  padding: 0 0 1px;
  margin-left: 0.65rem;
  cursor: pointer;
}

/* ---------- results ---------- */

.results {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.1rem 1.35rem 1.25rem;
}

.panel-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.panel-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -0.3rem 0 0.8rem;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 46rem) {
  .check-grid {
    grid-template-columns: 1fr;
  }
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.check {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 2px;
  font-size: 0.86rem;
  animation: check-in 0.25s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .check {
    animation: none;
  }
}

@keyframes check-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.check .glyph {
  font-family: var(--mono);
  font-weight: 700;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-size: 0.9rem;
}

.check .title {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.1rem;
}

.check .message {
  color: var(--ink);
}

.check.pass { background: var(--pass-bg); }
.check.pass .glyph { background: var(--pass); color: #fff; }
.check.pass .title { color: var(--pass); }

.check.warn { background: var(--warn-bg); }
.check.warn .glyph { background: var(--warn); color: #fff; }
.check.warn .title { color: var(--warn); }

.check.fail { background: var(--fail-bg); }
.check.fail .glyph { background: var(--fail); color: #fff; }
.check.fail .title { color: var(--fail); }

.redirects {
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.redirects li {
  margin-bottom: 0.25rem;
}

/* ---------- anatomy ---------- */

.anatomy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.segment {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.4rem 0.65rem;
  background: var(--paper);
  min-width: 0;
}

.segment .seg-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.segment .seg-value {
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.segment.key {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.segment.key .seg-label {
  color: var(--accent);
}

.segment.attribute {
  border-style: dashed;
}

/* ---------- equivalent forms ---------- */

.alt-forms {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.alt-forms dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.alt-forms dd {
  margin: 0.15rem 0 0;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.alt-forms code {
  font-family: var(--mono);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.3rem 0.5rem;
  flex: 1;
}

.copy-btn {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--accent-soft);
}

/* ---------- QR panel ---------- */

.qr-layout {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.qr-preview {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem; /* visual quiet zone around the symbol */
  align-self: flex-start;
}

#qr-img {
  display: block;
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.qr-options {
  flex: 1;
  min-width: 16rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.qr-options fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.qr-options legend {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.4rem;
}

.radio-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  background: var(--paper);
}

.radio-row label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.radio-row input {
  accent-color: var(--accent);
  margin: 0;
}

.qr-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  max-width: 30rem;
}

.qr-downloads {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.button-secondary {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.5rem 1.1rem;
  text-decoration: none;
  cursor: pointer;
  background: none;
}

.button-secondary:hover {
  background: var(--accent-soft);
}

.qr-blocked p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- response preview ---------- */

#body-preview-box {
  margin-top: 0.8rem;
}

#body-preview-box summary {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  cursor: pointer;
}

#body-preview {
  background: var(--ink);
  color: #d9e2da;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.9rem 1rem;
  border-radius: 2px;
  overflow-x: auto;
  max-height: 20rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 44rem;
}
