/*
 * BotChainSeal verify and seal pages, on the RUNECLAW design system (rc-tokens.css, rc-theme.css, rc-base.css).
 * Every colour comes from a --rc-* variable. The text pairs are checked for WCAG AA in tests/test_verify_page_ui.py.
 * The pages stay static, with no inline styles and no font or image from another origin (see the page CSP).
 */

header {
  position: relative;
  isolation: isolate;
  margin-bottom: var(--rc-s5);
}

/* The official rune mark as a quiet watermark. It is not recoloured or stretched; only its opacity is set. */
header::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -0.25rem;
  right: -0.5rem;
  width: 7.5rem;
  height: 11.5rem;
  background: url("runeclaw-mark.png") center / contain no-repeat;
  opacity: var(--rc-mark-opacity);
  pointer-events: none;
}

header .banner {
  margin-top: var(--rc-s4);
}

section {
  margin-bottom: var(--rc-s4);
  padding: var(--rc-s4);
  border: 1px solid var(--rc-card-border);
  border-radius: var(--rc-radius);
  background: var(--rc-card-bg);
  box-shadow: var(--rc-card-shadow);
  -webkit-backdrop-filter: var(--rc-card-blur);
  backdrop-filter: var(--rc-card-blur);
}

h2 {
  margin-bottom: var(--rc-s3);
}

label {
  display: block;
  margin-bottom: var(--rc-s2);
  font-weight: 600;
}

.file {
  font-weight: 400;
  color: var(--rc-muted);
}

.row {
  display: flex;
  gap: var(--rc-s2);
  margin-bottom: var(--rc-s3);
}

.small {
  font-size: var(--rc-fs-sm);
  color: var(--rc-muted);
}

section.small p,
.small a {
  font-size: inherit;
}

input#hash {
  flex: 1;
  min-width: 0;
  font-family: var(--rc-font-mono);
  font-size: var(--rc-fs-sm);
}

#check,
#send,
#connect {
  border-color: transparent;
  background: var(--rc-btn-bg);
  color: var(--rc-on-accent);
  box-shadow: var(--rc-btn-glow);
}

#check:hover:not(:disabled),
#send:hover:not(:disabled),
#connect:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: transparent;
}

#check:disabled,
#send:disabled,
#connect:disabled {
  background: var(--rc-raised);
  border-color: var(--rc-line);
  color: var(--rc-muted);
  box-shadow: none;
  filter: none;
}

button:disabled {
  cursor: wait;
}

#send:disabled {
  cursor: not-allowed;
}

#examples a {
  display: inline-block;
  margin: 0 var(--rc-s4) var(--rc-s2) 0;
  cursor: pointer;
}

/* --- Result --- */
#result:empty {
  display: none;
}

#result {
  border-left-width: 6px;
}

.verdict {
  margin-bottom: var(--rc-s3);
  font-size: var(--rc-fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.yes {
  color: var(--rc-ok);
}

.no {
  color: var(--rc-danger);
}

#result:has(.verdict.yes) {
  border-color: var(--rc-ok);
  box-shadow: 0 0 36px -14px var(--rc-ok);
}

#result:has(.verdict.no) {
  border-color: var(--rc-danger);
  box-shadow: 0 0 36px -14px var(--rc-danger);
}

.err {
  color: var(--rc-warn);
}

#result:has(.verdict.err) {
  border-color: var(--rc-warn);
}

th {
  white-space: nowrap;
  width: 1%;
}

/* Prose wraps at word edges; hashes, addresses and code may break anywhere so they never widen the page. */
td {
  overflow-wrap: anywhere;
}

td.mono,
td a,
td code,
.mono {
  word-break: break-all;
}

table:last-child tr:last-child th,
table:last-child tr:last-child td {
  border-bottom: 0;
}

.facts h2 {
  color: var(--rc-text);
  font-size: var(--rc-fs-lg);
}

.facts p {
  color: var(--rc-muted);
}

@media (min-width: 60rem) {
  header::after {
    top: 0;
    right: 0;
    width: 9.5rem;
    height: 14.5rem;
  }
}

@media (max-width: 640px) {
  header::after {
    width: 5.5rem;
    height: 8.5rem;
  }

  body.mainnet .row {
    flex-direction: column;
    align-items: stretch;
  }

  body.mainnet button {
    width: 100%;
  }

  body.mainnet input[type="file"] {
    max-width: 100%;
  }

  body.mainnet th,
  body.mainnet td {
    display: block;
    width: auto;
    white-space: normal;
    border-bottom: 0;
  }

  body.mainnet th {
    padding-bottom: 0;
  }

  body.mainnet td {
    padding: 0 0 var(--rc-s3);
  }

  /* The testnet page keeps its Check button beside the field; only the layout is tightened. */
  .row {
    gap: var(--rc-s2);
  }
}
