/* The student portal. Loaded after ../book/book.css, whose variables (--cbk-accent
   and friends, set from the academy's brand by portal.js) and form styles it reuses. */
[hidden] { display: none !important; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 16px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
img { max-width: 100%; }

.pt-skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: #fff; color: var(--cbk-text); padding: 10px 14px;
  border-radius: var(--cbk-radius); border: 1px solid var(--cbk-border); }
.pt-skip:focus { top: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cbk-accent-outline); outline-offset: 2px; }
.bk-main:focus, #cbk-main:focus { outline: none; }
.bk-panel h1:focus, h1:focus { outline: none; }
.bk-error:empty, .bk-ferr:empty, .pt-status:empty { display: none; }
.pt-note-error { margin: 0; padding: 12px 20px; background: #fbeeea; color: #7a2f1f; }

/* The bar of links under the header */
/* A page's content waits out of sight until its first answers are in and drawn, then appears in one go
   rather than piece by piece (portal.js adds .is-ready). If the script never says so, it shows after two seconds. */
#cbk-main:not(.is-ready) { opacity: 0; animation: pt-appear .2s ease 2s forwards; }
#cbk-main.is-ready { animation: pt-show .15s ease; }
@keyframes pt-appear { to { opacity: 1; } }
@keyframes pt-show { from { opacity: 0; } }
.pt-nav { view-transition-name: pt-nav; max-width: 760px; margin: 0 auto 26px; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  border-bottom: 1px solid var(--cbk-on-bg-line, var(--cbk-border)); }
.pt-links { display: flex; flex-wrap: wrap; gap: 0 26px; }
.pt-links a { display: inline-block; padding: 12px 0; color: var(--cbk-on-bg, var(--cbk-text)); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pt-links a:hover { color: var(--cbk-on-bg, var(--cbk-accent-ink)); }
html[data-cbk-bg] .pt-links a:hover, html[data-cbk-bg] .pt-quick a:hover { text-decoration: underline; }
.pt-links a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--cbk-on-bg-accent, var(--cbk-accent)); }
/* Menu items and links that sit straight on the page background need a focus ring that shows on it. */
.pt-links a:focus-visible, .pt-signout:focus-visible, .pt-quick a:focus-visible { outline-color: var(--cbk-on-bg-accent, var(--cbk-accent-outline)); }
.pt-user { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: .9rem; min-width: 0; }
.pt-who { color: var(--cbk-on-bg-muted, var(--cbk-muted)); overflow-wrap: anywhere; }
.pt-signout { font: inherit; font-size: .9rem; font-weight: 600; background: none; border: 1px solid var(--cbk-on-bg-line, var(--cbk-border)); border-radius: var(--cbk-radius); padding: 8px 14px; min-height: 40px;
  color: var(--cbk-on-bg, var(--cbk-text)); cursor: pointer; }
.pt-signout:hover { border-color: var(--cbk-on-bg-accent, var(--cbk-accent)); }
.pt-signout:disabled { opacity: .55; cursor: progress; }

/* Cards */
.pt-card { background: var(--cbk-surface); border: 1px solid var(--cbk-border); border-radius: var(--cbk-radius-card); padding: 24px 28px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(31,41,46,.04), 0 12px 32px -12px rgba(31,41,46,.10); }
.pt-card > :last-child { margin-bottom: 0; }
.pt-intro { margin: -6px 0 18px; color: var(--cbk-on-bg-muted, var(--cbk-muted)); }
h1 + .pt-cards { margin-top: 4px; }
.pt-page-title { font-size: 2.1rem; font-weight: 800; line-height: 1.2; letter-spacing: -.025em; margin: 10px 0 22px; color: var(--cbk-on-bg, inherit); }

/* Facts: a label and its value on one row */
.pt-facts { margin: 0 0 18px; padding: 14px 18px; background: var(--cbk-bg); border: 1px solid var(--cbk-border); border-radius: var(--cbk-radius-box); }
.pt-facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: .92rem; }
.pt-facts dt { color: var(--cbk-muted); flex: none; }
.pt-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.pt-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-block { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* Buttons and link-buttons */
.pt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 22px; border: 0; border-radius: var(--cbk-radius);
  background: var(--cbk-accent); color: var(--cbk-accent-text); font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; }
a.pt-btn:hover { filter: brightness(.95); }
.pt-btn:disabled { opacity: .55; cursor: progress; }
.pt-btn-ghost { background: #fff; color: var(--cbk-text); border: 1px solid var(--cbk-border); }
.pt-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 14px; }
.pt-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--cbk-accent-ink); text-decoration: underline; cursor: pointer; }
.pt-quick { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 22px 0 0; padding: 0; list-style: none; }
.pt-quick a { color: var(--cbk-on-bg, var(--cbk-accent-ink)); }

/* What is owed */
.pt-owe { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--cbk-border); }
.pt-owe:first-of-type { border-top: 0; padding-top: 0; }
.pt-owe strong { overflow-wrap: anywhere; }
.pt-owe-amt { font-weight: 600; }
.pt-owe-due { flex-basis: 100%; color: var(--cbk-muted); font-size: .88rem; }

/* How to pay */
.pt-pay { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--cbk-border); }
.pt-pay > h2 { font-size: 1.05rem; }
.pt-card .pt-pay:first-child, .bk-panel .pt-pay:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pt-ways { margin: 0 0 14px; padding-left: 20px; }
.pt-way { margin: 0 0 10px; }
.pt-way .pt-btn { margin-left: 6px; min-height: 40px; padding: 6px 18px; }
.pt-bank { margin: 8px 0 6px; padding: 10px 14px; background: var(--cbk-bg); border: 1px solid var(--cbk-border); border-radius: var(--cbk-radius-box); }
.pt-bankrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 4px 0; }
.pt-bankrow dt { color: var(--cbk-muted); font-size: .85rem; }
.pt-bankrow dd { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.pt-bankval { overflow-wrap: anywhere; }
.pt-copy { font: inherit; font-size: .8rem; font-weight: 600; min-height: 36px; min-width: 64px; padding: 4px 12px; background: #fff; color: var(--cbk-text);
  border: 1px solid var(--cbk-border); border-radius: var(--cbk-radius); cursor: pointer; }
.pt-copy:hover { border-color: var(--cbk-accent); }
.pt-note { margin: 6px 0 0; color: var(--cbk-muted); font-size: .9rem; }

/* Tables: courses and payments. Stacked rows under 600px, each cell labelled by data-label. */
.pt-tablewrap { margin: 0 0 14px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pt-table th { text-align: left; font-size: .85rem; color: var(--cbk-muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--cbk-border); }
.pt-table td { padding: 12px 8px; border-bottom: 1px solid var(--cbk-border); vertical-align: top; overflow-wrap: break-word; }
.pt-table td:last-child a { white-space: nowrap; }
.pt-table .pt-num { text-align: right; white-space: nowrap; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-sub { display: block; color: var(--cbk-muted); font-size: .85rem; }
.pt-status { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: var(--cbk-radius-pill); background: var(--cbk-bg); border: 1px solid var(--cbk-border); }
.pt-table .pt-status { white-space: nowrap; }   /* a short status word in a table cell stays on one line */
/* A sentence in the pill's class (the 'link is on its way' message) is plain text that wraps inside its card, not a pill. */
.pt-status.pt-form-ok { display: block; font-size: inherit; padding: 0; border: 0; border-radius: 0; background: none; }

/* Documents */
.pt-docs { list-style: none; margin: 0 0 6px; padding: 0; }
.pt-doc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--cbk-border); }
.pt-doc:first-child { border-top: 0; }
.pt-doc-body { flex: 1 1 240px; min-width: 0; }
.pt-doc-title { font-weight: 600; overflow-wrap: anywhere; }
.pt-doc-note { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.pt-doc-meta { margin: 2px 0 0; color: var(--cbk-muted); font-size: .85rem; }

/* The payment result */
.pt-msg { padding: 14px 18px; border-radius: var(--cbk-radius-box); border: 1px solid var(--cbk-border); border-left-width: 4px; margin: 0 0 16px; background: var(--cbk-bg); }
.pt-msg-ok { border-left-color: #2e7d4f; }
.pt-msg-wait { border-left-color: #b8892b; }
.pt-msg-bad { border-left-color: var(--cbk-urgent); }

/* Forms (book.css styles input and textarea; selects match) */
.bk-field select { width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; color: inherit; background: #fff; border: 1px solid var(--cbk-border); border-radius: var(--cbk-radius); }
.bk-field select:focus { border-color: var(--cbk-accent); }
.bk-field input[readonly] { background: var(--cbk-bg); }
.bk-field input[aria-invalid="true"], .bk-field select[aria-invalid="true"] { border-color: var(--cbk-urgent); }
.pt-form-err { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--cbk-urgent); background: #fbeeea; color: #7a2f1f; font-size: .92rem; }
.pt-form-err:empty { display: none; }
.pt-form-ok { margin: 12px 0 0; color: #2e6b44; font-weight: 600; }
.pt-form-ok:empty { display: none; }
.pt-readonly { margin: 0 0 18px; }
.pt-auth { max-width: 460px; margin: 0 auto; }
/* On the sign-in pages the logo sits centred above the box with the academy's name under it, never wider than the
   screen; the test-mode badge goes beneath them. */
.pt-head-auth { flex-direction: column; justify-content: center; text-align: center; gap: 14px; padding-top: 34px; }
.pt-head-auth .bk-brand { max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pt-head-auth .bk-brand img { max-height: 72px; max-width: 100%; height: auto; margin: 0 auto; }
.pt-brand-name { font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.pt-auth .bk-btn { width: 100%; }
.pt-links-row { margin: 18px 0 0; font-size: .95rem; }
.pt-pay-block { margin-top: 18px; }
.pt-pay-block > .bk-btn { margin-top: 14px; }
.pt-sep { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--cbk-border); }

/* ---- Sharp (see the end of ../book/book.css): the portal's own cards, buttons, tables and badges ---- */
html[data-cbk-style="sharp"] .pt-card { border-color: var(--cbk-text); box-shadow: none; }
html[data-cbk-style="sharp"] .bk-field select, html[data-cbk-style="sharp"] .pt-copy,
html[data-cbk-style="sharp"] .pt-btn-ghost { border-color: var(--cbk-text); }
html[data-cbk-style="sharp"] .pt-signout { border-color: var(--cbk-on-bg, var(--cbk-text)); }   /* it sits on the page background */
html[data-cbk-style="sharp"] .pt-btn, html[data-cbk-style="sharp"] .pt-signout, html[data-cbk-style="sharp"] .pt-copy,
html[data-cbk-style="sharp"] .pt-table th, html[data-cbk-style="sharp"] .pt-status, html[data-cbk-style="sharp"] .pt-page-title {
  text-transform: var(--cbk-case); letter-spacing: var(--cbk-tracking); }
html[data-cbk-style="sharp"] .pt-btn { font-size: .92rem; }
html[data-cbk-style="sharp"] .pt-signout, html[data-cbk-style="sharp"] .pt-copy { font-size: .78rem; }
html[data-cbk-style="sharp"] .pt-page-title { font-size: 1.7rem; font-weight: 700; }
html[data-cbk-style="sharp"] .pt-status.pt-form-ok { text-transform: none; letter-spacing: normal; }   /* a sentence, not a badge */

@media (max-width: 600px) {
  .pt-card { padding: 20px 18px; }
  .pt-page-title { font-size: 1.75rem; margin-top: 4px; }
  html[data-cbk-style="sharp"] .pt-page-title { font-size: 1.35rem; }
  .pt-nav { gap: 0 12px; }
  .pt-links { gap: 0 16px; }
  .pt-user { width: 100%; justify-content: space-between; padding: 6px 0 8px; }
  /* Tables become stacked rows */
  .pt-table, .pt-table tbody, .pt-table tr, .pt-table td { display: block; width: 100%; }
  .pt-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pt-table tr { padding: 10px 0; border-bottom: 1px solid var(--cbk-border); }
  .pt-table tr:last-child { border-bottom: 0; }
  .pt-table td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 4px 0; text-align: right; }
  .pt-table td::before { content: attr(data-label); color: var(--cbk-muted); font-size: .8rem; text-align: left; flex: none; }
  .pt-table td[data-label=""]::before { content: none; }
  .pt-table .pt-num { text-align: right; }
  .pt-way .pt-btn { margin-left: 0; margin-top: 6px; }
  .pt-bankrow { align-items: flex-start; flex-direction: column; }
}
