:root {
  --paper: #eaf0ec;
  --sheet: #ffffff;
  --ink: #17262e;
  --muted: #52646b;
  --rule: #798d87;
  --rule-soft: #c6d3ce;
  --green: #1d5a41;
  --green-deep: #154532;
  --tint: #e0eee6;
  --error: #a8231b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", "Source Sans Pro", sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.5 var(--sans);
}

/* visually hidden, still read by screen readers and still focusable */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3,
legend {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

/* ---------- masthead ---------- */
.masthead,
main {
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem 1.25rem;
}

/* logo + wordmark travel together when the masthead wraps */
.brand {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
}

/* the source file is 200px wide, so cap the display size at half that to stay
   sharp on 2x screens. height:auto keeps the ratio if the file is ever replaced. */
.logo {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}

.masthead h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  letter-spacing: -0.01em;
}

.masthead p {
  margin: .35rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

main {
  padding-bottom: 3rem;
}

.notice {
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  padding: .75rem 1rem;
  border-radius: 6px;
}

/* ---------- the sheet ---------- */
.sheet {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
}

.sheet h2 {
  font-size: 1.3rem;
}

.hint {
  margin: .2rem 0 1rem;
  color: var(--muted);
  font-size: .95rem;
}

/* fields are writing lines; the label sits under the line, as on the paper form */
.field {
  display: flex;
  flex-direction: column-reverse;
}

.field>label,
.field>.label {
  color: var(--muted);
  font-size: .9rem;
  padding: .3rem .25rem 0;
}

input[type="text"],
input[type="tel"],
input[type="date"] {
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .25rem .3rem;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  outline: 2px solid transparent;
  /* becomes visible in forced-colors mode */
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder {
  color: #8797a0;
  opacity: 1;
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: .5rem;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus {
  background: var(--tint);
  border-bottom-color: var(--green);
  box-shadow: 0 1.5px 0 var(--green);
}

.who-grid {
  display: grid;
  gap: 1.5rem 2.5rem;
}

/* lunch: two options; the chosen one is circled, like the hand-drawn oval on the printed sheet */
.choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
}

.choice {
  display: inline-flex;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.choice span:hover {
  background: var(--tint);
}

.choice input:checked+span {
  border-color: var(--green);
  background: var(--tint);
  color: var(--green-deep);
}

.choice input:focus-visible+span {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.text-button {
  min-height: 2.75rem;
  padding: 0 .6rem;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.text-button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.text-button[hidden] {
  display: none;
}

.numbered {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  align-items: end;
}

.numbered label {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-bottom: .4rem;
}

.course-list {
  display: grid;
  column-gap: 2.5rem;
}

.team-grid {
  display: grid;
  gap: 2rem 2.5rem;
}

.team {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.team legend {
  float: left;
  width: 100%;
  padding: 0 0 .15rem;
  font-size: 1.05rem;
}

.team legend+* {
  clear: both;
}

@media (min-width: 40rem) {
  .who-grid {
    grid-template-columns: 1fr 1fr;
  }

  .course-list {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: column;
    grid-template-rows: repeat(4, auto);
  }

  .team-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 58rem) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- actions ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .55rem 1.2rem;
  border-radius: 4px;
  border: 1.5px solid var(--green);
  font: 600 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: #fff;
}

.button.primary:hover {
  background: var(--green-deep);
}

.button.quiet {
  background: transparent;
  color: var(--green);
}

.button.quiet:hover {
  background: var(--tint);
}

.button:focus-visible,
#file:focus-visible+label,
summary:focus-visible,
.check input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.button[disabled] {
  opacity: .65;
  cursor: progress;
}

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.25rem;
  margin: 1.25rem -1.25rem 0;
  padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--rule-soft);
}

#status {
  margin: 0;
  flex: 1 1 16rem;
  min-height: 1.5rem;
  white-space: pre-line;
}

#status[data-kind="ok"] {
  color: var(--green);
}

#status[data-kind="error"] {
  color: var(--error);
  font-weight: 600;
}

/* ---------- extras ---------- */
.extras {
  margin-top: 1.5rem;
  background: var(--sheet);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
}

.extras summary {
  padding: .9rem 1.25rem;
  font: 600 1.05rem var(--serif);
  cursor: pointer;
}

.extras-block {
  padding: 1.1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

.extras-block h3 {
  font-size: 1.05rem;
  margin-bottom: .25rem;
}

.extras-block p {
  margin: .25rem 0 .9rem;
  color: var(--muted);
  font-size: .95rem;
  max-width: 42rem;
}

.extras-block .check+p {
  margin-top: .5rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--green);
  margin: 0;
}

.invisible {
  opacity: 0;
}

#dropzone.drag {
  background: var(--tint);
  outline: 2px dashed var(--green);
  outline-offset: -6px;
}

@media (max-width: 36rem) {
  /* beside a heading that wraps to three lines the logo just squeezes the text,
     so stack it on narrow screens */
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
  }

  .logo {
    width: 84px;
  }

  .masthead .button {
    width: 100%;
  }

  .actionbar .primary {
    width: 100%;
  }
}