/* ==================================================================
   Smart Grid Lab – "Join Us" page (/join/) and the private application
   page (/join/apply/).

   Every rule is scoped under .apply-page, so the rest of the site
   (franklin.css, basic.css, custom.css) is unaffected. Fonts, heading
   sizes and heading markup come from franklin.css like on every other
   page; this file only adds the SDSU colors and the form styling.

   SDSU palette (brand.sdsu.edu): Dark Red #A6192E (primary accent),
   Dark Teal #008080 (secondary accent), Charcoal #2D2828 (text),
   Light Gray #CDCDC8 (decorative rules only).
   Contrast: text >= 4.5:1, control borders and focus rings >= 3:1.
   Corners: square everywhere via --ap-radius (radio buttons,
   checkboxes and slider thumbs keep their native round shapes).
================================================================== */

.apply-page {
  --ap-red: #a6192e;          /* SDSU Dark Red: buttons, rules, focus, required "*" (7.5:1 on white) */
  --ap-red-dark: #7f1424;     /* hover / pressed */
  --ap-red-soft: #fbf1f2;     /* error background */
  --ap-teal: #008080;         /* SDSU Dark Teal: success, confirmation, check marks, notes (4.8:1) */
  --ap-teal-text: #006b6b;    /* teal for text on tinted backgrounds (5.8:1 on --ap-teal-soft) */
  --ap-teal-soft: #eef6f6;
  --ap-text: #2d2828;         /* SDSU Charcoal (14:1) */
  --ap-muted: #5c5656;        /* secondary text (7:1) */
  --ap-link: #004de6;         /* the site's link color (6.5:1) */
  --ap-line: #cdcdc8;         /* SDSU Light Gray: decorative rules and card outlines */
  --ap-border: #858080;       /* form-control boundaries (3.7:1) */
  --ap-surface: #f5f5f3;      /* light panels */
  --ap-focus: #a6192e;        /* focus ring (opaque, 7.5:1) */
  --ap-radius: 0;
  color: var(--ap-text);
}

.apply-page *,
.apply-page *::before,
.apply-page *::after { box-sizing: border-box; }

.apply-page [hidden] { display: none !important; }

/* ------------------------------------------------------------------
   Headings: franklin.css sizes and markup; SDSU red section rules
------------------------------------------------------------------ */

.apply-page h2 { border-bottom: 2px solid var(--ap-red); }

.apply-page .ap-program {
  margin: -0.4em 0 1em;
  font-weight: 700;
  color: var(--ap-text);
}

/* Links inside running text are underlined (the link color alone is too close to the text color). */
.apply-page p a,
.apply-page li a,
.apply-page .ap-hint a {
  color: var(--ap-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.apply-page :focus-visible {
  outline: 3px solid var(--ap-focus);
  outline-offset: 2px;
}

/* Visually hidden (still read by screen readers), and the honeypot. */
.apply-page .ap-vh,
.apply-page .ap-hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.apply-page .ap-break { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------
   Position description (Join page)
------------------------------------------------------------------ */

.apply-page .ap-list { padding-left: 1.4em; }
.apply-page .ap-list > li { margin: 0 0 0.55em; }
.apply-page .ap-list > li::marker { color: var(--ap-red); }
.apply-page .ap-steps > li::marker { font-weight: 700; }

/* Informational note: SDSU teal rule on the left. */
.apply-page .ap-note {
  margin: 1.2em 0 0;
  padding: 12px 16px;
  border-left: 4px solid var(--ap-teal);
  border-radius: var(--ap-radius);
  background: var(--ap-teal-soft);
  font-size: 17px;
  line-height: 1.45;
}

.apply-page .ap-meta {
  margin: -0.3em 0 1em;
  font-size: 16px;
  color: var(--ap-muted);
}

.apply-page .ap-privacy {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ap-muted);
}

.apply-page h3#privacy_notice { margin: 1.6em 0 0.4em; }

/* Request-link form: a plain bordered panel with an SDSU red top rule. */
.apply-page .ap-request {
  margin: 0 0 1.2em;
  padding: 18px 20px 20px;
  border: 1px solid var(--ap-line);
  border-top: 3px solid var(--ap-red);
  border-radius: var(--ap-radius);
  background: #fff;
}

/* ------------------------------------------------------------------
   Private application page
------------------------------------------------------------------ */

.apply-page .ap-loading {
  margin: 1em 0;
  padding: 14px 16px;
  border: 1px dashed var(--ap-border);
  border-radius: var(--ap-radius);
  font-size: 17px;
  color: var(--ap-muted);
}

.apply-page .ap-state { font-size: 17px; }
.apply-page .ap-welcome { margin-top: 0; }

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */

.apply-page .ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--ap-radius);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.apply-page .ap-btn-primary {
  background: var(--ap-red);
  border-color: var(--ap-red);
  color: #fff;
}

.apply-page .ap-btn-primary:hover,
.apply-page .ap-btn-primary:active {
  background: var(--ap-red-dark);
  border-color: var(--ap-red-dark);
}

.apply-page .ap-btn-secondary {
  background: #fff;
  border-color: var(--ap-red);
  color: var(--ap-red);
}

.apply-page .ap-btn-secondary:hover { background: var(--ap-red-soft); }

.apply-page .ap-btn-sm {
  min-height: 40px;
  padding: 7px 16px;
  font-size: 16px;
}

.apply-page .ap-btn-lg {
  min-height: 50px;
  padding: 12px 30px;
  font-size: 18px;
}

.apply-page .ap-btn[disabled],
.apply-page .ap-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.apply-page .ap-btn-primary[aria-disabled="true"]:hover {
  background: var(--ap-red);
  border-color: var(--ap-red);
}

.apply-page .ap-link-btn {
  padding: 4px 2px;
  border: 0;
  border-radius: var(--ap-radius);
  background: none;
  color: var(--ap-link);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.apply-page .ap-link-btn:hover { color: var(--ap-text); }

/* ------------------------------------------------------------------
   Notices, draft bar, error summary
------------------------------------------------------------------ */

.apply-page .ap-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--ap-line);
  border-left-width: 5px;
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  font-size: 16px;
  line-height: 1.45;
}

.apply-page .ap-notice p { margin: 0; }
.apply-page .ap-notice p + p { margin-top: 8px; }
/* A notice receives focus only from script (tabindex="-1"), so that screen readers read it;
   it is not interactive and shows no focus ring (like the confirmation panels). */
.apply-page .ap-notice[tabindex="-1"]:focus,
.apply-page .ap-notice[tabindex="-1"]:focus-visible { outline: none; }

.apply-page .ap-notice-info {
  border-color: #b3d6d6;
  border-left-color: var(--ap-teal);
  background: var(--ap-teal-soft);
}

.apply-page .ap-notice-warn {
  border-left-color: var(--ap-text);
}

.apply-page .ap-notice-error {
  border-color: #e3b5bc;
  border-left-color: var(--ap-red);
  background: var(--ap-red-soft);
}

.apply-page .ap-notice-error strong { color: var(--ap-red); }

.apply-page .ap-form { font-size: 17px; line-height: 1.45; }

.apply-page .ap-draftbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  font-size: 15px;
  color: var(--ap-muted);
}

.apply-page .ap-draft-text { flex: 1 1 320px; margin: 0; }

.apply-page .ap-required-note {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ap-muted);
}

.apply-page .ap-error-summary {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 2px solid var(--ap-red);
  border-left-width: 8px;
  border-radius: var(--ap-radius);
  background: var(--ap-red-soft);
}

.apply-page .ap-error-summary:focus { outline: none; }
.apply-page .ap-error-summary:focus-visible { outline: 3px solid var(--ap-focus); outline-offset: 2px; }

.apply-page .ap-error-summary .ap-summary-title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 18px;
  color: var(--ap-red);
}

.apply-page .ap-error-summary ul { margin: 0; padding-left: 22px; }
.apply-page .ap-error-summary li { margin: 3px 0; }

.apply-page .ap-error-summary a {
  color: var(--ap-red);
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   Sections (fieldsets) and fields
------------------------------------------------------------------ */

.apply-page fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.apply-page .ap-section { margin: 0 0 8px; }

/* The legend holds the section's h2; floating it makes it behave like a normal block. */
.apply-page .ap-section > .ap-legend {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
}

.apply-page .ap-section > .ap-legend + * { clear: both; }

.apply-page .ap-section-title { line-height: 1.3; }

.apply-page .ap-section-intro {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--ap-muted);
}

.apply-page .ap-subhead {
  margin: 28px 0 12px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--ap-line);
  line-height: 1.3;
}

.apply-page .ap-optional {
  font-weight: 400;
  color: var(--ap-muted);
}

.apply-page .ap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 22px;
}

.apply-page .ap-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.apply-page .ap-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.apply-page .ap-field > label,
.apply-page .ap-gpa-row label,
.apply-page .ap-subfieldset > legend,
.apply-page .ap-file-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ap-text);
}

.apply-page .ap-req {
  margin-left: 1px;
  color: var(--ap-red);
  font-weight: 700;
}

.apply-page .ap-hint {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ap-muted);
}

/* Errors: dark red text, a visible "Error:" label and a red rule, never color alone. */
.apply-page .ap-error {
  margin: 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--ap-red);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ap-red);
}

.apply-page .ap-error-label { font-weight: 800; }

.apply-page .ap-counter {
  margin: 0;
  font-size: 14px;
  color: var(--ap-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.apply-page .ap-counter.is-over {
  color: var(--ap-red);
  font-weight: 700;
}

.apply-page input[type="text"],
.apply-page input[type="email"],
.apply-page input[type="tel"],
.apply-page input[type="url"],
.apply-page input[type="number"],
.apply-page select,
.apply-page textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background: #fff;
  color: var(--ap-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.apply-page textarea {
  min-height: 0;
  resize: vertical;
}

.apply-page select {
  padding-right: 30px;
  text-overflow: ellipsis;
}

.apply-page input::placeholder,
.apply-page textarea::placeholder { color: #6f6969; opacity: 1; }

.apply-page input:focus,
.apply-page select:focus,
.apply-page textarea:focus { border-color: var(--ap-red); }

/* The verified email address cannot be edited. */
.apply-page input[readonly] {
  background: var(--ap-surface);
  border-style: dashed;
  cursor: default;
}

.apply-page [aria-invalid="true"]:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="file"]) {
  border-color: var(--ap-red);
  box-shadow: inset 0 0 0 1px var(--ap-red);
}

.apply-page input[type="checkbox"],
.apply-page input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ap-red);
}

/* An invalid check box keeps the normal focus ring (an outline here would hide which box has
   the focus); the "Error:" line below marks the error, and an interest tile turns red too. */
.apply-page .ap-interest:has(> input[aria-invalid="true"]) { border-color: var(--ap-red); }

.apply-page .ap-gpa-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.apply-page .ap-subfieldset > legend { margin: 0 0 8px; padding: 0; }

/* Spacing helper; the second rule wins over .ap-subfieldset's margin reset. */
.apply-page .ap-gap-top,
.apply-page .ap-subfieldset.ap-gap-top { margin-top: 20px; }

/* Yes / No choices as square segmented buttons. The real radio covers the button,
   so it gets every click and keyboard interaction; the span only shows the state. */
.apply-page .ap-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apply-page .ap-choice {
  position: relative;
  display: inline-flex;
}

.apply-page .ap-choice input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.apply-page .ap-choice span {
  display: inline-block;
  min-width: 76px;
  padding: 8px 18px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background: #fff;
  color: var(--ap-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.apply-page .ap-choice:hover span { border-color: var(--ap-red); }

.apply-page .ap-choice input:checked + span {
  background: var(--ap-red);
  border-color: var(--ap-red);
  color: #fff;
}

.apply-page .ap-choice input:focus-visible + span {
  outline: 3px solid var(--ap-focus);
  outline-offset: 2px;
}

.apply-page .ap-choice input[aria-invalid="true"] + span {
  border-color: var(--ap-red);
  box-shadow: inset 0 0 0 1px var(--ap-red);
}

/* Windows High Contrast / forced colors replaces the red fill: mark the chosen answer with the
   system highlight colors instead. */
@media (forced-colors: active) {
  .apply-page .ap-choice input:checked + span {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }
}

/* ------------------------------------------------------------------
   Request form checkbox, research interests, consent checkboxes
------------------------------------------------------------------ */

.apply-page .ap-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.apply-page .ap-check input { flex: none; margin-top: 2px; }

.apply-page .ap-field > label.ap-check { font-size: 16px; font-weight: 400; }

.apply-page .ap-count {
  margin-left: 6px;
  font-weight: 700;
  color: var(--ap-text);
}

.apply-page .ap-interests {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.apply-page .ap-interest {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: #fff;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.apply-page .ap-interest input { flex: none; margin-top: 1px; }

.apply-page .ap-interest.is-checked,
.apply-page .ap-course.is-checked {
  border-color: var(--ap-red);
  box-shadow: inset 4px 0 0 var(--ap-red);
}

.apply-page .ap-interest.is-disabled {
  color: var(--ap-muted);
  background: var(--ap-surface);
  cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Background (yes / no) questions
------------------------------------------------------------------ */

.apply-page .ap-yn {
  padding: 14px 0;
  border-top: 1px solid var(--ap-line);
}

.apply-page .ap-yn:first-child { border-top: 0; padding-top: 4px; }

.apply-page .ap-yn > legend {
  float: left;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  font-size: 17px;
  line-height: 1.45;
}

.apply-page .ap-yn-num {
  font-weight: 700;
  color: var(--ap-red);
  margin-right: 4px;
}

.apply-page .ap-yn .ap-choices { clear: both; }

.apply-page .ap-yn .ap-error {
  clear: both;
  margin-top: 8px;
}

/* ------------------------------------------------------------------
   Self-assessment sliders
------------------------------------------------------------------ */

.apply-page .ap-scale-caption {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ap-muted);
}

.apply-page .ap-scale {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
}

.apply-page .ap-scale li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
  font-size: 14px;
  line-height: 1.3;
}

.apply-page .ap-scale-num {
  flex: none;
  min-width: 28px;
  height: 24px;
  border: 1px solid var(--ap-red);
  border-radius: var(--ap-radius);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  color: var(--ap-red);
}

.apply-page .ap-conf-group { margin-top: 24px; }

.apply-page .ap-conf-group-title {
  margin: 0 0 4px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--ap-line);
  line-height: 1.3;
}

.apply-page .ap-conf-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 20px;
  padding: 12px 0;
  border-bottom: 1px solid #e6e6e2;
}

.apply-page .ap-conf-label {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.apply-page .ap-conf-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "slider num" "desc desc";
  align-items: center;
  column-gap: 12px;
}

.apply-page .ap-conf-control input[type="range"] { grid-area: slider; }

.apply-page .ap-conf-val { display: contents; }

.apply-page .ap-conf-num {
  grid-area: num;
  min-width: 36px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.apply-page .ap-conf-val.is-set .ap-conf-num {
  background: var(--ap-red);
  border-color: var(--ap-red);
  color: #fff;
}

.apply-page .ap-conf-desc {
  grid-area: desc;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ap-muted);
}

/* Range input: SDSU red filled track (via --pct, set by apply.js), round thumb. */
.apply-page input[type="range"] {
  --pct: 0%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.apply-page input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--ap-radius);
  background: linear-gradient(to right, var(--ap-red) 0, var(--ap-red) var(--pct), var(--ap-border) var(--pct), var(--ap-border) 100%);
}

.apply-page input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid var(--ap-red);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(45, 40, 40, 0.3);
}

.apply-page input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: var(--ap-radius);
  background: var(--ap-border);
}

.apply-page input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: var(--ap-radius);
  background: var(--ap-red);
}

.apply-page input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ap-red);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(45, 40, 40, 0.3);
}

/* ------------------------------------------------------------------
   Coursework
------------------------------------------------------------------ */

.apply-page .ap-courses {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.apply-page .ap-course {
  padding: 10px 12px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: #fff;
  min-width: 0;
}

.apply-page .ap-course.has-error { border-color: var(--ap-red); }

.apply-page .ap-course-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.apply-page .ap-course-main input { flex: none; margin-top: 1px; }

.apply-page .ap-course-details {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 10px;
  padding-left: 30px;
}

.apply-page .ap-course-details label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

.apply-page .ap-course-details select,
.apply-page .ap-course-details input[type="text"] {
  min-height: 40px;
  padding: 6px 10px;
  font-size: 16px;
}

.apply-page .ap-course-details select { padding-right: 26px; }

.apply-page .ap-course-details .ap-error { grid-column: 1 / -1; }

/* ------------------------------------------------------------------
   Documents
------------------------------------------------------------------ */

.apply-page .ap-files {
  display: grid;
  gap: 12px;
}

.apply-page .ap-file {
  padding: 14px 16px;
  border: 1px solid var(--ap-line);
  border-left-width: 4px;
  border-radius: var(--ap-radius);
  background: #fff;
  min-width: 0;
}

.apply-page .ap-file.has-file {
  border-left-color: var(--ap-teal);
  background: #fafdfd;
}

.apply-page .ap-file.has-error {
  border-color: #e3b5bc;
  border-left-color: var(--ap-red);
  background: var(--ap-red-soft);
}

.apply-page .ap-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.apply-page .ap-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

/* No overflow:hidden here: it would clip the focus ring of the button below. */
.apply-page .ap-file-pick {
  position: relative;
  display: inline-flex;
  flex: none;
}

/* The real file input covers the visible button (opacity 0), so a click anywhere on the
   button opens the file picker; the button shows the input's keyboard focus. */
.apply-page .ap-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  font-size: 0;
}

.apply-page .ap-file-input:focus-visible + .ap-btn {
  outline: 3px solid var(--ap-focus);
  outline-offset: 2px;
}

.apply-page .ap-file-pick:hover .ap-btn { background: var(--ap-red-soft); }

.apply-page .ap-file-status {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 15px;
  color: var(--ap-muted);
  overflow-wrap: anywhere;
}

.apply-page .ap-file.has-file .ap-file-status {
  color: var(--ap-teal-text);
  font-weight: 700;
}

.apply-page .ap-file.has-file .ap-file-status::before {
  content: "\2713\00a0";
  color: var(--ap-teal);
}

.apply-page .ap-file-remove { flex: none; }

.apply-page .ap-files-total {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--ap-muted);
  text-align: right;
}

.apply-page .ap-files-total.is-over {
  color: var(--ap-red);
  font-weight: 700;
}

.apply-page .ap-files-reattach { font-size: 16px; }

/* ------------------------------------------------------------------
   Consent, submit, progress, confirmation
------------------------------------------------------------------ */

.apply-page .ap-form .ap-privacy,
.apply-page #ap-privacy-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--ap-teal);
  border-radius: var(--ap-radius);
  background: var(--ap-teal-soft);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ap-text);
}

.apply-page .ap-consents {
  display: grid;
  gap: 14px;
}

.apply-page .ap-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 22px;
}

.apply-page .ap-status,
.apply-page .ap-submit-note {
  flex: 1 1 200px;
  margin: 0;
  font-size: 15px;
  color: var(--ap-muted);
}

.apply-page .ap-request .ap-notice-error { margin: 16px 0 0; }

.apply-page .ap-progress { margin-top: 16px; }

.apply-page .ap-progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
}

.apply-page .ap-progress-bar {
  width: 0;
  height: 100%;
  background: var(--ap-red);
  transition: width 0.2s ease;
}

.apply-page .ap-progress.is-indeterminate .ap-progress-bar {
  width: 35%;
  animation: ap-indeterminate 1.3s ease-in-out infinite;
}

@keyframes ap-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(290%); }
}

.apply-page .ap-progress-text {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--ap-muted);
}

.apply-page .ap-submit-error {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid #e3b5bc;
  border-left: 5px solid var(--ap-red);
  border-radius: var(--ap-radius);
  background: var(--ap-red-soft);
  font-size: 16px;
}

.apply-page .ap-submit-error strong { color: var(--ap-red); }
.apply-page .ap-submit-error p,
.apply-page .ap-form .ap-privacy p { margin: 0; }
.apply-page .ap-submit-error p + p { margin-top: 8px; }

/* Success / confirmation: SDSU teal. */
.apply-page .ap-confirmation {
  margin: 1em 0 1.5em;
  padding: 18px 22px;
  border: 1px solid #b3d6d6;
  border-left: 6px solid var(--ap-teal);
  border-radius: var(--ap-radius);
  background: var(--ap-teal-soft);
  font-size: 17px;
  line-height: 1.5;
}

.apply-page .ap-confirmation p { margin: 0 0 0.6em; }
.apply-page .ap-confirmation p:last-child { margin-bottom: 0; }
/* The panel only receives focus from script (tabindex="-1") so that screen readers announce
   it; it is not interactive, so it shows no focus ring. */
.apply-page .ap-confirmation:focus,
.apply-page .ap-confirmation:focus-visible { outline: none; }

.apply-page .ap-confirmation .ap-confirm-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  line-height: 1.3;
  color: var(--ap-teal-text);
}

.apply-page .ap-confirm-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ap-radius);
  background: var(--ap-teal);
  color: #fff;
}

.apply-page .ap-confirm-ref { font-size: 18px; }

.apply-page .ap-confirmation .ap-again { margin-top: 0.8em; }

.apply-page code {
  padding: 2px 8px;
  border: 1px solid #b3d6d6;
  border-radius: var(--ap-radius);
  background: #fff;
  color: var(--ap-text);
  font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------
   Responsive layout
------------------------------------------------------------------ */

@media (min-width: 720px) {
  .apply-page .ap-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apply-page .ap-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apply-page .ap-span-2 { grid-column: 1 / -1; }
  .apply-page .ap-interests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apply-page .ap-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Question on the left, Yes / No on the right. */
  .apply-page .ap-yn > legend {
    width: calc(100% - 190px);
    margin-bottom: 0;
  }
  .apply-page .ap-yn .ap-choices {
    clear: none;
    float: right;
    flex-wrap: nowrap;
  }
}

@media (min-width: 940px) {
  .apply-page .ap-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .apply-page .ap-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .apply-page .ap-scale li { flex-direction: column; gap: 4px; }

  /* Label | slider | value on a single row. */
  .apply-page .ap-conf-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
  }
  .apply-page .ap-conf-control {
    grid-template-columns: minmax(0, 1fr) auto 9.5rem;
    grid-template-areas: "slider num desc";
  }
}

@media (max-width: 480px) {
  .apply-page .ap-request { padding: 14px 12px 16px; }
  .apply-page .ap-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apply-page .ap-course-details { padding-left: 0; grid-template-columns: minmax(0, 1fr); }
  .apply-page .ap-file { padding: 12px; }
  .apply-page .ap-submit-row .ap-btn { width: 100%; }
  .apply-page .ap-confirmation { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .apply-page .ap-btn,
  .apply-page .ap-choice span,
  .apply-page .ap-progress-bar { transition: none; }
  .apply-page .ap-progress.is-indeterminate .ap-progress-bar {
    width: 100%;
    animation: none;
    opacity: 0.45;
  }
}
