:root {
  color-scheme: light;
  --ink: #252525;
  --muted: #626262;
  --line: #d2d2d2;
  --accent: #2f6f46;
  --error: #a72222;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f4f4f4;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }

.page {
  width: calc(100% - 40px);
  max-width: 640px;
  margin: 36px auto;
  padding: 32px 36px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.intro { margin-bottom: 28px; }
h1 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
}
.intro-copy p { margin: 0 0 14px; }
.rally { margin: 18px 0 0; }
.form-card {
  min-width: 0;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}
h2 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.35;
}
.card-description {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}
.field { margin-bottom: 18px; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}
input, select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
input::placeholder { color: #757575; opacity: 1; }
select { cursor: pointer; padding-right: 30px; }
select:disabled { background: #f7f7f7; color: #737373; cursor: default; }
input:focus, select:focus {
  outline: 2px solid #91b69d;
  outline-offset: 1px;
  border-color: var(--accent);
}
.phone-control {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.phone-control:focus-within {
  outline: 2px solid #91b69d;
  outline-offset: 1px;
  border-color: var(--accent);
}
.phone-control input { border: 0; border-radius: 0; }
.phone-control input:focus { outline: none; }
.country {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #f7f7f7;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  font-size: 15px;
}
.flag { width: 25px; height: 18px; flex-shrink: 0; }
.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.field-error { margin: 6px 0 0; color: var(--error); font-size: 14px; line-height: 1.4; }
.field-error:empty, .form-error:empty { display: none; }
[aria-invalid=true], .phone-control:has([aria-invalid=true]) { border-color: var(--error); }
.privacy { margin: 22px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--error);
  background: #fff3f3;
  border: 1px solid #e8c9c9;
  border-radius: 4px;
  font-size: 14px;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.primary-button:hover { background: #245936; }
.primary-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary-button:disabled { opacity: .7; cursor: wait; }
.redirect-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.sp-picker { min-width: 0; margin: 2px 0 20px; padding: 0; border: 0; }
.sp-picker > legend, .sp-neighborhoods > legend { padding: 0; font-size: 14px; font-weight: 700; }
.map-instruction { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.sp-map { display: block; width: 100%; height: 350px; margin: 0 auto 16px; }
.map-zone { cursor: pointer; }
.map-zone path { fill: #dfe9e2; stroke: #fff; stroke-width: 3; stroke-linejoin: round; transition: fill .12s; }
.map-zone text { fill: #303b33; font-family: Arial, Helvetica, sans-serif; font-size: 24px; font-weight: 700; paint-order: stroke; stroke: #dfe9e2; stroke-width: 4; pointer-events: none; }
.map-zone:hover path { fill: #bfd1c4; }
.map-zone:hover text { stroke: #bfd1c4; }
.map-zone[aria-pressed=true] path { fill: var(--accent); }
.map-zone[aria-pressed=true] text { fill: #fff; stroke: var(--accent); }
.map-zone:focus-visible { outline: none; }
.map-zone:focus-visible path { stroke: #172d20; stroke-width: 5; }
.zone-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.zone-button { min-height: 44px; flex: 1 0 auto; padding: 8px 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; font-size: 14px; cursor: pointer; }
.zone-button:hover { background: #edf3ef; }
.zone-button[aria-pressed=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
.zone-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-source { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.map-source a { color: inherit; text-underline-offset: 2px; }
.sp-neighborhoods { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.neighborhood-hint { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.neighborhood-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.neighborhood-option { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; font-weight: 400; cursor: pointer; }
.neighborhood-option input { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; margin: 0; accent-color: var(--accent); }
.neighborhood-option:has(input:checked) { border-color: var(--accent); background: #f0f6f2; }
.neighborhood-option:has(input:focus-visible) { outline: 2px solid #91b69d; outline-offset: 1px; }
.sp-picker[aria-invalid=true] .zone-button, .neighborhood-option:has([aria-invalid=true]) { border-color: var(--error); }
#region-error:not(:empty) { margin-bottom: 16px; }

.success { padding: 8px 0; outline: none; }
.success h2 { margin-bottom: 16px; font-size: 24px; }
.success p { margin: 0 0 16px; }
.selected-group { font-weight: 700; }
.success-detail { color: var(--muted); font-size: 15px; }
.thanks-page { width: calc(100% - 40px); max-width: 640px; margin: 36px auto; padding: 32px 36px; background: #fff; border: 1px solid #ddd; border-radius: 4px; }
.thanks-page .form-card { padding: 0; border: 0; }
.thanks-title { margin-bottom: 16px; font-size: 24px; }

@media (max-width: 680px) {
  body { background: #fff; }
  .page, .thanks-page { width: 100%; margin: 0; padding: 28px 22px; border: 0; border-radius: 0; }
  h1 { font-size: 27px; }
  .intro { margin-bottom: 24px; }
  .form-card { padding-top: 22px; }
}
@media (max-width: 420px) {
  .sp-map { height: 320px; }
  .neighborhood-options { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .map-zone path { transition: none; } }
