/* Minimal stylesheet for the anonymous submission form. */

:root {
  --unm-cherry: #ba0c2f;
  --unm-turquoise: #007a86;
  --ink: #1c1c1e;
  --muted: #5c5c66;
  --line: #d5d5dd;
  --bg: #f6f6f8;
  --surface: #ffffff;
  --error-bg: #fdf0f2;
  --error-line: #ba0c2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.site-header {
  background: var(--unm-cherry);
  color: #fff;
  padding: 1rem 1.5rem;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
}

h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

.lede {
  color: var(--muted);
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.help {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--unm-turquoise);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
}

.req {
  color: var(--unm-cherry);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  margin: 0 0 1.25rem;
}

legend {
  font-weight: 600;
  padding: 0 0.4rem;
}

label.checkbox {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

label.checkbox input {
  width: auto;
}

/* One participant: the name, then the contact details in their own box, then
   Remove. Stacked rather than one wide row, because the contact fields are a
   labelled group and not three more columns. */
.participant-row {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--line);
}

.participant-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.participant-contact {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem;
}

.participant-contact-heading {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.participant-contact-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.participant-row .field {
  margin-bottom: 0;
}

.participant-row label {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
}

.participant-row .remove-row {
  margin-top: 0.75rem;
}

/* The in-browser participant check writes here; it is hidden until it has
   something to say. Styled like .errors so a client-side rejection and a
   server-side one do not look like different kinds of problem. */
.field-error {
  background: var(--error-bg);
  border-left: 4px solid var(--error-line);
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  border-radius: 4px;
}

.field-error ul {
  margin: 0;
  padding-left: 1.2rem;
}

button {
  font: inherit;
  cursor: pointer;
}

.button,
button[type="submit"] {
  display: inline-block;
  background: var(--unm-cherry);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
}

.secondary,
.remove-row {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem 0.8rem;
  color: var(--ink);
}

.errors {
  background: var(--error-bg);
  border-left: 4px solid var(--error-line);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 4px;
}

.errors ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

/* Off-screen rather than display:none -- some bots skip hidden inputs. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.reference code {
  font-size: 1.1rem;
  background: var(--bg);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.25rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 40rem) {
  .participant-names,
  .participant-contact-fields {
    grid-template-columns: 1fr;
  }
}

/* Sign-in and change-password are short forms; the submission form's width
   makes them look stranded. */
.card-narrow {
  max-width: 26rem;
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
}

.session {
  font-size: 0.85rem;
}

.session a {
  color: #fff;
  margin-left: 0.75rem;
  /* Otherwise a narrow header breaks it into "Sign" / "out". */
  white-space: nowrap;
}

.flashes {
  background: var(--surface);
  border-left: 4px solid var(--unm-cherry);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 4px;
}

.flashes p {
  margin: 0;
}

.stat {
  margin: 1.25rem 0;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--unm-cherry);
  line-height: 1.1;
}
