/* Layout note: this page is opened both as a full tab and as an iframe src,
   so nothing here assumes the viewport height. The card flows from the top
   and the body scrolls; a 200px-tall iframe and a full desktop tab both work. */

:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5c6270;
  --border: #d8dbe2;
  --accent: #2b5cd9;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --surface: #1e2128;
    --text: #eceef2;
    --muted: #a0a6b4;
    --border: #343945;
    --accent: #6f95f0;
    --accent-text: #10131a;
    --danger: #f2907f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0 0 12px;
}

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

.small {
  font-size: 0.85rem;
}

.context {
  padding: 8px 12px;
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.context strong {
  color: var(--text);
}

.field {
  margin-bottom: 18px;
}

fieldset.field {
  padding: 0;
  border: 0;
  min-width: 0;
}

label,
legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
}

.req {
  color: var(--danger);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.invalid {
  border-color: var(--danger);
}

.radio-row {
  display: grid;
  gap: 8px;
}

.radio {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 0;
}

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

.radio:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.two-up {
  display: grid;
  gap: 0 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .two-up {
    grid-template-columns: 1fr 1fr;
  }
}

button {
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

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

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.form-error {
  margin-bottom: 12px;
}

/* Off-screen rather than hidden: display:none and visibility:hidden are both
   trivially detectable by form-filling bots. */
.notes2-wrap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
