:root {
  --bg: #08090b;
  --card-bg: #101216;
  --border: #24272e;
  --border-strong: #3a3f49;
  --text: #f4f5f7;
  --text-muted: #9aa1ad;
  /* Robinhood lime, sampled from the reference image. Paired with near-black
     rather than the seal's navy: navy on this is ~5:1, near-black is ~16:1. */
  --accent: #dbfd52;
  --accent-text: #08090b;
  --error: #ff8b8b;
  /* Used against the near-black input only. The button overrides it below —
     white on lime is ~1.1:1, which is no visible ring at all. */
  --focus: #ffffff;

  --radius: 10px;
  --gap: 0.75rem;
  --card-max-width: 26rem;
  --seal-size: 8.75rem;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono:
    ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Author `display` rules below (e.g. .form) would otherwise beat the UA
   [hidden] rule, so restate it here. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: var(--card-max-width);
  padding: 2rem 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  text-align: center;
}

/* The intrinsic file is 400px so it stays sharp on a 2x display; --seal-size is
   the rendered size. Square, so height follows from the aspect ratio. */
.seal {
  display: block;
  width: var(--seal-size);
  height: auto;
  margin: 0 auto 1.25rem;
  aspect-ratio: 1 / 1;
}

/* The bottom margin used to live on .tagline, which sat between this and the
   form. With the tagline gone it belongs here, or the form butts into the H1. */
.wordmark {
  margin: 0 0 2.5rem;
  font-size: clamp(2.5rem, 12vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.input,
.button {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.input {
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  /* Long hex strings must not blow out the layout at 360px. */
  min-width: 0;
  text-overflow: ellipsis;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:disabled,
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.button {
  background-color: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease-out;
}

.button:hover:not(:disabled) {
  filter: brightness(1.08);
}

/* Never remove the focus ring — keyboard users depend on it. */
.input:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* The button needs its own ring. --focus is white, for the near-black input;
   on the lime button that is ~1.1:1 and effectively invisible. A dark ring
   fixes the contrast but a dark ring 2px OUTSIDE the button lands on the dark
   card and vanishes there instead — hence the negative offset, which draws it
   inside the lime, where near-black reads at ~16:1. */
.button:focus-visible {
  outline-color: var(--accent-text);
  outline-offset: -4px;
}

.error {
  /* Reserve no space when empty, so the card does not jump on first error. */
  margin: var(--gap) 0 0;
  color: var(--error);
  font-size: 0.875rem;
  text-align: left;
}

.error:empty {
  display: none;
}

.success-headline {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.success-address {
  margin: 0.375rem 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

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

@media (min-width: 30rem) {
  .card {
    padding: 2.5rem 2rem;
  }

  .seal {
    --seal-size: 10.5rem;
  }

  .form {
    flex-direction: row;
  }

  .button {
    width: auto;
    flex: 0 0 auto;
    padding-inline: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
