:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #5a665f;
  --paper: #f7f4ed;
  --panel: #ffffff;
  --line: #d8d2c5;
  --accent: #176b55;
  --accent-dark: #0f4c3c;
  --error: #a33b22;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  padding: 36px 18px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  width: min(100%, 880px);
}

.masthead,
.login,
.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.masthead {
  grid-column: 1 / -1;
  padding: 22px 24px;
}

.age-banner {
  display: block;
  width: 100%;
  max-height: 220px;
  margin-bottom: 20px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.kicker,
.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.3rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
}

.masthead p,
.note p,
.hint,
.status {
  margin-bottom: 0;
}

.login {
  display: grid;
  gap: 18px;
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #bcb5a9;
  border-radius: 6px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea,
pre,
.nonce,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 107, 85, 0.25);
  outline-offset: 2px;
}

.nonce-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf8f3;
}

.nonce {
  display: block;
  min-height: 28px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.instructions {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: #f2faf6;
}

.instructions p {
  margin-bottom: 0;
}

.instructions h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

pre {
  margin: 0;
  overflow-x: auto;
  border-radius: 6px;
  padding: 18px;
  background: #18201c;
  color: #f6fff9;
  border: 3px solid #0f4c3c;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button--secondary {
  background: transparent;
  color: var(--accent-dark);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: #edf4f0;
  color: var(--accent-dark);
}

.status {
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.status[data-kind="error"] {
  color: var(--error);
}

.note {
  padding: 18px;
}

.note p + p {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 16px;
  }

  .masthead,
  .login,
  .note {
    padding: 16px;
  }

  .nonce-panel {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
