/* The student's certificate screens (docs/certificates/01-plan.md section 5; CertificateEnrollmentsComponent, CertificateProgramsComponent,
   CertificateChecklistComponent and CertificateSessionsComponent in app/components). Built from the shared components (the card, the badge, the button, the
   callout and the empty state), so what is here is only how they sit together: the student's certificates and the programs as lists of cards, the checklist as
   steps with a glyph beside the words (the glyph is never the only signal: each step says its state in words), and the sessions as a short list.

   Number 25 (89 until Conduct took 89 and 90 on develop, 15 Oct 2026, when every number from 32 up was taken) is the certificates build's student track. Tokens only and logical properties only (test/styles/tokens_test.rb, test/styles/components_test.rb),
   so it reads on the light shell and the console, in light and in dark, and mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and
   everything that holds words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10). */

/* ── The sections ─────────────────────────────────────────────────────── */

.certificate-enrollments,
.certificate-programs,
.certificate-checklist,
.certificate-sessions {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.certificate-enrollments__title,
.certificate-programs__title,
.certificate-checklist__title,
.certificate-sessions__title {
  margin-block: 0;
}

/* An office's name above its programs, when more than one office's are listed. */
.certificate-programs__office {
  margin-block: var(--space-2) 0;
}

/* ── Lists of cards: the student's certificates and the programs ───────── */

/* One column on a phone, as many as fit at 18rem each from there, so a card never gets narrower than its words need. */
.certificate-enrollments__list,
.certificate-programs__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  min-inline-size: 0;
}

.certificate-enrollments__card,
.certificate-programs__card {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The program's name is the card's link to its checklist: a target the full line high (WCAG 2.5.8). */
.certificate-enrollments__link {
  display: inline-block;
  min-block-size: var(--target-min);
  padding-block: var(--space-1);
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.certificate-enrollments__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.certificate-enrollments__since,
.certificate-enrollments__note,
.certificate-programs__lede,
.certificate-programs__description,
.certificate-checklist__description,
.certificate-checklist__timeline,
.certificate-sessions__offering {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.certificate-enrollments__note,
.certificate-programs__status,
.certificate-programs__description {
  margin-block-start: var(--space-2);
}

.certificate-enrollments__progress,
.certificate-checklist__summary {
  display: grid;
  gap: var(--space-1);
  margin-block-start: var(--space-2);
}

.certificate-enrollments__count,
.certificate-checklist__count {
  margin-block: 0;
  font-weight: 600;
}

/* The meter beside the words "5 of 8 requirements done" (which name it: aria-labelledby). The words carry the number; the meter is only its picture. */
.certificate-meter {
  appearance: none;
  inline-size: 100%;
  block-size: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--meter-track);
  overflow: hidden;
}

.certificate-meter::-webkit-progress-bar {
  background: var(--meter-track);
  border-radius: var(--radius-sm);
}

.certificate-meter::-webkit-progress-value {
  background: var(--meter-fill);
  border-radius: var(--radius-sm);
}

.certificate-meter::-moz-progress-bar {
  background: var(--meter-fill);
  border-radius: var(--radius-sm);
}

/* The cards in a row are as tall as the tallest, and each one's Apply and Read about sit at its foot, so the buttons line up across the row however long the
   descriptions are. Two classes, because this sheet (25) loads before 35-components.css, whose `.card` and `.card-body` would otherwise win. */
.card.certificate-programs__card,
.certificate-programs__card > .card-body {
  display: flex;
  flex-direction: column;
}
.certificate-programs__card > .card-body {
  flex: 1 1 auto;
}

.certificate-programs__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: auto;
  padding-block-start: var(--space-3);
}

.certificate-programs__form {
  margin: 0;
}

.certificate-programs__more {
  display: inline-block;
  min-block-size: var(--target-min);
  padding-block: var(--space-1);
  color: var(--accent-text);
  overflow-wrap: anywhere;
}

/* ── The checklist ────────────────────────────────────────────────────── */

.certificate-checklist__steps {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A step: the glyph in a column of its own, the words beside it. Done, started and not yet each have a glyph and a tone, and the words say the same. */
.certificate-checklist__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.certificate-checklist__step[data-state="done"] {
  border-color: var(--tone-good-line);
}

.certificate-checklist__glyph {
  display: grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--tone-mute-line);
  background: var(--tone-mute-bg);
  color: var(--tone-mute-fg);
  font-weight: 700;
  line-height: 1;
}

.certificate-checklist__step[data-state="done"] .certificate-checklist__glyph {
  border-color: var(--tone-good-line);
  background: var(--tone-good-bg);
  color: var(--tone-good-fg);
}

.certificate-checklist__step[data-state="started"] .certificate-checklist__glyph {
  border-color: var(--tone-info-line);
  background: var(--tone-info-bg);
  color: var(--tone-info-fg);
}

.certificate-checklist__body {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.certificate-checklist__label {
  margin-block: 0;
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

.certificate-checklist__status {
  margin-block: 0;
  font-weight: 600;
}

.certificate-checklist__evidence {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-1) 0 0;
  padding-inline-start: var(--space-4);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* ── Sessions ─────────────────────────────────────────────────────────── */

.certificate-sessions__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.certificate-sessions__item {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-2);
  border-block-end: 1px solid var(--rule-soft);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.certificate-sessions__name,
.certificate-sessions__when,
.certificate-sessions__attended {
  margin-block: 0;
}

.certificate-sessions__name {
  font-weight: 600;
}

.certificate-sessions__days {
  margin-inline-start: var(--space-2);
  color: var(--fg2);
  font-size: var(--text-sm);
}

/* ── The pages ────────────────────────────────────────────────────────── */

.certificates-page {
  display: grid;
  gap: var(--section-gap);
  min-inline-size: 0;
}

/* ── forms_student: the certificate forms, a student's side (docs/certificates/03-forms-plan.md section 2, C-student-ui) ─────────────
   Under a checklist step, where the student's submission stands (CertificateSubmissionSlotComponent): the state as a badge with a sentence
   beside it, the note sent back set apart as a quotation, and the actions; the page of what was sent (CertificateSubmissionComponent); and
   the pages that hold a form (the application, a requirement's form). The forms themselves are the form system's own. */

.certificate-submission-slot,
.certificate-submission,
.certificate-submission__section,
.certificate-form-page__returned {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.certificate-submission-slot {
  margin-block-start: var(--space-1);
}

.certificate-submission {
  gap: var(--section-gap);
}

.certificate-submission-slot__state,
.certificate-submission__state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-block: 0;
}

.certificate-submission-slot__detail,
.certificate-submission__detail,
.certificate-submission__review,
.certificate-form-page__note {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* The note sent back: someone's words, quoted whole, set off by a rule at the start of the line (it mirrors in a right-to-left language). */
.certificate-submission-slot__note {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  min-inline-size: 0;
}

.certificate-submission-slot__note-label {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.certificate-submission-slot__note-text {
  margin: 0;
  padding-inline-start: var(--space-3);
  border-inline-start: 3px solid var(--tone-warn-line);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.certificate-submission-slot__note-text p {
  margin: 0;
}

.certificate-submission-slot__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* A link the full line high (WCAG 2.5.8). */
.certificate-submission-slot__view {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  text-underline-offset: 0.15em;
}

.certificate-submission__title,
.certificate-form-page__heading {
  margin-block: 0;
  font-size: var(--text-md);
}

/* ── end forms_student ─────────────────────────────────────────────────── */
