/* PyPath — the everyday student pages: sign in, sign up, My progress, Account,
   a set quiz, a unit test, settings.

   Loaded LAST on each of those pages, after the theme and the page's own
   sheet, so it refines what is there rather than competing with it (the two
   cascade traps in CLAUDE.md were both a correct rule loaded too early). Every
   selector is scoped to a page's body class, so nothing here can reach a
   lesson, the home page or the teacher dashboard.

   Same palette and type as the rest of the site, more refined: one strong
   ink surface per page at most, white cards with generous space, larger and
   rounder controls, and the pill buttons the teacher dashboard uses. */

:root {
  --app-ink: #0c4566;
  --app-ink-deep: #0a3a57;
  --app-sky: #0ea5e9;
  --app-radius: 1.25rem;
}

/* ------------------------------------------------------------ shared */

.page-auth main,
.page-progress main,
.page-quiz main,
.page-unit-test main,
.page-settings main {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.page-auth main h1,
.page-progress main h1,
.page-quiz main h1,
.page-unit-test main h1,
.page-settings main h1 {
  margin: 0 0 1.25rem;
  font-family: var(--pp-display, inherit);
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--pp-ink, var(--app-ink));
}

/* Inputs: taller, rounder, with a clear focus ring. */
.page-auth .auth-form input:not([type='checkbox']):not([type='radio']),
.page-auth .auth-form select,
.page-auth #school-access input {
  min-height: 3rem;
  padding: .7rem .95rem;
  border: 1.5px solid var(--border, #d0e4ef);
  border-radius: .8rem;
  background: var(--panel, #ffffff);
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.page-auth .auth-form input:not([type='checkbox']):not([type='radio']):focus-visible,
.page-auth .auth-form select:focus-visible,
.page-auth #school-access input:focus-visible {
  outline: none;
  border-color: var(--app-sky);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-sky) 22%, transparent);
}
.page-auth .auth-form label { margin-top: .35rem; font-size: .92rem; font-weight: 700; }

/* Buttons: pills, a comfortable height, one weight. */
.page-auth main .btn,
.page-progress main .btn,
.page-quiz main .btn,
.page-unit-test main .btn {
  min-height: 2.9rem;
  padding-inline: 1.4rem;
  border-radius: 999px;
  font-weight: 700;
}
.page-auth main .btn-small,
.page-progress main .btn-small { min-height: 2.25rem; padding-inline: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .page-auth .auth-form input,
  .page-auth .auth-form select { transition: none; }
}

/* ------------------------------------------------- sign in and sign up */

/* One centred card: a navy brand panel on the left, the form on the right.
   The panel is placed by the grid rather than by wrapping the form, so the
   form's own markup -- which tests and scripts read by id -- is untouched. */
.page-login .auth-page,
.page-signup .auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  column-gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  max-width: 66rem;
  /* Radius and the .5rem bezel round the brand panel come from ak-frame
     (ak-frame-panel/panel in the markup); the panel's own radius is derived
     from this one, so the two curves stay concentric. Only the form side
     needs more room than the bezel, so only those two edges are set here. */
  margin: clamp(1.5rem, 4vw, 3rem) auto clamp(2rem, 5vw, 4rem);
  padding: var(--ak-frame-padding) clamp(1.25rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) var(--ak-frame-padding);
  border: 1px solid var(--border, #d0e4ef);
  background: var(--panel, #ffffff);
}
.page-login .auth-page > :not(.auth-aside),
.page-signup .auth-page > :not(.auth-aside) { grid-column: 2; }
.page-login .auth-page > h1,
.page-signup .auth-page > h1 { margin-top: clamp(1rem, 3vw, 2.5rem); margin-bottom: .5rem; }
/* Grid items do not collapse margins, so the heading's bottom margin and the
   form's top margin were adding up to a 44px hole under "Sign in". */

.auth-aside {
  grid-column: 1;
  grid-row: 1 / span 40;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .6rem;
  min-height: 30rem;
  color: #ffffff;
  background: var(--app-ink);
  overflow: hidden;
}
.auth-aside__art {
  width: 100%;
  max-width: 22rem;
  height: auto;
  margin: 0 auto auto;
}
.auth-aside__title {
  margin: 1.5rem 0 0;
  font-family: var(--pp-display, inherit);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.auth-aside__body {
  margin: 0;
  max-width: 26rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #cde8f6;
}

.page-login .auth-form .btn-primary,
.page-signup .auth-form .btn-primary { margin-top: .75rem; }
.page-login .auth-providers,
.page-signup .auth-providers { gap: .6rem; }
.page-login .auth-providers .btn,
.page-signup .auth-providers .btn {
  width: 100%;
  border: 1.5px solid var(--border, #d0e4ef);
}

@media (max-width: 900px) {
  .page-login .auth-page,
  .page-signup .auth-page {
    grid-template-columns: minmax(0, 1fr);
    max-width: 32rem;
    padding: var(--ak-frame-padding) var(--ak-frame-padding) 2rem;
  }
  .page-login .auth-page > :not(.auth-aside),
  .page-signup .auth-page > :not(.auth-aside) { grid-column: 1; padding-inline: .75rem; }
  .auth-aside {
    grid-row: auto;
    min-height: 0;
  }
  .auth-aside__art { display: none; }
  .page-login .auth-page > h1,
  .page-signup .auth-page > h1 { margin-top: 1.75rem; }
  .auth-aside__title { margin: 0; font-size: 1.5rem; }
  .auth-aside__body { font-size: .92rem; }
}

/* ---------------------------------------------------------- My progress */

/* The page's own layout and components are in assets/css/progress.css, which
   only that page loads. Only the shared rules above (main padding, the h1,
   pill buttons) apply to it from here. */


/* -------------------------------------------------------------- Account */

/* Two columns on a wide screen: your details on the left, your class on the
   right. Each block is a card. */
.page-account .auth-page { max-width: 66rem; }
.page-account #account-signed-in:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
}
.page-account #account-signed-in > * { grid-column: 1; margin: 0; }
.page-account #account-signed-in > .class-section {
  grid-column: 2;
  grid-row: 1 / span 6;
}
.page-account #account-form,
.page-account #account-alias-form,
.page-account .class-section {
  /* Padding and radius: ak-frame-card/card in the markup. */
  border: 1px solid var(--border, #d0e4ef);
  background: var(--panel, #ffffff);
}
.page-account .class-section > h2 {
  margin: 0 0 .75rem;
  font-family: var(--pp-display, inherit);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pp-ink, var(--app-ink));
}
.page-account #account-form .btn-primary,
.page-account #account-alias-form .btn-primary { justify-self: start; margin-top: .5rem; }

@media (max-width: 900px) {
  .page-account .auth-page { max-width: 34rem; }
  .page-account #account-signed-in:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .page-account #account-signed-in > .class-section { grid-column: 1; grid-row: auto; }
}

/* ------------------------------------------------ a set quiz, a unit test */

/* The same centred column the unit test already has; the quiz page had no
   width of its own and sat against the left edge of a wide container. */
.page-quiz .quiz-page { max-width: 52rem; }

/* The intro is the moment a student commits to the paper, so it is drawn as
   one clear card with a large start button. */
.page-quiz .eyebrow,
.page-unit-test .eyebrow {
  display: inline-block;
  margin-bottom: .6rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--pp-ink, var(--app-ink));
  background: var(--pp-fog, #e8f4fb);
}
.page-quiz .ut-intro,
.page-unit-test .ut-intro {
  /* Padding and radius: ak-frame-card/8 in the markup (card/card on a phone). */
  border: 1px solid var(--border, #d0e4ef);
  background: var(--panel, #ffffff);
  box-shadow: none;
}
.page-quiz .ut-intro p,
.page-unit-test .ut-intro p { font-size: 1rem; line-height: 1.65; }
.page-quiz #quiz-start,
.page-unit-test #ut-start {
  min-height: 3.25rem;
  padding-inline: 2rem;
  font-size: 1.05rem;
}
.page-quiz .ut-result,
.page-quiz #quiz-result,
.page-unit-test .ut-result {
  border-radius: var(--app-radius);
}

/* ------------------------------------------------------------- Settings */

.page-settings main > section,
.page-settings .settings-card {
  border-radius: var(--app-radius);
}

/* ------------------------------------------------ quiz questions as cards */

/* Each question is a fieldset. Drawn as a card, with the legend floated into
   it as the card's heading rather than notched into the border. */
.page-quiz #quiz-questions .quiz-q__set {
  /* Padding and radius: ak-frame-card/card, set by question-render.js. */
  margin: 0 0 1rem;
  border: 1px solid var(--border, #d0e4ef);
  background: var(--panel, #ffffff);
}
.page-quiz #quiz-questions .quiz-q__prompt {
  float: left;
  width: 100%;
  margin: 0 0 .6rem;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--pp-ink, var(--app-ink));
}
.page-quiz #quiz-questions .quiz-q__prompt + * { clear: both; }

/* The controls inside a question, in the site's own rounded style. */
.page-quiz .quiz-match__chip,
.page-quiz .quiz-match__place,
.page-quiz .quiz-order__move {
  min-height: 44px;
  padding: .45rem .9rem;
  border: 1.5px solid var(--border, #d0e4ef);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: var(--pp-ink, var(--app-ink));
  background: var(--panel, #ffffff);
  cursor: pointer;
}
.page-quiz .quiz-match__chip,
.page-quiz .quiz-match__place { border-radius: 999px; }
/* The move buttons sit 4px inside their row, so ak-frame gives them the row's
   radius less that gap; as pills their corners stood outside the row's. */
.page-quiz .quiz-match__chip:hover,
.page-quiz .quiz-match__place:hover,
.page-quiz .quiz-order__move:not(:disabled):hover {
  border-color: var(--app-sky);
  background: var(--pp-fog, #e8f4fb);
}
.page-quiz .quiz-match__chip[aria-pressed="true"] {
  color: #ffffff;
  border-color: var(--app-ink);
  background: var(--app-ink);
}
.page-quiz .quiz-order__move { min-width: 44px; padding: var(--ak-frame-padding); }
.page-quiz .quiz-match__pick,
.page-quiz .quiz-blank__input {
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1.5px solid var(--border, #d0e4ef);
  border-radius: .7rem;
  font: inherit;
  color: inherit;
  background: var(--panel, #ffffff);
}
.page-quiz .quiz-blank__input { min-height: 2.2rem; }
.page-quiz .quiz-choice { border-radius: .8rem; }
/* ak-frame zeroes a frame's margin, so the rows are spaced by their list. */
.page-quiz .quiz-order { display: grid; gap: .4rem; }
.page-quiz .quiz-order__code,
.page-quiz .quiz-blank {
  border-radius: .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.page-quiz #quiz-submit { min-height: 3.25rem; padding-inline: 2rem; font-size: 1.05rem; }
/* Move up / Move down side by side, so a line of code is one row tall. */
.page-quiz .quiz-order__moves { flex-direction: row; gap: .35rem; align-items: center; }
.page-quiz .quiz-order__row { align-items: center; }
