:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #5a5a5a;
  --border: #ccc;
  --accent: #6b2fb3;
  --accent-fg: #ffffff;
  --error: #b3261e;
  --success: #1e6b3c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f0f0f0;
    --bg: #17171a;
    --muted: #b0b0b0;
    --border: #444;
    --accent: #b083f0;
    --accent-fg: #1a1a1a;
    --error: #ff6b60;
    --success: #5fd693;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.intro {
  color: var(--muted);
  margin-bottom: 2rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field.conditional {
  margin-left: 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--border);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.hint {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: normal;
}

.req {
  color: var(--error);
  font-weight: normal;
  font-size: 0.85rem;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  font-weight: 600;
  margin-bottom: 0.3rem;
  padding: 0;
}

.radio-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.radio-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.radio-row label,
.radio-col label {
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Honeypot: visually hidden but present in the DOM and layout, so naive bots
   that just skip display:none / hidden fields still fill it in */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.5rem;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#status-msg {
  margin-top: 1rem;
  font-weight: 600;
  min-height: 1.2em;
}

#status-msg[data-state="error"] { color: var(--error); }
#status-msg[data-state="success"] { color: var(--success); }
