/* The student portal (js/portal.js): Nova's short courses for outside students. Tokens only (DESIGN.md); it reuses
   the app's buttons, panels, chips, fields and the five-step trail, and adds its own frame and course pages. */
.pt { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; background: var(--canvas); }

/* The bar: Nova's logo, the two pages, who is signed in */
.pt-top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); padding: var(--s2) var(--s4); background: var(--navy); color: var(--on-navy); --focus: var(--accent-on-navy); }
.pt-brand { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); margin-right: auto; text-decoration: none; }
.pt-brand img { width: 104px; height: auto; }
.pt-brand span { padding-left: var(--s3); border-left: 1px solid var(--on-navy-line); font-size: var(--t-s); font-weight: 700; letter-spacing: 0.02em; color: var(--on-navy-mute); }
.pt-nav { order: 3; display: flex; gap: var(--s1); width: 100%; margin: 0 calc(-1 * var(--s2)); }
.pt-nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-ctl); color: var(--on-navy-mute); font-weight: 600; text-decoration: none; }
.pt-nav a:hover { background: var(--on-navy-hover); color: var(--on-navy); }
.pt-nav a[aria-current] { color: var(--on-navy); box-shadow: inset 0 -3px 0 var(--accent); border-radius: var(--r-ctl) var(--r-ctl) 0 0; }
.pt-who { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s2); border-radius: var(--r-ctl); color: var(--on-navy); font-weight: 600; text-decoration: none; }
.pt-who:hover { background: var(--on-navy-hover); }
.pt-who .av { background: var(--accent); color: var(--navy); }
.pt-in { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-ctl); box-shadow: inset 0 0 0 1.5px var(--on-navy-mute); color: var(--on-navy); font-weight: 650; text-decoration: none; }
.pt-in:hover { background: var(--on-navy-hover); }

.pt-main { display: grid; align-content: start; gap: var(--s5); width: 100%; max-width: 76rem; margin: 0 auto; padding: var(--s5) var(--s4) var(--s10); min-width: 0; }
.pt-main.narrow { max-width: 46rem; }
.pt-main:focus { outline: 0; }
.pt-foot { padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: var(--t-note); color: var(--mute); text-align: center; }
.pt-foot p + p { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s2); margin-top: var(--s1); }
.pt-foot a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s2); color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

/* Headings and running text */
.pt-head { display: grid; justify-items: start; gap: var(--s2); min-width: 0; }
.pt h1 { font-family: var(--display); font-weight: var(--display-weight); font-stretch: var(--display-stretch); letter-spacing: var(--display-tracking); font-size: var(--t-2xl); line-height: 1.1; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.pt h1:focus { outline: 0; }
.pt-lede { max-width: 60ch; font-size: var(--t-l); color: var(--text); }
.pt-meta { display: flex; align-items: center; gap: var(--s15); font-size: var(--t-note); color: var(--mute); }
.pt-meta .ic { width: 16px; height: 16px; }
.pt-where { font-size: var(--t-note); font-weight: 600; color: var(--mute); }
.pt-a { color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pt-back { display: inline-flex; align-items: center; gap: var(--s1); justify-self: start; min-height: var(--tap); margin: calc(-1 * var(--s2)) 0 calc(-1 * var(--s3)) calc(-1 * var(--s1)); padding: 0 var(--s2) 0 var(--s1); border-radius: var(--r-ctl); color: var(--mute); font-weight: 600; text-decoration: none; }
.pt-back:hover { background: var(--sunk); color: var(--ink); }
.pt-back .ic { width: 18px; height: 18px; }
.pt-wide { width: 100%; }
.pt .panel.pad { display: grid; gap: var(--s4); align-content: start; }
.pt .panel.pad > .h-sm, .pt .panel.pad > .panel-sub { margin: 0; }
.pt .panel.pad > .h-sm + .panel-sub { margin-top: calc(-1 * var(--s3)); }
.pt .notice .btn { background: var(--surface); }

/* The catalogue */
.pt-pills { display: flex; gap: var(--s2); margin: 0 calc(-1 * var(--s4)); padding: var(--s05) var(--s4); overflow-x: auto; scrollbar-width: none; }
.pt-pill { flex: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4); border: 0; border-radius: var(--r-chip); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: inherit; font-weight: 600; white-space: nowrap; }
.pt-pill span { font-weight: 400; color: var(--mute); font-variant-numeric: tabular-nums; }
.pt-pill:hover { box-shadow: inset 0 0 0 1px var(--field); }
.pt-pill[aria-pressed="true"] { background: var(--navy); box-shadow: none; color: var(--on-navy); }
.pt-pill[aria-pressed="true"] span { color: var(--on-navy-mute); }
.pt-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.pt-grid > li { display: grid; }
.pt-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto auto; overflow: hidden; justify-items: start; gap: var(--s2); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); transition: border-color var(--t-press) ease-out; }
.pt-card:hover { border-color: var(--field); }
.pt-card:has(a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pt-card h2 { font-size: var(--t-h3); font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.pt-card h2 a { color: inherit; text-decoration: none; outline: 0; }
.pt-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-panel); }
.pt-card > p { color: var(--text); }
.pt-card .tag { white-space: normal; padding-block: var(--s05); }
.pt-card-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; margin-top: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); }
.pt-fee { font-size: var(--t-l); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.pt-card.has-img { grid-template-rows: auto auto auto 1fr auto auto; }
.pt-card-img { display: block; width: calc(100% + 2 * var(--s5)); max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s2); background: var(--sunk); }
.pt-hero { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-panel); background: var(--sunk); }
.pt-reg.has-img { grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: var(--s4); }
.pt-reg.has-img > :not(.pt-reg-img) { grid-column: 2; }
.pt-reg-img { grid-column: 1; grid-row: 1 / span 2; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-ctl); background: var(--sunk); }
@media (max-width: 39.99em) {
  .pt-reg.has-img { grid-template-columns: minmax(0, 1fr); }
  .pt-reg.has-img > :not(.pt-reg-img) { grid-column: 1; }
  .pt-reg-img { grid-row: auto; aspect-ratio: 16 / 7; }
}
/* How it works: four numbered steps */
.pt-how { display: grid; gap: var(--s4); margin-top: var(--s5); padding-top: var(--s6); border-top: 1px solid var(--line); }
.pt-how h2 { font-size: var(--t-l); font-weight: 650; color: var(--ink); }
.pt-how ol { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.pt-how li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s3); }
.pt-n { grid-row: span 2; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--navy); color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-how b { align-self: center; color: var(--ink); }
.pt-how p { grid-column: 2; font-size: var(--t-note); color: var(--mute); }

/* A course, and any page with a main column and a side column */
.pt-two, .pt-col, .pt-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-content: start; min-width: 0; }
.pt-ticks { display: grid; gap: var(--s25); }
.pt-ticks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); color: var(--text); }
.pt-ticks .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--ok); }
.pt-for { color: var(--text); }
.pt-for b { color: var(--ink); }
.pt-mods { display: grid; gap: var(--s4); }
.pt-mods > li > b { display: block; margin-bottom: var(--s1); color: var(--ink); }
.pt-mods ul li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s25) 0; border-top: 1px solid var(--line); color: var(--text); }
.pt-mods small { flex: none; font-size: var(--t-s); color: var(--mute); }
.pt-price { display: grid; gap: var(--s1); }
.pt-price .num { font-size: var(--t-2xl); }
.pt-price span { font-size: var(--t-note); color: var(--mute); }
.pt-facts { display: grid; }
.pt-facts > div { display: grid; grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr); gap: var(--s4); padding: var(--s25) 0; border-top: 1px solid var(--line); }
.pt-facts > div:first-child { border-top: 0; padding-top: 0; }
.pt-facts dt { font-size: var(--t-note); color: var(--mute); }
.pt-facts dd { font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pt-facts .total { border-top: 1.5px solid var(--navy); }
.pt-facts .total dd { font-size: var(--t-l); font-weight: 700; }
.pt-move { display: grid; justify-items: start; gap: var(--s3); }
.pt-sum .tag { justify-self: start; white-space: normal; padding-block: var(--s05); }
.pt-prog { display: grid; gap: var(--s1); width: 100%; }
.pt-prog small { font-size: var(--t-note); color: var(--mute); font-variant-numeric: tabular-nums; }
.pt-nextup { font-size: var(--t-note); color: var(--text); }

/* Forms: registering, signing in, paying */
.pt-form .field input, .pt-form .field select { font-size: var(--t-m); }
.pt-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.pt-tab { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s3); border: 0; border-radius: var(--r-ctl); background: var(--surface); box-shadow: inset 0 0 0 1px var(--field); color: var(--text); font: inherit; font-weight: 600; }
.pt-tab .ic { width: 20px; height: 20px; }
.pt-tab:hover { background: var(--canvas); }
.pt-tab[aria-pressed="true"] { background: var(--with-bg); box-shadow: inset 0 0 0 2px var(--navy); color: var(--ink); font-weight: 700; }
.pt-safe { display: flex; align-items: flex-start; gap: var(--s2); }
.pt-safe .ic { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.pt-taps { padding: 0; }
.pt-taps button { font: inherit; }
.pt-taps .ic { color: var(--mute); }

/* Waiting for a payment, and the result of one */
.pt-wait { justify-items: center; padding-block: var(--s10) !important; text-align: center; }
.pt-wait h1 { font-size: var(--t-xl); }
.pt-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--sunk); border-top-color: var(--navy); animation: pt-spin 0.9s linear infinite; }
@keyframes pt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pt-spin { animation-duration: 2.4s; } }
.pt-done > .ic { width: 44px; height: 44px; padding: var(--s2); border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); stroke-width: 2.4; }

/* My learning */
.pt-regs { display: grid; gap: var(--s4); }
.pt-reg-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.pt-reg-h h3 { font-size: var(--t-h4); font-weight: 650; line-height: 1.25; color: var(--ink); }
.pt-reg-h h3 a { color: inherit; text-decoration: none; }
.pt-reg-h h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pt-reg-f { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.pt-reg-f:empty { display: none; }
.pt-notes { display: grid; }
.pt-notes li { display: grid; gap: var(--s05); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.pt-notes li:first-child { border-top: 0; padding-top: 0; }
.pt-notes li:last-child { padding-bottom: 0; }
.pt-notes a { color: var(--ink); text-decoration: none; }
.pt-notes a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pt-notes time { font-size: var(--t-s); color: var(--mute); }
.pt-pays { display: grid; }
.pt-pays li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.pt-pays li:first-child { border-top: 0; padding-top: 0; }
.pt-pays li:last-child { padding-bottom: 0; }
.pt-pays b { display: block; font-weight: 600; color: var(--ink); }
.pt-pays small { display: block; font-size: var(--t-s); color: var(--mute); }
.pt-amt { flex: none; text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-amt small.ok { color: var(--ok-fg); }
.pt-amt small.no { color: var(--no-fg); }

.pt .trail.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* A registration's trail on a phone: the five nodes in a row, and one line naming the step it is at */
.pt-now { display: none; margin-top: var(--s2); font-size: var(--t-note); font-weight: 600; color: var(--ink); }
@container (max-width: 36rem) {
  .pt .trail.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s1); }
  .pt .t5 .step { padding-top: var(--node); }
  .pt .t5 .step b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pt-now { display: block; }
}

.pt-notes li > span { color: var(--text); }
.pt-msg { display: flex; align-items: center; gap: var(--s2); }
.pt-msg .ic { flex: none; width: 16px; height: 16px; color: var(--mute); }
.pt-msg b { font-weight: 600; color: var(--ink); }
.pt-set { display: grid; gap: var(--s3); min-width: 0; margin: 0; padding: var(--s4) 0 0; border: 0; border-top: 1px solid var(--line); }
.pt-set legend { float: left; width: 100%; margin-bottom: var(--s2); padding: 0; font-size: var(--t-m); font-weight: 700; color: var(--ink); }
.pt-set legend + * { clear: both; }
.pt-line { display: block; }
/* The course player */
.pt-outline, .pt-outline ol { display: grid; }
.pt-outline { gap: var(--s4); }
.pt-outline > li > b { display: block; margin-bottom: var(--s1); color: var(--ink); }
.pt-outline ol li { border-top: 1px solid var(--line); }
.pt-outline a, .pt-locked { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s1); color: var(--ink); text-decoration: none; }
.pt-outline a:hover { background: var(--canvas); }
.pt-outline a[aria-current] { background: var(--with-bg); }
.pt-locked { color: var(--mute); }
.pt-dot { display: grid; place-items: center; width: var(--node); height: var(--node); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); color: var(--on-navy); }
.pt-dot .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.done > a .pt-dot { background: var(--navy); box-shadow: none; }
.open > a .pt-dot { box-shadow: inset 0 0 0 2px var(--navy); }
.locked .pt-dot { color: var(--mute); }
.locked .pt-dot .ic { stroke-width: 2; }
.pt-st { display: grid; font-weight: 600; }
.pt-st small { font-size: var(--t-s); font-weight: 400; color: var(--mute); }
.pt-lesson { font-size: var(--t-l); line-height: 1.6; }
.pt-lesson > p { max-width: 64ch; color: var(--text); }
.pt-lesson .pt-ticks { font-size: var(--t-m); line-height: 1.45; }
.pt-steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.pt-steps .btn-primary .ic:last-child { margin-right: calc(-1 * var(--s1)); }
.pt-rule { font-size: var(--t-m); }
.pt-quiz { display: grid; gap: var(--s4); }
.pt-q { min-width: 0; margin: 0; }
.pt-q legend { float: left; width: 100%; margin-bottom: var(--s3); padding: 0; font-size: var(--t-l); font-weight: 650; line-height: 1.35; color: var(--ink); }
.pt-qn { display: block; margin-bottom: var(--s1); font-size: var(--t-s); font-weight: 600; color: var(--mute); }
.pt-opt { clear: both; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--s3); min-height: 52px; padding: var(--s3); border-radius: var(--r-ctl); box-shadow: inset 0 0 0 1px var(--field); color: var(--text); cursor: pointer; transition: background-color var(--t-press) ease-out; }
.pt-opt:hover { background: var(--canvas); }
.pt-opt:has(input:checked) { background: var(--with-bg); box-shadow: inset 0 0 0 2px var(--navy); color: var(--ink); font-weight: 600; }
.pt-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pt-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); outline: 0; }
.pt-result { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s3) !important; }
.pt-result > .ic { grid-row: span 3; width: 36px; height: 36px; padding: var(--s15); border-radius: 50%; stroke-width: 2.4; }
.pt-result.ok > .ic { background: var(--ok-bg); color: var(--ok-fg); }
.pt-result.no > .ic { background: var(--needs-bg); color: var(--needs-fg); }
.pt-result h2 { align-self: center; font-size: var(--t-h3); font-weight: 650; color: var(--ink); }
.pt-result p { grid-column: 2; color: var(--text); }
.pt-review { display: grid; gap: var(--s3); }
.pt-review li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.pt-review .ic { width: 20px; height: 20px; margin-top: 2px; stroke-width: 2.4; }
.pt-review .ok .ic { color: var(--ok); }
.pt-review .no .ic { color: var(--no-fg); }
.pt-review b { display: block; font-weight: 600; color: var(--ink); }
.pt-review small { display: block; margin-top: var(--s1); font-size: var(--t-note); color: var(--text); }

/* The certificate: one picture, on the page and in the PDF */
.pt-cert { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--shadow-lift); }

@media (min-width: 40em) {
  .pt-top { padding-inline: var(--s6); }
  .pt-main { padding: var(--s8) var(--s6) var(--s12); gap: var(--s6); }
  .pt-pills { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
  .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-how ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
  .pt-brand img { width: 128px; }
  .pt-brand span { font-size: var(--t-m); }
}
@media (min-width: 53.8125em) {
  .pt-top { flex-wrap: nowrap; gap: var(--s5); min-height: 68px; }
  .pt-nav { order: 0; width: auto; margin: 0 auto 0 var(--s4); align-self: stretch; }
  .pt-nav a { min-height: 100%; }
  .pt-brand { margin-right: 0; }
  .pt h1 { font-size: 2.5rem; }
  .pt-wait h1 { font-size: var(--t-2xl); }
}
@media (min-width: 64em) {
  .pt-two { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--s6); align-items: start; }
  .pt-side { position: sticky; top: calc(68px + var(--s5)); }
  .pt-how ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 72em) {
  .pt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
