/* Sign-in and admin pages: the Day theme, like the home page. */
body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
header,
main,
footer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 24px;
}
header img {
  width: 260px;
  height: auto;
}
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 24px;
  font-weight: 700;
  font-size: 1.05rem;
}
nav a {
  white-space: nowrap;
}
nav a[aria-current="page"] {
  text-decoration-color: var(--qm-gold);
  text-decoration-thickness: 5px;
}
nav a,
.link {
  color: var(--ink);
  text-decoration-color: var(--qm-orange);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  font-weight: 700;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  text-decoration-line: underline;
  font-size: inherit;
}
main {
  padding-bottom: 40px;
}
footer {
  padding-bottom: 32px;
  color: var(--ink-muted);
}
.card {
  max-width: 34rem;
  margin: 0 auto;
  padding: 36px 36px 32px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  display: grid;
  gap: 20px;
}
.card h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
}
.card p {
  margin: 0;
  font-size: 1.1rem;
}
.muted {
  color: var(--ink-muted);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}
.tabs button {
  border: 0;
  border-radius: 12px;
  padding: 12px 8px 10px;
  background: transparent;
  font: 800 1.15rem/1 var(--font-display);
}
.tabs button[aria-selected="true"] {
  background: var(--qm-indigo);
  color: var(--qm-cream);
}
form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 1.05rem;
}
.field small {
  font-weight: 400;
  color: var(--ink-muted);
}
.field input {
  min-height: var(--tap-min);
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 2px solid var(--line);
  background: var(--qm-cream);
  color: var(--qm-indigo);
  font-size: 1.1rem;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--qm-indigo);
  box-shadow:
    0 0 0 3px var(--qm-cream),
    0 0 0 6px var(--focus-ring);
}
/* Full-width buttons only in the sign-in card and stacked forms; elsewhere a button is its own width. */
.card .qm-btn,
.card form .qm-btn {
  width: 100%;
}
.google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  border-radius: var(--radius-control);
  border: 2px solid var(--qm-indigo);
  background: #fff;
  color: var(--qm-indigo);
  font-weight: 700;
  font-size: 1.1rem;
}
.google svg {
  width: 22px;
  height: 22px;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-weight: 700;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--surface-raised);
}
.message {
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  font-weight: 700;
}
.message.is-error {
  background: var(--qm-earth);
  color: var(--qm-cream);
}
.status {
  display: inline-block;
  padding: 4px 12px 3px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
}
.status--pending {
  background: var(--qm-gold);
  color: var(--qm-indigo);
}
.status--active {
  background: var(--qm-forest);
  color: var(--qm-cream);
}
.status--disabled {
  background: var(--qm-earth);
  color: var(--qm-cream);
}
.hosts {
  max-width: 60rem;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.hosts h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
}
.host {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.host h2 {
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}
.host p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.host .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.host .qm-btn {
  width: auto;
  font-size: 18px;
  padding: 14px 20px 12px;
}
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  header nav {
    justify-content: flex-start;
    gap: 8px 18px;
    font-size: 1rem;
  }
  .card {
    padding: 28px 20px 24px;
  }
  .host {
    grid-template-columns: 1fr;
  }
  .host .actions {
    justify-content: flex-start;
  }
}
/* Admin: Stats (anonymous counts) */
.stats {
  max-width: 60rem;
  margin: 0 auto 40px;
  display: grid;
  gap: 16px;
}
.stats h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
}
.stats h2 {
  font-size: 1.5rem;
  margin-top: 8px;
}
.periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.periods button {
  font: inherit;
  font-weight: 700;
  padding: 10px 16px 8px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.periods button[aria-pressed="true"] {
  background: var(--qm-indigo);
  border-color: var(--qm-indigo);
  color: var(--qm-cream);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 12px;
}
.tile {
  padding: 16px 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.tile strong {
  display: block;
  font-family: var(--font-display, inherit);
  font-size: 2.4rem;
  line-height: 1.1;
}
.tile span {
  color: var(--ink-muted);
  font-weight: 700;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.stat-table th,
.stat-table td {
  padding: 10px 16px;
  text-align: right;
  border-bottom: 2px solid var(--surface-raised);
}
.stat-table th:first-child,
.stat-table td:first-child {
  text-align: left;
}
.stat-table tr:last-child td {
  border-bottom: 0;
}
.stat-table .bar {
  display: block;
  height: 10px;
  margin-top: 6px;
  border-radius: 5px;
  background: var(--qm-orange);
}
/* Privacy and terms */
.card.prose {
  max-width: 46rem;
  gap: 14px;
}
.prose h2 {
  font-size: 1.6rem;
  margin-top: 10px;
}
.prose ul {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 8px;
  font-size: 1.1rem;
}
footer .link {
  color: var(--ink-muted);
}

/* Cloudflare Turnstile, the bot check on the forms that send an email (src/client/shared/turnstile.ts). */
.turnstile {
  margin: 12px 0;
  min-height: 65px;
}
.turnstile[hidden] {
  display: none;
}

/* /admin: enrolling a school (Thompson, 18 Nov 2026). */
.enrol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 12px;
  align-items: end;
  padding: 20px 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.enrol select {
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 2px solid var(--line);
  background: var(--qm-cream);
  color: var(--qm-indigo);
  font: 400 1.1rem/1.35 var(--font-text);
}

/* Plans and prices (/plans, /schools; Thompson, 18 Nov 2026). */
.wide {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}
.wide .card.prose {
  max-width: none;
  margin: 0;
}
.lead {
  font-size: 1.25rem;
}
.badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--radius-control);
  background: var(--qm-gold);
  color: var(--qm-indigo);
  font-weight: 700;
  font-size: 0.95rem;
  vertical-align: middle;
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 16px;
}
.plan {
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
}
.plan.is-current {
  outline: 4px solid var(--qm-orange);
  outline-offset: -4px;
}
/* The plan a locked feature on the start page points at (/plans?for=…). */
.plan.is-recommended {
  position: relative;
  outline: 4px solid var(--qm-gold);
  outline-offset: -4px;
}
.plan.is-recommended::after {
  content: "Lowest price for this";
  position: absolute;
  top: -14px;
  right: 18px;
  padding: 5px 12px 3px;
  border-radius: var(--radius-pill);
  background: var(--qm-gold);
  color: var(--qm-indigo);
  font-weight: 700;
  font-size: 0.9rem;
}
.your-plan .recommend {
  padding: 14px 18px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}
.plan h3 {
  font-size: 1.5rem;
  margin: 0;
}
.plan .for {
  margin: 0;
  color: var(--ink-muted);
}
.plan .price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  margin: 0;
}
.plan .price small {
  font-size: 1.05rem;
  color: var(--ink-muted);
}
.plan ul {
  font-size: 1rem;
  margin: 0;
  align-content: start;
}
.plan .buy {
  display: grid;
  gap: 8px;
}
.plan .buy .qm-btn {
  /* A link (signed out) is inline otherwise, and its padding spilled over the note below. */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  white-space: nowrap;
}
/*
 * Line the cards up with each other (Thompson, 18 Nov 2026): each card's name, who it's for, price,
 * list and buy button share rows across the row of cards, so every button starts at the same height
 * however long the text above it is. Older browsers keep each card's own rows.
 */
.plan .buy-extra,
.plan .buy-note {
  display: grid;
  gap: 8px;
}
.plan .buy-extra:empty,
.plan .buy-action:empty,
.plan .buy-note:empty {
  display: none;
}
@supports (grid-template-rows: subgrid) {
  .plan {
    grid-row: span 7;
    grid-template-rows: subgrid;
    row-gap: 10px;
  }
  .plan .buy {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 10px;
  }
  /* Keep the empty rows, so each card's button sits in the same row. */
  .plan .buy-extra:empty,
  .plan .buy-action:empty,
  .plan .buy-note:empty {
    display: block;
  }
}
.plan .buy p {
  margin: 0;
  font-size: 0.95rem;
}
.plan .buy input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 2px solid var(--line);
  background: var(--qm-cream);
  color: var(--qm-indigo);
  font: 400 1.05rem/1.35 var(--font-text);
}
.your-plan {
  display: grid;
  gap: 8px;
}
.your-plan[hidden] {
  display: none;
}
.your-plan p {
  margin: 0;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.cta .qm-btn {
  width: auto;
  padding-left: 32px;
  padding-right: 32px;
}
.faq dt {
  font-weight: 700;
  margin-top: 14px;
}
.faq dd {
  margin: 4px 0 0;
}
.muted.small {
  font-size: 0.95rem;
  margin: 4px 0 0;
}
/* /connect (milestone 53): the one-time code for PowerPoint, big enough to read across a desk. */
.card .connect-code {
  font: 800 clamp(2.4rem, 8vw, 3.6rem) / 1 var(--font-display);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 18px 12px 12px;
  border-radius: var(--radius-card);
  background: var(--qm-gold);
  color: var(--qm-indigo);
}

/* View as (milestone 60): the switcher card on /admin. */
.view-as-card {
  margin-bottom: 40px;
}

/* A card's row of actions: the main one first, the rest small, Delete quiet at the end. */
.actions .qm-btn--quiet:last-child {
  margin-left: auto;
}
@media (max-width: 600px) {
  .actions .qm-btn--quiet:last-child {
    margin-left: 0;
  }
}
