/* ==========================================================================
   M.CT.M MUN 2026 — forms, tables and notices.

   The original stylesheet had no form controls in it at all: it was built
   entirely around editorial layout, and a brochure site never needed an
   input. Everything here is new, and everything here borrows the same
   vocabulary — sharp corners, ink hairlines, one green, Libre Baskerville
   for prose and Playfair for anything that behaves like a heading.

   Loaded only on the pages that need it (register, pay, thanks, admin), so
   the six content pages carry no extra bytes.
   ========================================================================== */

.wrap--form { max-width: 960px; }

/* ------------------------------------------------------------- notices --- */
.flash {
  border-top: 3px solid var(--green-deep);
  border-bottom: 1px solid var(--paper-lo);
  background: var(--green-tint);
  padding-block: 0.9rem;
  font-size: 0.85rem;
}

.notice {
  border: 1px solid var(--ink);
  border-left-width: 5px;
  background: var(--paper-hi);
  padding: 1.1rem 1.3rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
  font-size: 0.88rem;
}
.notice > * + * { margin-top: 0.6rem; }
.notice ul { margin-top: 0.5rem; padding-left: 1.1rem; list-style: disc; }
.notice li { margin-top: 0.25rem; }
.notice--bad  { border-left-color: #8c2f22; }
.notice--good { border-left-color: var(--green); background: var(--green-tint); }
.notice--info { border-left-color: var(--ink-soft); }

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-family: var(--f-body);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill--good { color: var(--green-deep); background: var(--green-tint); }
.pill--wait { color: #6b4a12; background: #f3ecdc; }
.pill--off  { color: var(--ink-faint); background: transparent; }

.muted { color: var(--ink-faint); }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; }
.req, .field__label em, .sect__lede em.req { color: var(--green); font-style: normal; }

/* ---------------------------------------------------------------- form --- */
.form { margin-top: clamp(1.5rem, 3vw, 2.2rem); }

.fset {
  border: 0;
  border-top: 1px solid var(--ink);
  padding: 1.6rem 0 0;
  margin: 0 0 clamp(2rem, 4vw, 3rem);
}
.fset.is-bad { border-top-color: #8c2f22; }

.fset legend {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  padding-right: 0.8rem;
}
.fset__note { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 1.3rem; max-width: 62ch; }
.fset__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.4rem; }
.fset__count { font-size: 0.78rem; color: var(--ink-faint); }

.grid2, .grid3 { display: grid; gap: 1.1rem 1.4rem; }
.grid2 { grid-template-columns: 2fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }

.field { display: block; margin-bottom: 1.1rem; }
.field--tight { margin-bottom: 0; }

.field__label {
  display: block;
  font-family: var(--f-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--f-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-hi);
  border: 1px solid var(--paper-lo);
  border-radius: 0;                    /* newspapers have no rounded corners */
  transition: border-color 0.25s, background-color 0.25s;
}
.field textarea { resize: vertical; min-height: 5.5rem; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-faint); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-color: var(--green);
  background: #fff;
}

.field input::placeholder,
.field textarea::placeholder { color: #9a958a; }

.field.is-bad input,
.field.is-bad select,
.field.is-bad textarea { border-color: #8c2f22; background: #fbf4f2; }

/* native select arrow left alone: a hand-drawn one is one more thing to
   keep in step with the theme, and this one is already sharp-cornered */
.field select { appearance: auto; }

/* ------------------------------------------------------ delegate rows --- */
.drow {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--paper-lo);
}
.drow:first-child { border-top: 0; padding-top: 0; }

.drow__n {
  font-family: var(--f-punch);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--paper-lo);
  padding-top: 1.15rem;
}
.drow__in { display: grid; gap: 1.1rem; }

/* ------------------------------------------------------------ checkbox --- */
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  font-size: 0.86rem;
  line-height: 1.6;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--paper-lo);
  background: var(--paper-hi);
}
.check.is-bad { border-color: #8c2f22; background: #fbf4f2; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: 0.28rem; accent-color: var(--green); }
.check a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; }

/* honeypot: present for a bot, gone for everyone else */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit { margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.form__note { font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.8rem; }

/* --------------------------------------------------------- pay summary --- */
.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-block: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.summary__facts { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary__facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}
.summary__facts dd { font-size: 0.92rem; line-height: 1.5; }
.summary__total { text-align: right; }
.summary__total .fee__amt { color: var(--green-deep); }

.paybox {
  border: 1px solid var(--ink);
  background: var(--paper-hi);
  padding: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.paybox > p { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.paybox__title { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 0.8rem; }

/* -------------------------------------------------------------- tables --- */
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 1.2rem;
}
.dtable th,
.dtable td {
  text-align: left;
  padding: 0.7rem 0.8rem 0.7rem 0;
  border-bottom: 1px solid var(--paper-lo);
  vertical-align: top;
}
.dtable thead th {
  font-family: var(--f-body);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.dtable tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable .num.is-full { color: #8c2f22; }
.dtable a { color: var(--green-deep); }

/* A table is the one thing here that legitimately outgrows the column. */
.dtable--wide { display: block; overflow-x: auto; white-space: nowrap; }
.dtable--wide td, .dtable--wide th { white-space: normal; }

.bar { display: block; width: 100%; min-width: 90px; height: 6px; background: var(--paper-lo); }
.bar__fill { display: block; height: 100%; background: var(--green); }

/* --------------------------------------------------------------- prose --- */
.prose > * + * { margin-top: 1.2rem; }
.prose h2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--paper-lo);
}
.prose p, .prose li { font-size: 0.9rem; color: var(--ink-soft); max-width: 70ch; }
.prose ul { list-style: disc; padding-left: 1.2rem; }
.prose li + li { margin-top: 0.4rem; }
.prose b { color: var(--ink); }
.prose__flag {
  border-left: 5px solid var(--green);
  background: var(--green-tint);
  padding: 1rem 1.2rem;
  font-size: 0.86rem !important;
  color: var(--ink) !important;
}

.foot__legal { margin-top: 0.45rem; }
.foot__legal a { text-decoration: underline; text-underline-offset: 2px; }

/* the dev badge, only rendered when config debug is on */
.devbadge {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 90;
  margin: 0;
  padding: 0.3rem 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--paper-hi);
  background: var(--green-deep);
  pointer-events: none;
}

/* ---------------------------------------------------------- responsive --- */
@media (max-width: 860px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .summary__total { text-align: left; }
}

@media (max-width: 560px) {
  .drow { grid-template-columns: 1fr; }
  .drow__n { padding-top: 0; font-size: 1.1rem; }
  .summary__facts { grid-template-columns: 1fr; }
}
