/* Palette taken from the TRIPLE S x gocity logo:
   teal #37939b (TRIPLE S mark), deep teal #042b30 (wordmark ink),
   sky #6ccce8 -> mint #70c5a5 (the "go" gradient and dots). */
:root {
  color-scheme: light;
  --sky: #6ccce8;
  --mint: #70c5a5;
  --go-gradient: linear-gradient(90deg, var(--sky), var(--mint));
  --on-go: #042b30;

  --bg: #f1f6f6;
  --bg-wash: #e0eff0;
  --surface: #ffffff;
  --surface-2: #f3f8f8;
  --ink: #042b30;
  --text: #163033;
  --muted: #4f6a6d;
  --border: #d5e3e4;
  --border-strong: #a7bfc1;
  --brand: #37939b;
  /* Brand teal darkened just enough for text-level contrast on white. */
  --accent: #2b7c83;
  --accent-soft: #e6f3f3;
  --focus-ring: rgb(55 147 155 / 0.28);
  --badge-bg: #e2f4ec;
  --error: #b42318;
  --error-soft: #fdeceb;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(4 43 48 / 0.04), 0 2px 8px rgb(4 43 48 / 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #021b1e;
    --bg-wash: #053238;
    --surface: #072a2f;
    --surface-2: #0b343a;
    --ink: #f0f8f8;
    --text: #dcebec;
    --muted: #9dbdc0;
    --border: #164248;
    --border-strong: #2a5f66;
    --brand: #4fb0b8;
    --accent: #6ec8c6;
    --accent-soft: rgb(110 200 198 / 0.13);
    --focus-ring: rgb(110 200 198 / 0.35);
    --badge-bg: rgb(112 197 165 / 0.16);
    --error: #ff8b80;
    --error-soft: rgb(255 139 128 / 0.12);
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg) linear-gradient(180deg, var(--bg-wash), transparent 420px) no-repeat;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 72px;
}

h1,
h2 {
  color: var(--ink);
}

/* Intro */

.intro {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  padding: 32px 32px 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--go-gradient);
}

.intro-logo img {
  display: block;
  width: 112px;
  height: auto;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.0625rem;
}

.notice {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  font-size: 0.9375rem;
}

@media (max-width: 560px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 20px 22px;
  }

  .intro-logo img {
    width: 84px;
  }
}

.form-key {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Cards and fields */

.card {
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 20px;
  font-size: 1.125rem;
  line-height: 1.3;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

.field + .field {
  margin-top: 24px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.sublabel {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.subfield + .subfield,
.row + .field-error + .subfield,
.row + .subfield {
  margin-top: 14px;
}

.optional {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.875rem;
}

.sublabel + .hint {
  margin-top: 0;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="password"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 6px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

input[type="file"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  border-color: var(--brand);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row > .subfield {
  margin-top: 0;
}

@media (max-width: 420px) {
  .row {
    grid-template-columns: 1fr;
  }
}

/* Choice tiles (checkboxes and radios) */

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.choices--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 540px) {
  .choices--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.choices--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 320px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.choice:hover {
  border-color: var(--border-strong);
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--accent-soft);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brand);
}

.choice input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.area-group {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background-color 0.2s;
}

.area-group + .area-group {
  margin-top: 8px;
}

.area-group legend {
  float: left;
  width: 100%;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.area-group legend + * {
  clear: both;
}

.area-group.is-match {
  border-color: var(--border);
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

.badge[hidden] {
  display: none;
}

/* Interest areas: a dropdown list of checkboxes */

.dropdown {
  position: relative;
}

.dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  list-style: none;
  cursor: pointer;
}

.dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown summary:focus-visible,
.dropdown[open] summary {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.dropdown-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s;
}

.dropdown[open] .dropdown-chevron {
  transform: rotate(180deg);
}

.is-placeholder {
  color: var(--muted);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 15;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(4 43 48 / 0.16);
}

.dropdown-panel .area-group,
.dropdown-panel .area-group + .area-group {
  margin: 0;
  padding: 10px 8px 4px;
  border-width: 0 0 1px;
  border-color: var(--border);
  border-radius: 0;
}

.dropdown-panel .area-group legend {
  margin-bottom: 4px;
  padding: 0 4px;
}

.options {
  display: flex;
  flex-direction: column;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 6px;
  line-height: 1.3;
  cursor: pointer;
}

.option:hover {
  background: var(--surface-2);
}

.option:has(input:checked) {
  background: var(--accent-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
}

.option input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.dropdown-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.dropdown-done,
.chosen-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.dropdown-done {
  min-height: 38px;
  padding: 6px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.dropdown-done:focus-visible,
.chosen-chip:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

.chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chosen:empty {
  display: none;
}

.chosen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border-color: var(--brand);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.875rem;
}

.chosen-chip span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.chosen-chip:hover span {
  background: var(--surface);
  color: var(--text);
}

/* Phones: the list opens in place (no floating panel to scroll inside),
   rows are full touch-target height and "Done" stays reachable. */
@media (max-width: 600px) {
  .dropdown-panel {
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 8px;
    box-shadow: none;
  }

  .option {
    min-height: 48px;
  }

  .dropdown-footer {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

  .dropdown-done {
    width: 100%;
    min-height: 46px;
  }

  .chosen-chip {
    min-height: 40px;
  }
}

/* Errors */

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

.field-error:empty {
  display: none;
}

.has-error input:not([type="radio"]):not([type="checkbox"]),
.has-error select {
  border-color: var(--error);
}

.has-error .choice {
  border-color: var(--error);
}

.error-summary {
  margin-bottom: 16px;
  padding: 16px 20px;
  border: 2px solid var(--error);
  border-radius: var(--radius);
  background: var(--error-soft);
}

.error-summary:focus {
  outline: 3px solid var(--error-soft);
  outline-offset: 2px;
}

.error-summary h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 20px;
}

.error-summary a {
  color: var(--error);
  font-weight: 500;
}

/* Submit */

.actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 24px;
}

.form-status {
  margin: 0;
  color: var(--error);
  font-weight: 500;
}

.form-status:empty {
  display: none;
}

/* The "go" gradient from the logo, with the wordmark's deep teal as text. */
button[type="submit"] {
  min-height: 50px;
  padding: 12px 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--go-gradient);
  color: var(--on-go);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(4 43 48 / 0.12);
}

button[type="submit"]:hover {
  background: linear-gradient(rgb(4 43 48 / 0.08), rgb(4 43 48 / 0.08)), var(--go-gradient);
}

button[type="submit"]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: progress;
}

@media (min-width: 600px) {
  .actions {
    align-items: flex-start;
  }

  button[type="submit"] {
    min-width: 200px;
  }
}

/* Spam trap */

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success */

.success {
  padding: 32px 24px;
}

.success:focus {
  outline: none;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--go-gradient);
  color: var(--on-go);
}

.success h2 {
  margin-bottom: 8px;
  font-size: 1.375rem;
}

.success p {
  margin: 0;
  color: var(--muted);
}

.success-note {
  margin-top: 16px !important;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.875rem;
}

@media (max-width: 760px) {
  input[type="file"] {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .page {
    padding-top: 24px;
  }

  .card {
    padding: 20px 16px;
  }

  .area-group {
    padding: 12px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
