/*
 * The join page's layout: one column, phone first, every colour a --gt-* token from brand.css.
 *
 * Why: most students open this from a school's website on a phone, so taps must be at least 44px,
 * labels sit above their inputs and nothing scrolls sideways at 360px. Colours are never typed
 * here (a node test checks), so the page follows the Parlay brand file, dark mode included.
 */

* { box-sizing: border-box; }

/* Native controls (date picker icon, unticked boxes) follow the brand file's dark mode too. */
:root { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--gt-screen);
  color: var(--gt-text);
  font-family: var(--gt-font);
  font-size: 17px;
  line-height: 1.4;
}

main { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

/* The deep violet band: the school's name and Virginia's welcome, with a marigold edge under it. */
.band { background: var(--gt-band); color: var(--gt-on-band); border-bottom: 6px solid var(--gt-accent); }
.band-inner { max-width: 560px; margin: 0 auto; padding: 28px 20px 26px; }
.band p { margin: 0 0 10px; font-size: 16px; }
.band p:last-child { margin-bottom: 0; }
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gt-accent);
  color: var(--gt-on-accent);
  font-size: 13px;
  font-weight: 700;
}
h1 { font-size: 30px; font-weight: 800; line-height: 1.15; margin: 14px 0 8px; }
.band .welcome { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.band .lead { font-weight: 600; }

/* Three steps: where this form sits in joining. The first is filled, the next two outlined. */
.steps { list-style: none; display: flex; gap: 8px; margin: 18px 0 4px; padding: 0; counter-reset: step; }
.steps li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--gt-primary-soft);
  border: 2px solid var(--gt-band);
  color: var(--gt-text);
}
.steps li.now::before { background: var(--gt-accent); border-color: var(--gt-accent); color: var(--gt-on-accent); }

.note { margin: 12px 4px 0; font-size: 14px; color: var(--gt-text-secondary); }
.optional { font-weight: 400; color: var(--gt-text-secondary); }

/* One card per group of questions, a violet top edge and a marigold mark beside its title. */
.card {
  margin: 16px 0 0;
  padding: 18px 16px 4px;
  background: var(--gt-card);
  border: var(--gt-card-edge-width) solid var(--gt-card-edge);
  border-top: 4px solid var(--gt-band);
  border-radius: 16px;
}
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 18px; font-weight: 800; }
.card h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--gt-accent); }

.question {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}

div.question > label, legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }

.req { color: var(--gt-accent-text); }

input:not([type=radio]):not([type=checkbox]) {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  color: var(--gt-text);
  background: var(--gt-card);
  border: var(--gt-card-edge-width) solid var(--gt-card-edge);
  border-radius: 10px;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--gt-card);
  border: var(--gt-card-edge-width) solid var(--gt-card-edge);
  border-radius: 10px;
}

fieldset label:has(input:checked) {
  background: var(--gt-accent-soft);
  border: 2px solid var(--gt-accent-edge);
  font-weight: 600;
}

/* Class type as pills: three short choices side by side, the picked one filled marigold. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills legend { width: 100%; }
.pills label { border-radius: 999px; border-width: 2px; padding: 8px 18px; margin: 0; font-weight: 600; }
.pills label:has(input:checked) { background: var(--gt-accent); border-color: var(--gt-accent); color: var(--gt-on-accent); }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }

input[type=radio], input[type=checkbox] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--gt-accent-edge);
}

input:focus-visible, fieldset label:has(input:focus-visible) {
  outline: 2px solid var(--gt-primary);
  outline-offset: 2px;
}

div.invalid > label, .invalid > legend { color: var(--gt-wrong-answer); }
.invalid input:not([type=radio]):not([type=checkbox]), .invalid label { border-color: var(--gt-wrong-answer); }

/* Off screen rather than display:none, which some bots know to skip. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

button {
  width: 100%;
  margin-top: 20px;
  font: inherit;
  min-height: 56px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gt-on-accent);
  background: var(--gt-accent);
  border: 0;
  border-radius: 14px;
}

button:active { background: var(--gt-accent-edge); }
button:disabled { opacity: 0.6; }

#status { margin: 16px 0 0; font-weight: 700; color: var(--gt-wrong-answer); }
#status:empty { display: none; }

.thanks { margin-top: 24px; border-radius: 20px; overflow: hidden; border: var(--gt-card-edge-width) solid var(--gt-card-edge); }
.thanks:focus { outline: none; }
.thanks-band {
  padding: 28px 20px;
  background: var(--gt-band);
  color: var(--gt-on-band);
  border-bottom: 6px solid var(--gt-accent);
  text-align: center;
}
.check {
  width: 64px;
  height: 64px;
  padding: 16px;
  border-radius: 50%;
  background: var(--gt-accent);
  fill: none;
  stroke: var(--gt-on-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks h2 { margin: 14px 0 8px; font-size: 26px; font-weight: 800; }
.thanks-band p { margin: 0 0 4px; }
.thanks-band .thanks-first { font-size: 18px; font-weight: 800; }
.thanks ul { display: inline-flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding-left: 20px; text-align: left; }
.thanks-school { margin: 0; padding: 16px 20px; text-align: center; font-weight: 700; background: var(--gt-primary-soft); }

.powered { margin: 16px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--gt-text-secondary); }

/* Dark mode: the deep violet edges vanish on a dark screen, so steps and card tops take the card edge. */
@media (prefers-color-scheme: dark) {
  .steps li::before { border-color: var(--gt-card-edge); }
  .card { border-top-color: var(--gt-card-edge); }
}
