/* ==========================================================================
   Public admission application (/application)
   Builds on portal.css tokens.
   ========================================================================== */

.p-apply { background: var(--p-bg); }
.ap-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.ap-nav {
    background: #fff;
    border-bottom: 1px solid var(--p-line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.ap-nav .ap-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.ap-brand { display: flex; align-items: center; gap: 12px; color: var(--p-ink); min-width: 0; }
.ap-brand:hover { color: var(--p-ink); }
.ap-brand img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.ap-brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ap-brand strong { font-family: var(--p-font-display); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-brand small { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p-green-600); margin-top: 2px; }
.ap-nav-links { display: flex; align-items: center; gap: 6px; }
.ap-nav-links .btn { margin: 0; }
.ap-link { font-size: 13.5px; font-weight: 600; color: var(--p-ink-2); padding: 8px 12px; border-radius: 10px; }
.ap-link:hover { background: var(--p-bg); color: var(--p-ink); }

/* Hero */
.ap-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(70% 120% at 100% 0%, rgba(244, 180, 0, .20) 0%, rgba(244, 180, 0, 0) 55%),
        linear-gradient(120deg, var(--p-green-800) 0%, var(--p-green-900) 55%, var(--p-green-950) 100%);
    padding: 52px 0 96px;
}
.ap-hero:after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -160px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 56px solid rgba(255, 255, 255, .04);
    pointer-events: none;
}
.ap-hero .ap-container { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.ap-hero .p-eyebrow { color: var(--p-gold); }
.ap-hero h1 {
    font-family: var(--p-font-display);
    font-weight: 600;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: -.015em;
    color: #fff;
    margin: 0 0 14px;
    max-width: 760px;
}
.ap-intro, .ap-intro p { color: rgba(255, 255, 255, .8); font-size: 15.5px; line-height: 1.65; max-width: 680px; margin: 0; }
.ap-intro a { color: var(--p-gold); text-decoration: underline; }
.ap-hero-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.ap-hero-steps span {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px 7px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 13px; font-weight: 600; color: #fff;
}
.ap-hero-steps b {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--p-gold); color: var(--p-green-950); font-size: 12px;
}
.ap-hero-seal {
    width: 132px; height: 132px; flex: none;
    border-radius: 50%;
    background: #fff;
    padding: 8px;
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .45);
}
.ap-hero-seal img { width: 100%; height: 100%; object-fit: contain; }

/* Layout */
.ap-main { margin-top: -56px; padding-bottom: 56px; position: relative; z-index: 2; }
.ap-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.ap-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.ap-panel {
    background: #fff;
    border: 1px solid var(--p-line);
    border-radius: var(--p-r-lg);
    padding: 20px;
    box-shadow: var(--p-shadow-sm);
}
.ap-panel h3 { font-size: 15px; font-weight: 700; margin: 0 0 14px; color: var(--p-ink); }
.ap-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ap-checklist li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--p-ink-2); }
.ap-checklist i {
    width: 22px; height: 22px; flex: none; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--p-green-50); color: var(--p-green-700); font-size: 11px; margin-top: 1px;
}
.ap-checklist small { display: block; color: var(--p-faint); font-size: 12px; }
.ap-help a { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--p-ink-2); padding: 6px 0; word-break: break-word; }
.ap-help a:hover { color: var(--p-green-700); }
.ap-help a i { color: var(--p-green-600); width: 16px; text-align: center; }
.ap-help p { font-size: 13px; color: var(--p-muted); margin: 0 0 8px; }

.ap-card {
    background: #fff;
    border: 1px solid var(--p-line);
    border-radius: 22px;
    box-shadow: var(--p-shadow);
    overflow: hidden;
}

/* Stepper (jQuery Steps markup) */
.p-apply .wizard > .steps {
    padding: 22px 28px !important;
    margin: 0;
    border-bottom: 1px solid var(--p-line-2);
    background: #fbfcfb;
}
.p-apply .wizard > .steps > ul { display: flex; gap: 0; flex-wrap: nowrap; }
.p-apply .wizard > .steps > ul > li { flex: 1 1 0; display: flex; align-items: center; float: none; width: auto; }
.p-apply .wizard > .steps > ul > li:last-child { flex: 0 0 auto; }
/* connector line after each step except the last */
.p-apply .wizard > .steps > ul > li:not(:last-child):after {
    content: "";
    flex: 1 1 auto;
    height: 2px;
    min-width: 16px;
    margin: 0 16px;
    border-radius: 2px;
    background: var(--p-line);
}
.p-apply .wizard > .steps > ul > li.done:not(:last-child):after { background: var(--p-green-600); }
.p-apply .wizard > .steps a,
.p-apply .wizard > .steps a:hover,
.p-apply .wizard > .steps a:active,
.p-apply .wizard > .steps .current a,
.p-apply .wizard > .steps .current a:hover,
.p-apply .wizard > .steps .done a,
.p-apply .wizard > .steps .disabled a {
    background: transparent !important;
    padding: 0 !important;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--p-faint) !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 0 !important;
}
.p-apply .wizard > .steps .number {
    width: 40px; height: 40px; flex: none;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
    background: #fff;
    border: 2px solid var(--p-line);
    color: var(--p-faint);
    transition: all .2s ease;
}
.p-apply .wizard > .steps .ap-step-text { display: flex; flex-direction: column; line-height: 1.25; }
.p-apply .wizard > .steps .ap-step-text small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--p-faint); }
.p-apply .wizard > .steps .current a { color: var(--p-ink) !important; }
.p-apply .wizard > .steps .current .number { background: var(--p-green-700); border-color: var(--p-green-700); color: #fff; box-shadow: 0 0 0 5px rgba(16, 128, 73, .14); }
.p-apply .wizard > .steps .current .ap-step-text small { color: var(--p-green-600); }
.p-apply .wizard > .steps .done a { color: var(--p-ink-2) !important; }
.p-apply .wizard > .steps .done .number { background: var(--p-green-50); border-color: var(--p-green-100); color: var(--p-green-700); font-size: 0; }
.p-apply .wizard > .steps .done .number:after { content: "\f00c"; font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome"; font-weight: 900; font-size: 14px; }
.p-apply .wizard > .steps .error .number { border-color: var(--p-red); color: var(--p-red); background: var(--p-red-50); }

/* Step bodies */
.p-apply .wizard > .content { min-height: 0; overflow: visible; }
.p-apply .wizard > .content > .body { padding: 8px 28px 8px; margin: 0 !important; position: relative; }
.ap-section { padding: 24px 0; border-bottom: 1px solid var(--p-line-2); }
.ap-section:last-child { border-bottom: 0; }
.ap-section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.ap-section-head i {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--p-green-50); color: var(--p-green-700); font-size: 14px;
}
.ap-section-head h4 { font-size: 16px; font-weight: 700; margin: 0; color: var(--p-ink); letter-spacing: -.005em; }
.ap-section-head p { font-size: 13px; color: var(--p-muted); margin: 2px 0 0; }
.ap-subhead { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--p-muted); margin: 4px 0 12px; }
.ap-section .row { --bs-gutter-x: 16px; }
.ap-section .form-group { margin-bottom: 16px; }
.p-apply .wizard > .content > .body label { font-size: 13px; }
.p-apply .wizard > .content > .body label > span { color: var(--p-red); }
.ap-optional { font-weight: 500; color: var(--p-faint); font-size: 12px; margin-left: 4px; }
.ap-hint { display: block; font-size: 12px; color: var(--p-faint); margin-top: 5px; }

/* Validation messages from jquery.validate */
.p-apply .wizard > .content > .body label.error,
.p-apply label.ap-error {
    display: block;
    color: var(--p-red);
    font-size: 12px;
    font-weight: 500;
    margin: 6px 0 0;
}
.p-apply .wizard > .content > .body label.error:before { content: "\f06a"; font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome"; font-weight: 900; margin-right: 6px; }

/* Upload tiles */
.ap-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1.5px dashed #c9d3cc;
    border-radius: 14px;
    background: #fbfcfb;
    transition: border-color .15s, background-color .15s;
    cursor: pointer;
    min-height: 116px;
}
.ap-upload:hover, .ap-upload.is-dragover { border-color: var(--p-green-600); background: var(--p-green-50); }
.ap-upload.has-file { border-style: solid; border-color: var(--p-green-100); background: #fff; }
.ap-upload.has-error { border-color: var(--p-red); background: var(--p-red-50); }
.ap-upload input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    min-height: 0;
    padding: 0;
    border: 0;
}
.ap-upload-preview {
    width: 80px; height: 80px; flex: none;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--p-line);
    display: flex; align-items: center; justify-content: center;
    color: var(--p-faint); font-size: 24px;
    overflow: hidden;
}
.ap-upload-preview.is-wide { width: 120px; height: 56px; }
.ap-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.ap-upload-preview.is-wide img { object-fit: contain; }
.ap-upload-text { min-width: 0; }
.ap-upload-text strong { display: block; font-size: 14.5px; color: var(--p-ink); }
.ap-upload-text span { display: block; font-size: 12.5px; color: var(--p-muted); margin-top: 2px; }
.ap-upload-text em { display: block; font-style: normal; font-size: 12.5px; color: var(--p-green-700); font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-upload-text em:empty { display: none; }
.ap-upload label.error { position: absolute; left: 18px; bottom: -22px; margin: 0 !important; }

.ap-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--p-gold-50);
    border: 1px solid var(--p-gold-100);
    color: #6b4d00;
    font-size: 13.5px;
    line-height: 1.5;
}
.ap-note i { color: var(--p-gold-600); margin-top: 2px; }

/* Actions bar — inside the card, not floating */
.p-apply .wizard > .actions {
    position: static;
    display: block;
    border: 0;
    border-top: 1px solid var(--p-line-2);
    border-radius: 0;
    box-shadow: none;
    background: #fbfcfb;
    padding: 16px 28px;
}
.p-apply .wizard > .actions > ul { display: flex; justify-content: space-between; width: 100%; gap: 10px; }
.p-apply .wizard > .actions > ul > li:first-child { margin-right: auto; }
.p-apply .wizard > .actions a,
.p-apply .wizard > .actions a:hover,
.p-apply .wizard > .actions a:active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    background: var(--p-green-700);
    color: #fff;
}
.p-apply .wizard > .actions a:hover { background: var(--p-green-800); }
.p-apply .wizard > .actions a[href="#previous"] { background: #fff; color: var(--p-ink-2); border: 1px solid var(--p-line); }
.p-apply .wizard > .actions a[href="#previous"]:hover { background: var(--p-bg); color: var(--p-ink); }
.p-apply .wizard > .actions .disabled { visibility: hidden; }
.p-apply .wizard > .actions a[href="#finish"] { background: var(--p-gold); color: var(--p-green-950); }
.p-apply .wizard > .actions a[href="#finish"]:hover { background: var(--p-gold-600); }

/* Footer */
.ap-footer { border-top: 1px solid var(--p-line); background: #fff; padding: 22px 0; font-size: 12.5px; color: var(--p-faint); }
.ap-footer .ap-container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ap-footer a { color: var(--p-muted); }

/* Responsive */
@media (max-width: 991px) {
    .ap-grid { grid-template-columns: 1fr; }
    .ap-aside { position: static; order: 2; }
    .ap-hero-seal { display: none; }
}
@media (max-width: 767px) {
    .ap-container { padding: 0 16px; }
    .ap-nav .ap-container { min-height: 64px; }
    .ap-brand img { width: 38px; height: 38px; }
    .ap-brand strong { font-size: 15px; }
    .ap-link { display: none; }
    .ap-hero { padding: 32px 0 80px; }
    .ap-intro, .ap-intro p { font-size: 14.5px; }
    .p-apply .wizard > .steps { padding: 16px !important; }
    .p-apply .wizard > .steps .ap-step-text { display: none; }
    .p-apply .wizard > .steps .current .ap-step-text { display: flex; }
    .p-apply .wizard > .content > .body { padding: 4px 16px; }
    .p-apply .wizard > .actions { padding: 14px 16px; }
    .ap-upload { padding: 14px; }
    .ap-upload-preview { width: 64px; height: 64px; }
}

/* Fixes: inherited label>span colours and wizard inset */
.p-apply .wizard-sec-bg { padding: 0; background: transparent; }
.p-apply .wizard > .content > .body label > span.ap-optional,
.p-apply label > span.ap-optional { color: var(--p-faint); font-weight: 500; }
.p-apply .ap-upload > span,
.p-apply .wizard > .content > .body .ap-upload > span { color: inherit; }
.p-apply .ap-upload .ap-upload-preview { color: var(--p-faint); }
.p-apply .ap-upload-text > span { display: block; font-size: 12.5px; color: var(--p-muted); margin-top: 2px; }
.p-apply .ap-upload-text strong span { display: inline; color: var(--p-red); margin: 0; }
.p-apply .ap-upload-text strong { font-size: 14.5px; color: var(--p-ink); }
@media (max-width: 767px) {
    .p-apply .wizard > .steps .ap-step-text small { display: none; }
    .p-apply .wizard > .steps > ul > li:not(:last-child):after { margin: 0 8px; }
}
.p-apply .wizard > .content > .body label.ap-upload { display: flex; margin: 0; }

/* Intro rich text (admin-edited) */
.ap-intro { max-width: 680px; }
.ap-intro > * { margin: 0; }
.ap-intro > * + * { margin-top: 10px; }
.ap-intro p, .ap-intro li { color: rgba(255, 255, 255, .82); font-size: 15.5px; line-height: 1.65; }
.ap-intro strong, .ap-intro b { color: #fff; font-weight: 700; }
.ap-intro em, .ap-intro i { font-style: italic; }
.ap-intro p + p:has(> strong:first-child) { margin-top: 16px; }
.ap-intro h3, .ap-intro h4 { color: #fff; font-size: 16px; font-weight: 700; margin-top: 16px; }
.ap-intro ul, .ap-intro ol { padding-left: 20px; }
.ap-intro li + li { margin-top: 4px; }
.ap-intro a { color: var(--p-gold); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 767px) { .ap-intro p, .ap-intro li { font-size: 14.5px; } }
