/* The public application page. Colours come from the brand variables set by the page. */
.apply-body { background: var(--bg); }
[hidden] { display: none !important; }
.ap-top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.ap-in { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.ap-top .ap-in { padding-top: 12px; padding-bottom: 12px; }
.ap-top img { height: 52px; display: block; }
#apply { padding-top: 40px; padding-bottom: 80px; }
.hero { margin: 0 0 24px; }
.hero h1 { font-size: 32px; letter-spacing: -.8px; line-height: 1.15; }
.hero p { color: var(--ink-2); margin-top: 6px; font-size: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* the form is one sheet; each part has its title on the left and its fields on the right */
#aform { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.sec { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px 36px; padding: 32px 36px; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; }
.sec > header { display: flex; gap: 12px; align-items: flex-start; align-self: start; position: sticky; top: 86px; }
.sec .no { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--navy); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
:root[data-theme="dark"] .sec .no { color: var(--ink); }
.sec h2 { font-size: 16px; line-height: 26px; }
.sbody { min-width: 0; }
.sbody .fgrid { gap: 18px 20px; }
.apply-body .fld > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.apply-body .field-in { height: 44px; padding: 0 14px; border-radius: 10px; }
.apply-body .field-in:hover { border-color: var(--muted); }
.apply-body .fld.locked .field-in { background: var(--soft); color: var(--ink-2); border-style: dashed; cursor: not-allowed; }
.apply-body .fld .hint { font-size: 12px; }
.apply-body .chk { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.apply-body .chk input { margin-top: 3px; flex: none; }
.checks { display: grid; gap: 14px; margin-top: 22px; }
.subrow { display: flex; justify-content: flex-end; margin-top: 26px; }
.btn.big { padding: 14px 32px; font-size: 16px; }

/* the programme picker */
.combo-box { position: relative; }
.plist { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.plist li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.plist li small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.plist li[aria-selected="true"] { background: var(--soft); }
.plist li.none, .plist li.more { cursor: default; color: var(--muted); font-size: 13px; }
.plist li.more { border-top: 1px solid var(--line); border-radius: 0; }
.pchips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.psum { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--navy); background: var(--soft); border-radius: 12px; }
.tag { padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.pdocs .dl + .dl { margin-top: 4px; }
.pdocs { margin-top: 12px; padding: 12px 14px; background: var(--soft); border-radius: 10px; font-size: 14px; color: var(--ink-2); }

/* online identity numbers and the check */
.idblock { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.idblock h3 { font-size: 14px; margin-bottom: 14px; }
.dlbox { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.dlrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dlbox .chk + .dlrow { margin-top: 12px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy-2); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }
:root[data-theme="dark"] .linkbtn { color: var(--ink); }
.more { margin-top: 24px; } .more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 6px 0; }

/* the verify window */
.mdl { position: fixed; inset: 0; background: rgba(0, 16, 48, .45); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.mdl.on { display: flex; }
.mdl-box { background: var(--card); border-radius: 20px; padding: 32px 28px 24px; width: min(400px, 100%); text-align: center; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: pop .2s var(--ease); }
.mdl-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; line-height: 1; }
.mdl-ic.wait { border: 4px solid var(--line); border-top-color: var(--navy); animation: aspin .8s linear infinite; }
.mdl-ic.ok { background: var(--ok-bg); color: var(--ok); } .mdl-ic.bad { background: var(--bad-bg); color: var(--bad); }
.mdl-box h3 { font-size: 20px; } .mdl-box p { color: var(--ink-2); margin-top: 6px; font-size: 14px; }
.mdl-act { margin-top: 22px; }
.mdl-act .btn { min-width: 120px; }
@keyframes aspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mdl-ic.wait { animation-duration: 3s; } }

/* following an application, and the pages after submitting */
#apply > .cardx { margin-bottom: 16px; padding: 24px 28px; }
.cardx h2 { font-size: 16px; margin-bottom: 14px; }
.docin { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.docin:first-of-type { border-top: 0; }
.docin .fname { flex: 1 1 140px; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebtn { cursor: pointer; }
.done { text-align: center; padding: 40px 24px !important; }
.done h1, .done h2 { font-size: 32px; margin-bottom: 10px; } .done p { color: var(--ink-2); max-width: 520px; margin: 0 auto; }
.tick { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 32px; margin: 0 auto 14px; }
.stepper { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.stepper .s { flex: 1 1 100px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.stepper .s i { height: 6px; border-radius: 6px; background: var(--line); display: block; }
.stepper .s.d i { background: var(--ok); } .stepper .s.c i { background: var(--navy); } .stepper .s.c { color: var(--ink); font-weight: 700; }
.alert { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); } .alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.offer { border-color: var(--navy-2); }
.docin .btn.primary { background: var(--brand); color: var(--white); }
.refby { margin-top: 12px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 14px; }

@media (max-width: 720px) {
	.ap-in { padding: 0 16px; }
	#apply { padding-top: 24px; }
	.hero h1 { font-size: 24px; }
	#aform { border-radius: 16px; }
	.sec { grid-template-columns: 1fr; padding: 22px 18px; gap: 16px; }
	.sec > header { position: static; }
	.fgrid { grid-template-columns: 1fr; }
	.subrow .btn.big { width: 100%; }
	#apply > .cardx { padding: 20px 18px; }
}

/* the application form: a check under each document, and the help window */
.dcres { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--soft, #f3f5fa); font-size: 14px; }
.dcres.ok { background: var(--ok-bg); color: var(--ok); } .dcres.warn { background: var(--warn-bg); color: var(--warn); } .dcres.bad { background: var(--bad-bg); color: var(--bad); }
.dcres ul { margin: 6px 0 0 18px; padding: 0; }
.hp-btn { position: fixed; right: 16px; bottom: 16px; z-index: 60; padding: 12px 20px; border-radius: 999px; border: 0; background: var(--brand, #001c59); color: var(--white); font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.22); cursor: pointer; }
.hp-box { position: fixed; right: 16px; bottom: 16px; z-index: 61; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--white); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.28); overflow: hidden; }
.hp-box[hidden] { display: none; }
.hp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--brand, #001c59); color: var(--white); }
.hp-x { background: transparent; border: 0; color: var(--white); font-size: 24px; line-height: 1; cursor: pointer; }
.hp-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.hp-m { max-width: 90%; padding: 9px 12px; border-radius: 14px; font-size: 14px; white-space: pre-line; } .hp-m.a { background: var(--soft, #f3f5fa); align-self: flex-start; } .hp-m.u { background: var(--brand, #001c59); color: var(--white); align-self: flex-end; }
.hp-src { margin-top: 6px; font-size: 12px; } .hp-src a { display: block; color: var(--brand, #001c59); }
.hp-start { padding: 0 14px 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.hp-in { display: flex; gap: 8px; padding: 8px 14px 4px; } .hp-in input { flex: 1; }
.hp-note { margin: 0; padding: 2px 14px 10px; font-size: 12px; color: var(--muted, #5b6480); }
.hp-person { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line, #dfe3ee); padding-top: 10px; }
@media (max-width: 640px) { .hp-box { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: calc(100vh - 16px); } }
/* on a phone the footer and policy links are big enough to touch */
@media (max-width: 760px) { .ap-foot a, .pol-nav a { display: inline-flex; align-items: center; min-height: 44px; } }
.trackbox { margin: 0 0 22px; }

/* sign-in page */
.si-wrap { max-width: 420px; margin: 40px auto; padding: 0 16px; }
.si-card { padding: 28px 24px; }
.si-card h1 { font-size: 24px; margin-bottom: 18px; }
.si-card .fld { margin-bottom: 14px; }
.si-pw { display: flex; gap: 8px; align-items: center; }
.si-pw .field-in { flex: 1; min-width: 0; }
.si-err { color: var(--bad); font-size: 14px; margin: 0 0 12px; }
.si-note { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.si-go { width: 100%; }
.si-link { margin-top: 16px; font-size: 14px; text-align: center; }
.si-link a { display: inline-block; padding: 12px 8px; }
@media (max-width: 760px) { .si-wrap { margin: 20px auto; } }

/* shared by the public pages (footer, jump links, spacing) so no page carries its own style */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; }
.ap-foot a { color: var(--muted); margin: 0 8px; white-space: nowrap; display: inline-block; padding: 10px 0; }
.pol-nav { max-width: 860px; margin: 22px auto 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pol-nav a { padding: 8px 16px; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.pol-nav a:hover { background: var(--card); box-shadow: var(--shadow); }
.ap-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.ap-actions.center { justify-content: center; }
.ap-actions.wrap { flex-wrap: wrap; margin: 12px 0; }
.ap-actions.tight { margin-top: 12px; gap: 8px; justify-content: center; }
.ap-page { padding-top: 40px; padding-bottom: 60px; }
.ap-gap { margin-bottom: 16px; }
.ap-list { margin: 12px 0 0 20px; line-height: 1.7; }
.ap-list.flush { margin-top: 0; }
.ap-wide { width: 100%; }
.ap-cap { text-align: left; font-weight: 700; padding: 6px 0; }
.ap-skel { height: 240px; margin-top: 40px; }
.pol-nav.narrow { max-width: 760px; margin-top: 28px; }
.si-card.done { text-align: center; }
.si-card.done h1 { margin-bottom: 10px; }
.si-card.done .si-note { margin-bottom: 4px; }
/* iPhone and iPad Safari: the help box is as tall as the visible screen, not the screen with the address bar hidden */
@supports (height: 100dvh) {
	.hp-box { max-height: min(560px, calc(100dvh - 32px)); }
	@media (max-width: 640px) { .hp-box { max-height: calc(100dvh - 16px); } }
}
/* a wrong or missing entry is shown beside its box */
.ferr { color: var(--bad); font-size: 13px; margin-top: 4px; font-weight: 600; }
.apply-body .field-in[aria-invalid="true"], .apply-body select[aria-invalid="true"] { border-color: var(--bad); }
.fsent { margin-top: 4px; }
.dnote { margin: -6px 0 12px; } .dnote summary { cursor: pointer; font-size: 13px; color: var(--muted); }
/* on a phone the advice about a document and the reason it was sent back get a full-width line of their own under the row */
@media (max-width: 640px) { .docin .grow { flex: 1 1 100%; } .docin .dcres, .docin .alert { width: 100%; } }

/* the graduate's reply page for the convocation ceremony */
.rv-ch { border: 0; padding: 0; margin: 14px 0; }
.rv-ch legend { font-weight: 700; margin-bottom: 6px; }
.rv-opt { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.rv-tickets { margin: 8px 0; padding-left: 18px; }

.si-more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.si-more summary { cursor: pointer; font-size: 14px; color: var(--navy); }
.si-more form { margin-top: 14px; }
.si-act { margin: 0 0 14px; }

.si-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* the addresses and the emergency contact of the application form (21 November 2026): the residential boxes and the Emergency contact heading sit inside the same grid and take the whole row, so the boxes keep the width of the others */
.fgrid > .fgrid, .fgrid > h3 { grid-column: 1 / -1; }
.fgrid > .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
@media (max-width: 760px) { .fgrid > .fgrid { grid-template-columns: 1fr; } }
