/* app/static/styles/contribute.css
 *
 * Hava — /contribute form (BUILD.md step 1.5).
 * Restyle of the existing form to match the new design system. Tokens mirror
 * home.css; eventual move to a shared `_tokens.css` is fine but not required
 * for this step.
 *
 * No form behavior changes — preserves all field IDs/names so the existing
 * route handler validates the same payload.
 */

:root {
  --bg: #f7f5ef;
  --bg-2: #f1eee5;
  --paper: #ffffff;

  --ink: #14140f;
  --ink-2: #4a4a44;
  --ink-3: #6e6e67;
  --ink-4: #a8a89f;

  --rule: rgba(20, 20, 15, 0.10);
  --rule-soft: rgba(20, 20, 15, 0.06);
  --rule-hair: rgba(20, 20, 15, 0.04);

  --accent-soft: rgba(14, 110, 124, 0.08);
  --accent: #0e6e7c;
  --accent-deep: #064551;

  --warm: #b8623d;
  --warm-soft: rgba(184, 98, 61, 0.10);

  --ok: #5a8a4f;
  --ok-soft: rgba(90, 138, 79, 0.10);
  --err: #b03a3a;
  --err-soft: rgba(176, 58, 58, 0.08);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --serif: "Fraunces", "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv01", "cv11";
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* ─────────── topbar (matches /home) ─────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 28px;
}
.wordmark {
  display: flex; align-items: center; gap: 11px;
  font-weight: 500; font-size: 17px; letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1797a8 0%, #0e6e7c 55%, #064551 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.topbar-meta {
  font-size: 13px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 14px;
}
.topbar-meta a { color: var(--ink-2); }
.topbar-meta a:hover { color: var(--ink); }

/* ─────────── header ─────────── */
.head {
  text-align: center;
  padding: 12px 0 28px;
}
.head .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 14px;
}
.head h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 300;
  margin: 0 0 14px;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.head h1 em { font-style: italic; color: var(--accent-deep); }
.head .lede {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 520px;
  letter-spacing: -0.005em;
}

/* ─────────── banners ─────────── */
.banner {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.banner.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: rgba(90, 138, 79, 0.20);
}
.banner.err {
  background: var(--err-soft);
  color: var(--err);
  border-color: rgba(176, 58, 58, 0.20);
}
.err-list {
  margin: 0;
  padding-left: 18px;
}
.err-list li {
  margin: 4px 0;
}

/* ─────────── form card ─────────── */
.form-card {
  background: var(--paper);
  border: 1px solid var(--rule-hair);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 1px 2px rgba(20, 20, 15, 0.03), 0 12px 28px -20px rgba(20, 20, 15, 0.10);
}

label {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 18px 0 6px;
}
label:first-child { margin-top: 0; }

/* The entity-type radio group is a real <fieldset>/<legend> (a11y: one
 * programmatic group name for the four radios). Reset chrome so it renders
 * exactly like the bare <label> heading it replaced. */
.type-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.type-fieldset legend {
  display: block;
  width: 100%;
  padding: 0;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
}

/* Keyboard skip link: visually hidden until focused (same contract as the
 * desert shell's .d-skip). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-1, #14140f);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* Required-field marker. The asterisk sits in the field label so the two
 * required inputs (Name always; URL when Business/Program is selected) read as
 * required without a separate legend. `.req.is-optional` is toggled off by the
 * entity-type JS for Tip/Event, where the URL is not required. */
.req {
  color: var(--err);
  font-weight: 600;
  margin-left: 2px;
}
.req[hidden] { display: none; }
.req-legend {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
/* Small muted helper line under a field (e.g. the email privacy note). */
.field-note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
/* Reassurance line under the submit button: review turnaround. */
.review-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: -0.005em;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.5;
}

.row-radio {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.row-radio label {
  font-weight: 400;
  font-size: 14px;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.row-radio label:hover { border-color: rgba(20, 20, 15, 0.22); background: var(--bg-2); }
.row-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s ease;
}
.row-radio input[type="radio"]:checked {
  border-color: var(--accent);
  border-width: 4px;
}
.row-radio label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

#event-fields {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-hair);
}

button.submit {
  margin-top: 24px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15.5px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: -0.005em;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}
button.submit:hover { background: var(--accent); }
button.submit:active { transform: scale(0.98); }

/* ─────────── footer ─────────── */
.foot {
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-3);
  text-align: center;
}
.foot a {
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.foot a:hover { color: var(--accent); }

/* ─────────── desktop progressive enhancement ─────────── */
@media (min-width: 720px) {
  .page { padding: 24px 36px 80px; }
  .topbar { padding-bottom: 36px; }
  .head { padding: 24px 0 40px; }
  .head .lede { font-size: 17px; }
  .form-card { padding: 32px 32px; }
  label { margin: 22px 0 8px; }
  input[type="text"],
  input[type="url"],
  input[type="email"],
  input[type="date"],
  input[type="time"],
  textarea,
  select {
    font-size: 16px;
    padding: 13px 16px;
  }
}
