/*
 * /proposer — the organisers' form, set like the rest of the letter: each
 * part opens on an italic heading under a fold, labels in the reading face,
 * hints in muted italics, errors in rust beside the field they concern and
 * gathered once at the top.
 */

.proposal-form {
  display: grid;
  gap: var(--space-10);
}

/* The prose page's paragraph rhythm (p + p) does not apply inside a field. */
.proposal-form .proposal-field > p {
  margin: 0;
}

/* ==========================================
 * ERROR SUMMARY
 * ========================================== */

.proposal-errors {
  padding: var(--space-4) var(--space-5);
  border-left: var(--border-width-2) solid var(--negative);
  background: var(--negative-bg);
}

.proposal-errors .proposal-errors-title {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-xl);
  font-style: italic;
}

.proposal-errors .proposal-errors-list {
  margin: 0;
  padding-left: 1.25em;
}

.proposal-errors a {
  color: var(--negative-strong);
  text-decoration-color: currentColor;
}
.proposal-errors a:hover { color: var(--ink); }

/* ==========================================
 * PARTS AND FIELDS
 * ========================================== */

.proposal-fieldset {
  display: grid;
  gap: var(--space-6);
  min-inline-size: 0;
  margin: 0;
  padding: var(--space-6) 0 0;
  border: 0;
  border-top: var(--border-width-1) solid var(--line);
}

/* Floated, the legend becomes an ordinary grid item: it sits under the fold
   instead of breaking it, and takes the fieldset's gap. */
.proposal-legend {
  float: left;
  inline-size: 100%;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-style: italic;
  line-height: var(--line-height-snug);
  color: var(--ink);
}

.proposal-field {
  display: grid;
  gap: var(--space-2);
  align-content: end;
  min-inline-size: 0;
}

.proposal-label {
  font-size: var(--cj-small);
  line-height: var(--line-height-snug);
  color: var(--ink-secondary);
}

.proposal-optional {
  font-style: italic;
  color: var(--ink-muted);
}

.proposal-hint {
  font-size: var(--font-size-sm);
  font-style: italic;
  line-height: var(--line-height-snug);
  color: var(--ink-muted);
}

.proposal-error {
  font-size: var(--cj-small);
  line-height: var(--line-height-snug);
  color: var(--negative);
}

.proposal-input {
  min-height: var(--space-12);
  font-size: var(--font-size-base);
}

.proposal-field-invalid .proposal-input {
  border-color: var(--negative);
}

.proposal-textarea {
  min-height: 12rem;
  line-height: var(--line-height-relaxed);
}

/* Fields side by side where the column allows, their inputs on one line
   whatever their labels and hints wrap to. */
.proposal-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-6) var(--space-4);
  align-items: end;
}

.proposal-row-dates {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
}

/* ==========================================
 * SENDING
 * ========================================== */

.proposal-note {
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.proposal-button {
  justify-self: start;
  min-height: var(--space-12);
  padding-inline: var(--space-8);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.prose-body .proposal-next {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-8);
}

.proposal-next span { color: var(--ink-faint); }

@media (max-width: 30em) {
  .proposal-button { justify-self: stretch; }
}
