/*
  The pairing page. Phone first — it is read on the phone of someone standing
  in front of a TV — and dark, with the values of docs/design/tokens.css so the
  page and the app are recognisably one product. Only the tokens this page uses
  are copied; the px values there are the 1920 TV canvas, and on a phone they
  are read as CSS px directly, which is the dp the brief names.

  Nothing is loaded from anywhere: no font, no image, no script but our own.
  Nothing animates, and there is no spinner and no progress element (ADR-0008
  carrying rule B) — while a delivery is in flight the button is disabled and
  says so.
*/

:root {
  --bg-base: #0b0d10;
  --bg-surface1: #14171c;
  --bg-surface2: #1c2027;
  --bg-surface3: #242932;
  --border-subtle: #2c323c;
  --text-primary: #ffffff;
  --text-secondary: #b5bcc8;
  --text-tertiary: #7b8494;
  --accent: #2f80ed;
  --accent-hover: #4d95f5;
  --accent-subtle: rgba(47, 128, 237, 0.16);
  --accent-text: #7ab4ff;
  --success: #3ddc84;
  --danger: #e5484d;

  --font-family: 'Inter', system-ui, sans-serif;
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-badge: 8px;
  --side-padding: 16px;
  --control-height: 48px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px var(--side-padding) 32px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.3;
  font-feature-settings: 'tnum';
}

main {
  max-width: 480px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.intro {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

.card {
  margin: 0 0 16px;
  padding: 16px;
  background: var(--bg-surface1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}

.field {
  margin-bottom: 16px;
}

label,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

input[type='text'],
input[type='url'],
input[type='password'] {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 12px;
  background: var(--bg-surface2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  color: var(--text-primary);
  font: inherit;
}

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

input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.types {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.type-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-height);
  margin: 0 8px 0 0;
  padding: 0 16px;
  background: var(--bg-surface2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  color: var(--text-primary);
  font-size: 16px;
}

.type-option:has(input:checked) {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent-text);
}

.type-option input {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
  margin: 0;
}

button {
  min-height: var(--control-height);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

button.primary {
  width: 100%;
  background: var(--accent);
  color: var(--text-primary);
}

button.secondary {
  background: var(--bg-surface3);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

button:disabled {
  background: var(--bg-surface3);
  color: var(--text-tertiary);
  cursor: default;
}

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

.message {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: var(--radius-button);
  font-size: 15px;
}

.message:empty {
  display: none;
}

.message.ok {
  background: var(--bg-surface1);
  border-left: 4px solid var(--success);
  color: var(--text-primary);
}

.message.error {
  background: var(--bg-surface1);
  border-left: 4px solid var(--danger);
  color: var(--text-primary);
}

.note {
  margin: 0 0 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

#pending-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}

.pending-name {
  flex: 1;
  overflow-wrap: anywhere;
}

.badge {
  padding: 4px 8px;
  background: var(--bg-surface3);
  border-radius: var(--radius-badge);
  color: var(--text-secondary);
  font-size: 13px;
}

.disclaimer {
  margin: 24px 0 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

footer {
  max-width: 480px;
  margin: 16px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 13px;
}

/*
  The source offer (source/index.html, ADR-0088 Amendment 2): the one other
  page here. Links, the commit's facts as label and value, and hashes that
  must wrap on a phone rather than push the page sideways.
*/

.source a {
  color: var(--accent-text);
}

.facts {
  margin: 12px 0 0;
}

.facts dt {
  margin: 12px 0 4px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hash {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
