/* =========================================
   Student portal styles
   Loaded after styles.css, so it reuses the
   brand variables (colours, fonts, spacing).
   ========================================= */

/* ---------- Login page ---------- */
.portal-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-m);
  background: var(--color-navy);
}

.login-card {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: var(--space-m);
  border-bottom: 4px solid var(--color-gold);
  background: var(--color-navy-dark);
}

.login-brand img {
  width: 180px;
  height: auto;
  margin-inline: auto;
}

.login-body {
  padding: var(--space-l) var(--space-m);
}

.login-body h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  color: var(--color-navy);
}

/* ---------- Form ---------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: var(--space-m);
}

.login-form label {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-white);
  color: var(--color-navy);
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--color-slate);
}

.login-form [aria-invalid="true"] {
  border-color: #b42318;
}

.form-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #b42318;
}

.form-error:empty {
  display: none;
}

.login-form .btn {
  width: 100%;
  margin-top: var(--space-s);
}

.login-help {
  margin-top: var(--space-s);
  font-size: 0.875rem;
  text-align: center;
}

.login-help a {
  font-weight: 600;
  color: var(--color-primary);
}
/* ---------- Dashboard layout ---------- */
.portal {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-grey-light);
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: 0.75rem var(--space-m);
  border-bottom: 4px solid var(--color-gold);
  background: var(--color-navy);
  color: var(--color-white);
}

.portal-logo img {
  width: 120px;
  height: auto;
}

.portal-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem var(--space-s);
  font-size: 0.875rem;
}

.portal-user strong {
  color: var(--color-gold-light);
}

.btn-logout {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--color-white);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Phones: the nav is one row you can swipe sideways */
.portal-layout {
  flex: 1;
}

.portal-nav {
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
}

.portal-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0.5rem var(--space-s);
  list-style: none;
}

.portal-nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  color: var(--color-navy);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.portal-nav a:hover {
  background: var(--color-grey-light);
}

.portal-nav a[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-white);
}

.portal-main {
  padding: var(--space-m);
}

.portal-main h1 {
  font-size: 1.75rem;
  color: var(--color-navy);
}

.portal-intro {
  margin-top: 0.25rem;
}

/* ---------- Summary cards ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-m);
  margin-top: var(--space-m);
}

.summary-card {
  padding: var(--space-m);
  border-top: 4px solid var(--color-gold);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.summary-card h2,
.summary-card h3 {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-slate);
}

.summary-value {
  margin: 0.5rem 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
}

.summary-card a {
  font-weight: 600;
  color: var(--color-primary);
}

/* Laptops: the nav becomes a sidebar on the left */
@media (min-width: 900px) {
  .portal-layout {
    display: grid;
    /* minmax(0, 1fr): the main column may shrink, so wide tables
       scroll inside their box instead of stretching the page */
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .portal-nav {
    overflow-x: visible;
    border-right: 1px solid var(--color-border);
    border-bottom: 0;
  }

  .portal-nav ul {
    flex-direction: column;
    padding: var(--space-m) var(--space-s);
  }

  .portal-main {
    padding: var(--space-l);
  }
}

/* ---------- Data tables (results, fees, timetable, materials) ---------- */
.table-wrap {
  overflow-x: auto;
  margin-top: var(--space-m);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.data-table thead th {
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Keep each value on one line ("08:00–10:00"); the box scrolls on phones */
.data-table tbody > tr > * {
  white-space: nowrap;
}

.data-table tbody th {
  font-weight: 600;
  color: var(--color-navy);
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

/* Grade badges */
.grade {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
}

.grade-distinction { background: #e3f1e7; color: var(--color-success); }
.grade-credit      { background: #fbf3d9; color: #7a5c00; }
.grade-pass        { background: #e8edf5; color: var(--color-navy); }
.grade-fail        { background: #fbe9eb; color: #b42318; }

.results-summary {
  margin-top: var(--space-m);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-navy);
}

/* ---------- Page sections (fees, timetable, notices) ---------- */
/* styles.css gives website sections (main > section) big padding;
   portal sections don't want it */
.portal-main .page-section {
  margin-top: var(--space-l);
  padding: 0;
}

.page-section h2 {
  font-size: 1.25rem;
  color: var(--color-navy);
}

/* "How to pay" box (selector matches the one above so its padding wins) */
.portal-main .info-box {
  padding: var(--space-m);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.info-box ol {
  margin: var(--space-s) 0;
  padding-left: 1.25rem;
}

.info-box li + li {
  margin-top: 0.375rem;
}

.info-box a {
  font-weight: 600;
  color: var(--color-primary);
}

/* Notices */
.notice-list {
  display: grid;
  gap: var(--space-s);
  margin: var(--space-m) 0 0;
  padding: 0;
  list-style: none;
}

.notice {
  padding: var(--space-m);
  border-left: 4px solid var(--color-gold);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.notice-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-slate);
}

.notice h3 {
  margin: 0.25rem 0 0.375rem;
  font-size: 1.0625rem;
  color: var(--color-navy);
}

/* Small grey text, e.g. "Coming soon" */
.muted {
  font-size: 0.875rem;
  color: var(--color-slate);
}

.data-table a {
  font-weight: 600;
  color: var(--color-primary);
}

/* ---------- Staff portal ---------- */
/* Make sure "hidden" always hides, even on elements given a display value */
.portal [hidden] {
  display: none !important;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-tag {
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-light);
}

.role-badge {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-gold);
  color: var(--color-navy);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-badge:empty {
  display: none;
}

.summary-card > p:not(.summary-value) {
  margin-bottom: 0.5rem;
}

/* ---------- Staff forms ---------- */
.portal-main .form-card {
  padding: var(--space-m);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.staff-form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 640px;
}

.staff-form label {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.staff-form input,
.staff-form select,
.staff-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-white);
  color: var(--color-navy);
  font: inherit;
}

.staff-form textarea {
  resize: vertical;
}

.staff-form [aria-invalid="true"] {
  border-color: #b42318;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-s);
}

/* Buttons for light backgrounds */
.btn-secondary {
  border-color: var(--color-navy);
  background: transparent;
  color: var(--color-navy);
}

.btn-danger {
  border-color: #b42318;
  background: transparent;
  color: #b42318;
}

.btn-small {
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ---------- Notice links and attachments ---------- */
.notice-link,
.notice-attachment {
  margin-top: 0.75rem;
}

.notice-link a,
.notice-attachment a {
  font-weight: 600;
  color: var(--color-primary);
}

.notice-attachment img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-s);
}

/* Groups of related fields in staff forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: var(--space-s) 0 0;
  padding: var(--space-s) var(--space-m) var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
}

.form-group legend {
  padding: 0 0.375rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-navy);
}

.current-attachment {
  padding: 0.75rem;
  border-radius: var(--radius-s);
  background: var(--color-grey-light);
}

.staff-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.staff-form input[type="checkbox"] {
  width: 1.25rem;
  min-height: 0;
  height: 1.25rem;
  padding: 0;
}

.staff-form input[type="file"] {
  padding: 0.5rem;
}

/* ---------- Marks page ---------- */
.marks-picker {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-m);
  max-width: none;
}

.marks-picker > div {
  display: flex;
  flex: 1 1 240px;
  flex-direction: column;
  gap: 0.375rem;
}

.marks-picker label {
  margin-top: 0;
}

.mark-input {
  width: 5.5rem;
  min-height: 44px;
  padding: 0.5rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  color: var(--color-navy);
  font: inherit;
  text-align: center;
}

.mark-input[aria-invalid="true"] {
  border: 2px solid #b42318;
}

.marks-table td {
  vertical-align: middle;
}

/* Gold bar = changed but not saved yet */
.marks-table tr.is-changed > th {
  box-shadow: inset 4px 0 0 var(--color-gold);
}

#marks-form .form-error,
#marks-form .form-status {
  margin-top: var(--space-s);
}

/* Pale red = something to fix in this row */
.marks-table tr.has-error > * {
  background: #fdf1f1;
}

/* ---------- Payments ---------- */
.data-table .money {
  font-variant-numeric: tabular-nums; /* digits line up in columns */
}

/* A correction row, and the payment it cancels */
.data-table tr.is-correction > * {
  background: #fdf6f6;
  color: #8a1c14;
}

.data-table tr.is-corrected > * {
  color: var(--color-slate);
  text-decoration: line-through;
  text-decoration-color: rgba(59, 74, 99, 0.5);
}

.data-table tr.is-corrected .tag {
  text-decoration: none;
}

/* Notes can be long: let them wrap */
.data-table td.payment-note {
  min-width: 12rem;
  max-width: 22rem;
  white-space: normal;
}

.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-grey-light);
  color: var(--color-slate);
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-correction {
  background: #fbe9eb;
  color: #b42318;
}

#payment-form .form-status,
#history-status {
  margin-top: var(--space-s);
}

/* ---------- Pop-up dialog ---------- */
.portal-dialog {
  width: min(32rem, calc(100% - 2rem));
  padding: var(--space-m);
  border: 0;
  border-top: 4px solid #b42318;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}

.portal-dialog::backdrop {
  background: rgba(18, 38, 74, 0.55);
}

.portal-dialog h2 {
  font-size: 1.25rem;
  color: var(--color-navy);
}

.portal-dialog #correct-summary {
  margin: 0.5rem 0;
  font-weight: 600;
  color: var(--color-navy);
}

/* ---------- Students page ---------- */
/* Dialogs that aren't about money or deleting: navy top instead of red */
.portal-dialog.dialog-neutral {
  border-top-color: var(--color-navy);
}

.list-search {
  max-width: 480px;
  margin-bottom: var(--space-s);
}

.portal-main .form-card + .table-wrap {
  margin-top: var(--space-m);
}

.form-card h3 {
  font-size: 1.0625rem;
  color: var(--color-navy);
}

/* The one-time login details box */
.login-details {
  margin-top: var(--space-m);
  padding: var(--space-m);
  border: 2px solid var(--color-success);
  border-radius: var(--radius-m);
  background: #f1f8f3;
}

.login-details h3 {
  color: var(--color-success);
}

.login-details dl {
  display: grid;
  gap: 0.5rem;
  margin: var(--space-s) 0;
}

.login-details dl > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.login-details dt {
  min-width: 11rem;
  font-weight: 600;
  color: var(--color-slate);
}

.login-details dd {
  font-weight: 700;
  color: var(--color-navy);
}

.login-details code {
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-s);
  background: var(--color-white);
  font-size: 1.125rem;
  letter-spacing: 0.08em;
}

/* ---------- Staff page ---------- */
.choice-list {
  display: grid;
  gap: 0.25rem;
}

/* A radio button or tick box with its label, easy to tap */
.staff-form .choice-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 0;
  padding: 0.5rem 0;
  font-weight: 500;
  cursor: pointer;
}

.staff-form .choice-label input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin-top: 0.125rem;
  padding: 0;
}

.staff-table td.staff-courses {
  min-width: 14rem;
  white-space: normal;
}

.data-table tr.is-inactive > * {
  color: var(--color-slate);
  background: var(--color-grey-light);
}

.tag-active {
  background: #e3f1e7;
  color: var(--color-success);
}

/* Buttons inside table rows sit side by side, without extra space above */
.data-table .notice-actions {
  flex-wrap: nowrap;
  margin-top: 0;
}

/* Staff list: let text wrap so the action buttons stay on screen */
.staff-table tbody > tr > th,
.staff-table td.staff-email,
.staff-table td.staff-courses {
  white-space: normal;
}

.staff-table td.staff-courses {
  min-width: 9rem;
}

.staff-table td.staff-email {
  min-width: 10rem;
  overflow-wrap: anywhere; /* long emails can break onto two lines */
}

/* "View only: …" note under a page heading */
.view-only-note {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-slate);
  border-radius: var(--radius-s);
  background: var(--color-white);
  color: var(--color-slate);
  font-weight: 600;
}

/* Read-only mark boxes (view-only admins) look clearly un-editable */
.mark-input[readonly] {
  border-color: var(--color-border);
  background: var(--color-grey-light);
  color: var(--color-slate);
}

/* Temporary password pop-up */
.reset-details {
  display: grid;
  gap: 0.5rem;
  margin: var(--space-s) 0;
}

.reset-details > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.reset-details dt {
  min-width: 9rem;
  font-weight: 600;
  color: var(--color-slate);
}

.reset-details dd {
  font-weight: 700;
  color: var(--color-navy);
}

.reset-details code {
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-s);
  background: var(--color-grey-light);
  font-size: 1.125rem;
  letter-spacing: 0.08em;
}

/* "Change password" sits a little apart at the bottom of the sidebar */
.portal-nav .nav-secondary {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 899px) {
  .portal-nav .nav-secondary {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

/* =========================================
   Online application (apply.html)
   ========================================= */
.apply-main {
  width: min(960px, 100% - 2rem);
  margin: var(--space-m) auto var(--space-l);
}

.apply-step,
.stepper-card {
  padding: var(--space-m);
  border-radius: var(--radius-m);
  background: var(--color-white);
  box-shadow: var(--shadow);
}

.apply-step {
  margin-top: var(--space-s);
}

.apply-step h1 {
  font-size: 1.75rem;
  color: var(--color-navy);
}

.apply-step h1:focus {
  outline: none;
}

.apply-subheading {
  margin: var(--space-m) 0 0.5rem;
  font-size: 1.125rem;
  color: var(--color-navy);
}

/* ---------- The numbered stepper ---------- */
.stepper {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
}

.step {
  position: relative;
  flex: 1 1 0;
  min-width: 4.5rem;
  text-align: center;
}

/* The line joining each circle to the next */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.125rem;
  left: calc(50% + 1.375rem);
  right: calc(-50% + 1.375rem);
  height: 2px;
  background: var(--color-border);
}

.step.is-done:not(:last-child)::after {
  background: var(--color-success);
}

.step-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.step-dot {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-slate);
  font-weight: 700;
}

.step.is-current .step-dot {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: var(--color-white);
}

.step.is-done .step-dot {
  border-color: var(--color-success);
  background: var(--color-success);
  color: var(--color-white);
}

.step-label {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-slate);
}

.step.is-current .step-label {
  color: var(--color-navy);
}

.step-link:hover .step-label,
.step-link:focus-visible .step-label {
  text-decoration: underline;
}

/* On small phones show only the current step's name */
@media (max-width: 600px) {
  .step:not(.is-current) .step-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

/* ---------- Messages ---------- */
.reference-banner {
  margin-top: var(--space-s);
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-gold);
  border-radius: var(--radius-s);
  background: #fbf6e5;
  color: var(--color-navy);
}

.apply-main .page-error:not(:empty) {
  margin-top: var(--space-s);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  background: #fdf1f1;
}

/* ---------- Step 1 ---------- */
.apply-checklist {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
}

.terms {
  margin: var(--space-m) 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

.terms summary {
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.terms div {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.resume-box {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-border);
}

.resume-form,
.pay-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-s);
  max-width: none;
}

.resume-form > div,
.pay-form > div {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: 0.375rem;
}

.resume-form > .resume-button,
.pay-form > .resume-button {
  flex: 0 0 auto;
}

/* Hidden from people; only spam robots fill it in */
.trap {
  position: absolute;
  left: -9999px;
}

/* ---------- Two-column form steps ---------- */
.apply-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--space-m);
  max-width: none;
}

.apply-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

@media (min-width: 700px) {
  .apply-grid {
    grid-template-columns: 1fr 1fr;
  }

  .apply-grid > .full {
    grid-column: 1 / -1;
  }
}

/* ---------- Documents ---------- */
.document-list {
  display: grid;
  gap: 0.75rem;
  margin: var(--space-m) 0 0;
  padding: 0;
  list-style: none;
}

.document-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

.document-text {
  display: grid;
  gap: 0.125rem;
}

.document-done {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-success);
}

.document-item .notice-actions {
  margin-top: 0;
}

/* The "Upload" label is styled as a button and shows a focus ring
   when its (hidden) file input is focused */
.document-item input[type="file"]:focus-visible + label {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- Review & pay ---------- */
.review-block {
  margin-top: var(--space-m);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--color-border);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-head .apply-subheading {
  margin: 0;
}

.review-list {
  display: grid;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
}

.review-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
}

.review-list dt {
  min-width: 11rem;
  color: var(--color-slate);
}

.review-list dd {
  font-weight: 600;
  color: var(--color-navy);
}

.pay-box {
  margin-top: var(--space-m);
  padding: var(--space-m);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-m);
  background: #f1f8f3;
}

.pay-box .apply-subheading {
  margin-top: 0;
}

.pay-box ol {
  margin: 0 0 var(--space-s);
  padding-left: 1.25rem;
  display: grid;
  gap: 0.25rem;
}

.pay-warning {
  margin: 0 0 var(--space-s);
  font-size: 0.9rem;
  color: var(--color-navy);
}

.pay-saved {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--color-success);
}

.apply-step .login-details {
  margin-top: var(--space-s);
}

/* Buttons at the end of a two-column form step sit side by side */
.apply-grid > .form-actions {
  flex-direction: row;
}

/* Phones: smaller circles and shorter joining lines so all 7 steps fit */
@media (max-width: 600px) {
  .step {
    min-width: 2.25rem;
  }

  .step-dot {
    width: 1.875rem;
    height: 1.875rem;
    font-size: 0.875rem;
  }

  .step:not(:last-child)::after {
    top: 0.9375rem;
    left: calc(50% + 1.1rem);
    right: calc(-50% + 1.1rem);
  }

  .stepper-card,
  .apply-step {
    padding: var(--space-s);
  }

  .apply-step h1 {
    font-size: 1.5rem;
  }

  .portal-tag {
    display: none;
  }
}

/* ---------- Staff: Applications page ---------- */
.tag-warning {
  background: #fbf3d9;
  color: #7a5c00;
}

.application-filters {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-s);
  max-width: none;
  margin-bottom: var(--space-s);
}

.application-filters > div {
  display: flex;
  flex: 1 1 240px;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 420px;
}

/* The application pop-up has a lot to show */
.portal-dialog.dialog-wide {
  width: min(48rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
}

.application-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.application-tags {
  margin-top: 0.5rem;
}

.application-view .review-block h3 {
  font-size: 1.0625rem;
  color: var(--color-navy);
}

.application-documents {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.application-documents li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.application-payment #payment-summary {
  font-weight: 600;
  color: var(--color-navy);
}

.application-view .notice-actions {
  flex-wrap: wrap;
}
