:root {
  --field-border: #c7ccd4;
  --field-border-focus: #1f6feb;
  --field-text: #10141a;
  --field-background: #ffffff;
  --error-text: #b3261e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --field-border: #4a515c;
    --field-border-focus: #6aa2ff;
    --field-text: #f2f4f8;
    --field-background: #14181e;
    --error-text: #ff8f85;
  }
}

* {
  box-sizing: border-box;
}

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

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.row {
  display: flex;
  gap: 0.75rem;
}

.row .field {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

label {
  font-size: 0.8125rem;
  font-weight: 600;
}

input {
  /* 16px minimum: anything smaller makes iOS Safari zoom the frame on focus. */
  font: inherit;
  color: var(--field-text);
  background: var(--field-background);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  min-width: 0;
}

input:focus-visible {
  outline: 2px solid var(--field-border-focus);
  outline-offset: 1px;
  border-color: var(--field-border-focus);
}

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

.error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--error-text);
}
