:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --card-bg: #ffffff;
  --text: #22201d;
  --muted: #6f6a63;
  --border: #e6ded3;
  --accent: #d97757;
  --accent-hover: #c8674a;
  --accent-text: #ffffff;
  --error: #b3261e;
  --success: #1a7f37;
  --kicker: #a65d3f;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.04), 0 8px 24px rgba(30, 20, 10, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --card-bg: #262320;
    --text: #f2ede6;
    --muted: #a89f93;
    --border: #3c3733;
    --accent: #e08a68;
    --accent-hover: #e8a087;
    --accent-text: #1c1a17;
    --kicker: #e8a087;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

.kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kicker);
  margin-bottom: 0.6rem;
}

h1 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.85rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 2.25rem;
  font-size: 0.98rem;
  max-width: 52ch;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 500;
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.card ol {
  padding-left: 1.2rem;
  margin: 0 0 1.5rem;
  color: var(--text);
}
.card ol li {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.ack-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.ack-item:last-child { border-bottom: none; }
.ack-item input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.ack-item label {
  font-size: 0.92rem;
}

label.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="date"],
textarea,
input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 1.2rem;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  transition: opacity 0.2s ease;
}
fieldset:disabled { opacity: 0.45; }

button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
button[type="submit"]:hover:not(:disabled) { background: var(--accent-hover); }
button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -0.65rem;
  margin-bottom: 1.2rem;
}

#status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 9px;
  font-size: 0.9rem;
  display: none;
}
#status.show { display: block; }
#status.ok { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
#status.error { background: color-mix(in srgb, var(--error) 15%, transparent); color: var(--error); }

/* Agreement page additions */
.agreement-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1rem 1.2rem;
  background: var(--bg);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}
.agreement-scroll h3 {
  font-size: 0.95rem;
  margin: 1.2rem 0 0.4rem;
}
.agreement-scroll h3:first-child { margin-top: 0; }
.agreement-scroll p { margin: 0.4rem 0 0.8rem; }
.agreement-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 540px) { .two-col { grid-template-columns: 1fr; } }
