/* State of the City Contract - survey microsite.
   Standalone from the main site stylesheet: this is one focused experience and
   it should not inherit page furniture it does not need. Palette and type are
   taken from styles.css so it still reads as Tomorrow.City. */

:root {
  --paper: #FFFFFF;
  --ink: #0E1113;
  --ink-soft: #3E4644;
  --mint: #0EE2B9;
  --teal: #1CA292;
  --teal-deep: #007A63;
  --teal-dark: #073830;
  --teal-tint: #E7F7F4;
  --line: #DCEAE6;
  --radius: 10px;
  --font-sans: "Montserrat", "Gotham", system-ui, -apple-system, sans-serif;
  --measure: 640px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  /* Space for the fixed bar and progress rail. */
  padding-top: 56px;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.mono {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}

/* ---------- Bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.bar-logo {
  display: block;
  width: auto;
  height: 34px;
}

.bar-title {
  flex: 1;
  color: var(--ink-soft);
  /* The brand carries the small screen; the section name is a wide-screen luxury. */
  display: none;
}

.bar-count { color: var(--teal-deep); white-space: nowrap; }

.progress {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 10;
  height: 3px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--teal-deep);
  transition: width 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Stage ---------- */

.stage {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.screen { display: none; }
.screen.is-active { display: block; }

/* Each screen arrives as one unit with a short fade-dominant settle.
   Children never animate independently: a staggered entrance makes the
   option list land after the title, which reads as a bounce on every
   auto-advance. */
.screen.is-active {
  animation: rise 240ms ease-out both;
}

/* Same-screen re-renders (selection repaints) arrive already settled. */
.screen.is-settled { animation: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--teal-deep);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.q-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.q-help {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* The one line of context under every question: why we are asking, and how
   to answer it. Never optional on a question screen. */
.q-why {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 52ch;
}

/* The answers already given, carried forward so the path is visible. */
.ctx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.ctx-item {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-dark);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The solicitation is visually marked so it does not read as a survey
   question. Respondents should be able to see where research stops. */
.q-why.is-ask {
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  background: var(--teal-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--teal-dark);
}

/* Escape hatches: present and equally tappable, just visually quieter so
   they do not compete with substantive options. Never disabled or hidden. */
.opt.is-quiet .opt-label { color: var(--ink-soft); font-weight: 500; }

.pick-count {
  margin-bottom: 12px;
  color: var(--teal-deep);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.q-body { margin-top: 26px; }

/* ---------- Options ---------- */

.opt {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin-bottom: 10px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.opt:hover { border-color: var(--teal); }
.opt:active { transform: scale(0.995); }

.opt.is-on {
  border-color: var(--teal-deep);
  background: var(--teal-tint);
}

.opt-key {
  flex: none;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}

.opt.is-on .opt-key {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: var(--paper);
}

.opt-body { flex: 1; min-width: 0; }

/* Spans, so they must be made block explicitly or the label and note run
   together on one line. */
.opt-label { display: block; font-weight: 600; }
.opt-note {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

/* Multi select reads as a box, not a pill. */
.opt.is-multi .opt-key { border-radius: 5px; }

/* Capped multi: once full, the unpicked options step back rather than
   refusing the tap. Tapping one still works, replacing the oldest pick. */
.opt.is-muted { opacity: 0.55; }
.opt.is-muted:hover { opacity: 1; }

.promise-covers {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

/* ---------- Text ---------- */

.field {
  width: 100%;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.field:focus {
  outline: none;
  border-color: var(--teal-deep);
}

textarea.field {
  min-height: 132px;
  resize: vertical;
  line-height: 1.5;
}

.field::placeholder { color: #9AA8A4; }

.counter {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.counter.is-over { color: #B4453A; }

.field-row { margin-bottom: 16px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8125rem;
  font-weight: 700;
}
.field-label .opt-note { display: inline; margin: 0; font-weight: 400; }

/* ---------- Rank ---------- */

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.rank-pos {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-deep);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}

.rank-label { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9375rem; }

.rank-note {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
}

.rank-move {
  flex: none;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--teal-deep);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.rank-move:hover:not(:disabled) { border-color: var(--teal-deep); background: var(--teal-tint); }
.rank-move:disabled { opacity: 0.3; cursor: default; }

/* ---------- Allocate ---------- */

.alloc-item { margin-bottom: 18px; }

.alloc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
}

.alloc-name { font-weight: 600; font-size: 0.9375rem; }
.alloc-val { font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}
input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8.5px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--teal-deep);
  box-shadow: 0 1px 4px rgba(7, 56, 48, 0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--teal-deep);
}

.alloc-total {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1.5px solid var(--line);
  font-weight: 800;
}

.alloc-total.is-ok { color: var(--teal-deep); }
.alloc-total.is-off { color: #B4453A; }

/* ---------- Scale ---------- */

.scale-value {
  margin: 6px 0 18px;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.btn {
  padding: 14px 26px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.btn-primary { background: var(--teal-deep); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-primary:disabled { opacity: 0.35; cursor: default; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-back {
  padding: 10px 0;
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-back:hover { color: var(--ink); }

.nav-spacer { flex: 1; }

.hint {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hint kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 700;
}

/* ---------- Intro ---------- */

.intro-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.promise-list { margin: 26px 0; }

.promise-row {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.promise-num {
  flex: none;
  width: 26px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
}

.promise-text { font-size: 0.9375rem; font-weight: 600; }

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Reveal ---------- */

.reveal-tag {
  margin: 8px 0 26px;
  padding: 22px;
  background: var(--teal-dark);
  border-radius: var(--radius);
  color: var(--paper);
}

.reveal-tag-role {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.reveal-tag-note {
  margin-top: 10px;
  color: #B7D9D1;
  font-size: 0.875rem;
}

.card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.card-label {
  margin-bottom: 12px;
  color: var(--teal-deep);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-line { font-size: 0.9375rem; }
.card-line + .card-line { margin-top: 8px; }
.card-line strong { font-weight: 800; }

.bar-chart { margin-top: 14px; }

.bar-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.bar-name { font-size: 0.8125rem; font-weight: 600; }
.bar-name .bar-you {
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar-track {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.bar-value {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bar-row.is-you .bar-value { background: var(--teal-deep); }
.bar-pct {
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.suppressed {
  padding: 16px 18px;
  background: var(--teal-tint);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.route {
  margin-top: 30px;
  padding: 26px 22px;
  background: var(--teal-tint);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
}

.route-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.route-note {
  margin: 10px 0 20px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.route .btn-primary { display: inline-block; }

.secondary {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.secondary-item {
  display: flex;
  align-items: center;
  /* Keep the thumb target at 44px even though the text is small. */
  min-height: 44px;
  padding: 4px 0;
  color: var(--teal-deep);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.secondary-item::after {
  content: " \2192";
  display: inline-block;
  transition: transform 140ms ease;
}

.secondary-item:hover::after { transform: translateX(4px); }

.preview-flag {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: #FFF4D6;
  border: 1.5px solid #E8C55C;
  border-radius: var(--radius);
  color: #6B5312;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---------- Resume ---------- */

.resume {
  margin-bottom: 22px;
  padding: 16px 18px;
  background: var(--teal-tint);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.resume-actions { display: flex; gap: 16px; margin-top: 12px; }

/* ---------- Errors ---------- */

.error {
  margin-top: 14px;
  color: #B4453A;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---------- Foot ---------- */

.foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 30px 20px 46px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.foot-note {
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ---------- Wide ---------- */

@media (min-width: 720px) {
  body { padding-top: 60px; }
  .bar { height: 60px; padding: 0 32px; }
  .bar-title { display: block; }
  .progress { top: 60px; }
  .stage { padding: 52px 32px 60px; }
  .q-title { font-size: 1.875rem; }
  .intro-title { font-size: 2.75rem; }
  .reveal-tag { padding: 30px; }
  .reveal-tag-role { font-size: 2.25rem; }
  .card { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
  .progress-fill,
  .bar-value,
  .opt,
  .secondary-item::after { transition: none; }
}
