﻿/* ═══════════════════════════════════════════════════════════════
   APHRC Job Portal — Unified Stylesheet
   Brand palette:
     Primary green  #7BC148   --aphrc-green
     Light green    #B9D989   --aphrc-green-light
     Yellow         #FEBF2C   --aphrc-yellow
     Grey           #A6A4A9   --aphrc-grey
     Black          #000000
   ═══════════════════════════════════════════════════════════════ */

/* ── Brand tokens ────────────────────────────────────────────── */
:root {
    --aphrc-green:       #7BC148;
    --aphrc-green-dk:    #2d5015;
    --aphrc-green-light: #B9D989;
    --aphrc-green-lt:    #EEF7E4;
    --aphrc-yellow:      #FEBF2C;
    --aphrc-grey:        #A6A4A9;
    --aphrc-shadow:      0 2px 8px rgba(0,0,0,.08);
    --aphrc-radius:      10px;

    /* Brand typography (APHRC guidelines): the official "APHRC Primary" (Avenir)
       webfont is bundled below so it renders for EVERY visitor regardless of what
       is installed locally. Avenir Next / Calibri / Trebuchet remain as fallbacks
       in case the webfont fails to load. */
    --aphrc-font: "APHRC Primary", "Avenir Next", "Avenir Next LT Pro", Avenir, Calibri, "Trebuchet MS", sans-serif;

    /* Bootstrap 5 reads its body font from this variable */
    --bs-body-font-family: var(--aphrc-font);
    --bs-font-sans-serif: var(--aphrc-font);
}

/* Official APHRC primary font (Avenir). One TTF file supplied by the brand team
   covers the regular weight; the browser synthesises bold/italic where a view
   asks for them. Bundled so it renders for every visitor, not only those with
   Avenir installed locally. */
@font-face {
    font-family: "APHRC Primary";
    src: url("../fonts/APHRC-Primary.ttf") format("truetype");
    font-weight: 100 900;       /* allow synthesised weights from the single file */
    font-style: normal;
    font-display: swap;
}

/* ── Reset / Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: #f5f7fa url('../images/Pattern1.png') center center / cover no-repeat fixed;
    font-family: var(--aphrc-font);
    font-size: 15px;
    color: #333;
    overflow-x: hidden;
}

/* Form controls and buttons inherit the brand font (browsers default them
   to the UI font otherwise) */
input, select, textarea, button {
    font-family: var(--aphrc-font);
}

/* ── Breadcrumb link colour (brand green, not Bootstrap blue) ── */
.breadcrumb-item a {
    color: var(--aphrc-green);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb-item a:hover { color: var(--aphrc-green-dk); text-decoration: underline; }
.breadcrumb-item.active { color: #555; }

/* ── Navbar — brand green #7BC148 ────────────────────────────── */
.navbar-aphrc { background: var(--aphrc-green); }
.navbar-aphrc .navbar-brand,
.navbar-aphrc .nav-link { color: #fff !important; font-weight: 600; }
.navbar-aphrc .nav-link:hover,
.navbar-aphrc .nav-link.active { color: var(--aphrc-yellow) !important; }
.navbar-aphrc .btn-login {
    background: var(--aphrc-yellow); border: none;
    color: #000; font-weight: 700;
    border-radius: 20px; padding: .4em 1.1em;
}
.navbar-aphrc .btn-login:hover { background: #e8ab15; color: #000; }
.navbar-aphrc .navbar-collapse { background: var(--aphrc-green); }
@media (max-width: 991.98px) {
    .navbar-aphrc .navbar-collapse {
        padding: .5rem 0;
        border-top: 1px solid rgba(255,255,255,.1);
    }
    .navbar-aphrc .nav-link { padding: .6rem 1rem; }
    .navbar-aphrc .navbar-nav.ms-auto { padding: .5rem 1rem 1rem; }
}

/* ── Footer (compact, brand black) ───────────────────────────── */
.footer-aphrc {
    background: #000;
    color: var(--aphrc-grey);
    padding: 18px 0 10px;
    margin-top: 0;
    font-size: .76rem;
}
.footer-aphrc a { color: var(--aphrc-green-light); text-decoration: none; }
.footer-aphrc a:hover { color: var(--aphrc-yellow); }
/* Bootstrap's .text-muted (#6c757d) is almost invisible on the black footer —
   lift it to a readable light grey (e.g. the © line). */
.footer-aphrc .text-muted { color: rgba(255,255,255,.7) !important; }
.footer-aphrc h6 { font-size: .78rem; margin-bottom: .35rem !important; }
@media (max-width: 767.98px) {
    .footer-aphrc { text-align: center; margin-top: 0; }
    .footer-aphrc .text-md-end { text-align: center !important; margin-top: 1rem; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    border: none;
    box-shadow: var(--aphrc-shadow);
    border-radius: var(--aphrc-radius);
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); transition: box-shadow .2s; }

/* ── Buttons (brand overrides) ───────────────────────────────────
   Bootstrap 5.3 buttons are driven by CSS variables: the pressed state
   comes from --bs-btn-active-* (applied by a higher-specificity
   :not(.btn-check)+.btn:active rule) and the focus ring from
   --bs-btn-focus-shadow-rgb. Plain .btn-primary:active overrides lose to
   it, so clicking flashed Bootstrap blue — override the variables instead.
   Focus ring = APHRC light green #B9D989 (185,217,137). */
.btn-primary {
    --bs-btn-bg: var(--aphrc-green);
    --bs-btn-border-color: var(--aphrc-green);
    --bs-btn-hover-bg: #5d9933;
    --bs-btn-hover-border-color: #5d9933;
    --bs-btn-active-bg: #4e8129;
    --bs-btn-active-border-color: #4e8129;
    --bs-btn-disabled-bg: var(--aphrc-green);
    --bs-btn-disabled-border-color: var(--aphrc-green);
    --bs-btn-focus-shadow-rgb: 185, 217, 137;
}
.btn-outline-primary {
    --bs-btn-color: var(--aphrc-green);
    --bs-btn-border-color: var(--aphrc-green);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--aphrc-green);
    --bs-btn-hover-border-color: var(--aphrc-green);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--aphrc-green);
    --bs-btn-active-border-color: var(--aphrc-green);
    --bs-btn-disabled-color: var(--aphrc-green);
    --bs-btn-disabled-border-color: var(--aphrc-green);
    --bs-btn-focus-shadow-rgb: 185, 217, 137;
}
.btn-warning {
    --bs-btn-color: #333;
    --bs-btn-bg: var(--aphrc-yellow);
    --bs-btn-border-color: var(--aphrc-yellow);
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: #e0aa18;
    --bs-btn-hover-border-color: #e0aa18;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: #d29f16;
    --bs-btn-active-border-color: #d29f16;
    --bs-btn-focus-shadow-rgb: 254, 191, 44;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert-success { border-left: 4px solid #28a745; }
.alert-warning { border-left: 4px solid var(--aphrc-yellow); }
.alert-danger  { border-left: 4px solid #dc3545; }

/* ── Badge pills ─────────────────────────────────────────────── */
.badge-contract {
    background: #e8f5df; color: #3a6b10;
    font-size: .73rem; padding: .3em .7em; border-radius: 20px;
}

/* ── Focus ring ──────────────────────────────────────────────────
   Inputs/selects get the brand green ring. Buttons are deliberately NOT
   included here so each keeps its own colour focus (e.g. a red ring on a
   danger button, grey on secondary) rather than all turning green. */
.form-control:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(123,193,72,.28);
    border-color: var(--aphrc-green);
}

/* Tom Select (searchable country / nationality) — match the green focus state */
.ts-wrapper.focus .ts-control {
    border-color: var(--aphrc-green);
    box-shadow: 0 0 0 3px rgba(123,193,72,.28);
}
.ts-dropdown .active { background-color: rgba(123,193,72,.18); color: var(--aphrc-green-dk); }
/* Red invalid state on a Tom Select control (when its hidden select is .is-invalid) */
.is-invalid + .ts-wrapper .ts-control { border-color: #dc3545; box-shadow: 0 0 0 .15rem rgba(220,53,69,.2); }

/* Date/month inputs have a calendar icon on the right, so Bootstrap's red validation
   icon was hidden behind it. Keep the icon but shift it to the LEFT of the calendar
   picker (with extra padding) so both are visible. */
input[type="date"].is-invalid, input[type="month"].is-invalid {
    background-position: right 2rem center;
    padding-right: 3.5rem;
}

/* ── Checkboxes & radios — brand green, never Bootstrap blue ─── */
input[type="checkbox"], input[type="radio"] { accent-color: var(--aphrc-green); }
.form-check-input:checked {
    background-color: var(--aphrc-green) !important;
    border-color: var(--aphrc-green) !important;
}
.form-check-input:focus {
    border-color: var(--aphrc-green);
    box-shadow: 0 0 0 3px rgba(123,193,72,.25);
}

/* ── Application status timeline ─────────────────────────────── */
.status-timeline { display: flex; gap: 0; margin: 1.5rem 0; }
.status-step { flex: 1; text-align: center; position: relative; }
.status-step::after {
    content: ''; position: absolute; top: 14px; left: 50%;
    width: 100%; height: 3px; background: #dee2e6; z-index: 0;
}
.status-step:last-child::after { display: none; }
.status-step .dot {
    width: 30px; height: 30px; border-radius: 50%; background: #dee2e6;
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; z-index: 1; font-size: .75rem; color: #fff;
}
.status-step.done   .dot { background: #28a745; }
.status-step.active .dot { background: var(--aphrc-green); }
.status-step .label { font-size: .7rem; margin-top: .3rem; color: var(--aphrc-grey); }
.status-step.done .label, .status-step.active .label { color: var(--aphrc-green-dk); font-weight: 600; }

/* ── Mobile utilities ────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .container { padding-left: 14px; padding-right: 14px; }
    h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.5rem; }
    .btn-lg { font-size: .95rem; padding: .55rem 1.2rem; }
    .row dl.row dt, .row dl.row dd { flex: none; width: 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE — Stepper Tab Navigation
   ═══════════════════════════════════════════════════════════════ */

/* Progress bar */
.prof-progress-wrap { margin-bottom: 6px; }
.prof-progress-bg   { height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; }
.prof-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aphrc-green-dk), var(--aphrc-green));
    border-radius: 2px;
    transition: width .35s ease;
}

/* Stepper track */
.prof-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 8px;
}
.prof-step {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative; cursor: pointer;
}
.prof-step:not(:last-child)::after {
    content: '';
    position: absolute; top: 18px;
    left: calc(50% + 20px); right: calc(-50% + 20px);
    height: 3px; background: #e0e0e0; border-radius: 2px;
    transition: background .3s; z-index: 0;
}
.prof-step.done:not(:last-child)::after {
    background: linear-gradient(90deg, var(--aphrc-green-dk), var(--aphrc-green));
}
.prof-step-bubble {
    width: 36px; height: 36px; border-radius: 50%;
    background: #e0e0e0; color: #fff;
    font-size: .85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
    transition: background .3s, box-shadow .3s;
}
.prof-step.done   .prof-step-bubble { background: var(--aphrc-green-dk); }
.prof-step.active .prof-step-bubble {
    background: var(--aphrc-green);
    box-shadow: 0 0 0 5px rgba(185,217,137,.5);
}
.prof-step-label {
    font-size: .68rem; font-weight: 600;
    color: var(--aphrc-grey); text-align: center;
    margin-top: 6px; line-height: 1.3; max-width: 80px;
    text-transform: uppercase; letter-spacing: .04em;
}
.prof-step.active .prof-step-label,
.prof-step.done   .prof-step-label { color: var(--aphrc-green-dk); }

/* Mobile step navigation bar (prev / label / next) — replaces the static strip */
.prof-mobile-nav { display: none; }
.prof-mnav-label {
    flex: 1; text-align: center;
    font-size: .82rem; font-weight: 700; color: var(--aphrc-green-dk);
}
.prof-mnav-btn {
    background: var(--aphrc-green); color: #fff; border: none;
    border-radius: 6px; min-width: 38px; padding: .45rem .7rem;
    font-size: .85rem; font-weight: 700; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.prof-mnav-btn:disabled { background: #c9d6bb; cursor: default; }
@media (max-width: 600px) {
    .prof-stepper { display: none; }
    .prof-mobile-nav {
        display: flex; align-items: center; gap: 8px;
        background: var(--aphrc-green-lt); border: 1px solid var(--aphrc-green-light);
        border-radius: 8px; padding: 6px 8px; margin-bottom: 16px;
    }
}

/* Profile-strength checklist in two columns to cut down on scrolling */
.prof-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    column-gap: 20px;
}
.prof-check-grid .prof-check-row { border-bottom: none; padding: .3rem 0; }
/* Long items (employment history, CV) take their own full-width row */
.prof-check-grid .prof-check-wide { grid-column: 1 / -1; }

/* Tab panels — smooth fade */
.prof-tab-panel { display: none; }
.prof-tab-panel.active {
    display: block;
    animation: profFadeIn .22s ease;
}
@keyframes profFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header card holding the page heading + step tabs */
.prof-head-card {
    background: #fff;
    border: 1px solid #e8eedf;
    border-radius: var(--aphrc-radius);
    box-shadow: var(--aphrc-shadow);
    padding: 12px 18px;
    margin-bottom: 8px;
}
.prof-head-card .prof-stepper { margin-bottom: 0; }

/* Dashboard header: title (left) · counters (centre) · button (right) */
.dash-head-row {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.dash-head-title { flex: 1 1 auto; }
.dash-head-btn { flex: 0 0 auto; }
.dash-counters {
    display: flex; text-align: center;
    flex: 1 1 auto; justify-content: center; gap: 0;
}
.dash-counters > div { padding: 0 20px; }
.dash-counters > div + div { border-left: 1px solid #eee; }
@media (max-width: 575.98px) {
    .dash-head-row { justify-content: space-between; }
    .dash-counters { order: 3; flex-basis: 100%; justify-content: space-around; }
    .dash-counters > div { padding: 0 8px; }
}

/* ── APHRC-branded status chips (Dashboard table + Application page) ──
   Positive pipeline climbs the brand palette; rejected/withdrawn are neutral. */
.jp-badge {
    display: inline-block; font-size: .7rem; font-weight: 700;
    padding: .32em .75em; border-radius: 999px; line-height: 1; letter-spacing: .02em;
    white-space: nowrap;
}
.jp-badge-submitted { background: #ececec; color: #5a5a5a; }
.jp-badge-review    { background: var(--aphrc-yellow); color: #5a4500; }
.jp-badge-shortlist { background: var(--aphrc-green-lt); color: var(--aphrc-green-dk); border: 1px solid #c8ddb8; }
.jp-badge-interview { background: var(--aphrc-green); color: #fff; }
.jp-badge-selected  { background: var(--aphrc-green-dk); color: #fff; }
.jp-badge-rejected  { background: #222; color: #fff; }
.jp-badge-withdrawn { background: var(--aphrc-grey); color: #fff; }

/* ── Search box with inline clear (×) and brand focus ring ── */
.jp-input-search { position: relative; max-width: 340px; width: 100%; }
.jp-input-search .jp-input-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--aphrc-grey); font-size: .8rem; pointer-events: none;
}
.jp-input-search .form-control { padding-left: 32px; padding-right: 34px; }
.jp-input-search .form-control:focus {
    border-color: var(--aphrc-green);
    box-shadow: 0 0 0 3px rgba(123,193,72,.2);
}
.jp-input-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; color: var(--aphrc-grey); cursor: pointer;
    width: 22px; height: 22px; border-radius: 50%; line-height: 1; font-size: .8rem;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.jp-input-clear:hover { color: #444; background: #efefef; }

/* ── Dashboard floating action bar (Back + Browse Jobs) ──
   Sticks just below the navbar; `top` is set in JS to the live navbar height. */
.dash-action-bar {
    position: sticky; top: 0; z-index: 1010;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #fff; border: 1px solid #eef0ec; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    padding: 8px 14px; margin-bottom: 14px;
}
.dash-action-bar .jd-back-link { margin: 0; }

/* Profile card wrapper */
.prof-card {
    background: #fff;
    border: 1px solid #e8eedf;
    border-radius: var(--aphrc-radius);
    box-shadow: var(--aphrc-shadow);
    margin-bottom: 8px;
    overflow: hidden;
}
.prof-card-header {
    background: var(--aphrc-green-lt);
    border-bottom: 1px solid #d4e8b8;
    padding: 12px 18px;
    display: flex; align-items: center;
    justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.prof-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .92rem; font-weight: 700; color: var(--aphrc-green-dk);
}
.prof-card-icon {
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--aphrc-green); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; flex-shrink: 0;
}
.prof-card-body { padding: 18px 20px; }

/* ── Inline add/edit forms (replace modals) ── */
.prof-inline-form {
    border-top: 1px solid #e8efe1;
    background: #fbfdf9;
    padding: 18px 20px 20px;
}
.prof-inline-hd {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; font-size: .95rem; color: var(--aphrc-green-dk);
    margin-bottom: 14px;
}
.prof-inline-close {
    border: none; background: transparent; line-height: 1;
    font-size: 1.4rem; color: var(--aphrc-grey); cursor: pointer;
    padding: 0 .35rem; border-radius: 6px;
}
.prof-inline-close:hover { background: #eee; color: #333; }
/* Cancel / Save buttons in the form header (education forms); wrap under the title on phones */
.prof-inline-hd { flex-wrap: wrap; gap: 8px; }
.prof-inline-hd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.prof-inline-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef0ec;
}

/* Compact field sizing inside the inline add/edit forms */
.prof-inline-form .row { --bs-gutter-y: .55rem; }
.prof-inline-form .form-label { font-size: .76rem; font-weight: 600; margin-bottom: .15rem; }
.prof-inline-form .form-control,
.prof-inline-form .form-select,
.prof-inline-form .ts-control {
    font-size: .85rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
    min-height: calc(1.5em + .6rem + 2px);
}
.prof-inline-form textarea.form-control { min-height: auto; }
.prof-inline-form .form-text { font-size: .72rem; margin-top: .1rem; }
.prof-inline-form .prof-inline-actions { margin-top: .65rem; }
/* Tom Select sits flush with the Bootstrap inputs around it */
.prof-inline-form .ts-wrapper { margin-bottom: 0; }

/* Avatar initials circle */
.prof-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--aphrc-green-dk); color: #fff;
    font-size: 1.3rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Info grid inside cards */
.prof-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
/* Keep two columns on mobile too (tighter gap) */
@media (max-width: 576px) { .prof-info-grid { gap: 8px 10px; } }
.prof-info-label {
    font-size: .67rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--aphrc-grey);
}
.prof-info-value { font-size: .88rem; color: #333; font-weight: 500; }

/* Section heading within a panel */
.prof-section-heading {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--aphrc-grey);
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid #f0f4ec;
    padding-bottom: 6px; margin-bottom: 14px;
}
.prof-section-heading i { color: var(--aphrc-green); }

/* List item (employment / education / cert) */
.prof-item { border-bottom: 1px solid #f0f4ec; padding: 14px 0; }
.prof-item:last-child { border-bottom: none; padding-bottom: 0; }
.prof-item-title  { font-size: .9rem; font-weight: 700; color: #1a2e0a; }
.prof-item-sub    { font-size: .8rem; color: #555; margin-top: 2px; }
.prof-item-meta   { font-size: .74rem; color: var(--aphrc-grey); margin-top: 4px; }
.prof-item-badge  {
    display: inline-flex; align-items: center; gap: 3px;
    padding: .18em .55em; border-radius: 12px;
    font-size: .68rem; font-weight: 700;
}
.prof-item-badge.current { background: var(--aphrc-green-lt); color: var(--aphrc-green-dk); border: 1px solid #c8ddb8; }
.prof-item-badge.expired { background: #fff3e0; color: #b76f00; border: 1px solid #ffe0b2; }
.prof-item-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* Empty state */
.prof-empty {
    text-align: center; padding: 30px 20px;
    color: var(--aphrc-grey); font-size: .88rem;
}
.prof-empty i { font-size: 1.8rem; margin-bottom: 10px; display: block; opacity: .45; }

/* Completeness bar */
.prof-complete-wrap { margin-bottom: 18px; }
.prof-complete-label {
    font-size: .74rem; color: var(--aphrc-grey);
    margin-bottom: 4px; display: flex; justify-content: space-between;
}
.prof-complete-bg   { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.prof-complete-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aphrc-green-dk), var(--aphrc-green));
    border-radius: 3px; transition: width .5s ease;
}

/* Timeline dot (used in recent employment) */
.timeline-item {
    border-left: 3px solid #c8ddb8;
    padding-left: 1rem; margin-bottom: 1.5rem; position: relative;
}
.timeline-item::before {
    content: ''; position: absolute; left: -7px; top: 4px;
    width: 11px; height: 11px;
    background: var(--aphrc-green); border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════════
   APPLY — Multi-step Wizard Stepper
   ═══════════════════════════════════════════════════════════════ */

/* Progress bar */
.ap-progress-wrap  { margin-bottom: 8px; }
.ap-progress-bar-bg { height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; }
.ap-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aphrc-green-dk), var(--aphrc-green));
    border-radius: 2px; transition: width .35s ease;
}

/* Stepper */
.ap-stepper {
    display: flex; align-items: flex-start;
    justify-content: center; gap: 0;
    margin-bottom: 32px; padding: 0 8px;
}
.ap-step {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative; cursor: pointer;
}
.ap-step:not(:last-child)::after {
    content: ''; position: absolute; top: 18px;
    left: calc(50% + 20px); right: calc(-50% + 20px);
    height: 3px; background: #e0e0e0; border-radius: 2px;
    transition: background .3s; z-index: 0;
}
.ap-step.done:not(:last-child)::after {
    background: linear-gradient(90deg, var(--aphrc-green-dk), var(--aphrc-green));
}
.ap-step-bubble {
    width: 36px; height: 36px; border-radius: 50%;
    background: #e0e0e0; color: #fff;
    font-size: .85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
    transition: background .3s, box-shadow .3s;
}
.ap-step.done   .ap-step-bubble { background: var(--aphrc-green-dk); }
.ap-step.active .ap-step-bubble {
    background: var(--aphrc-green);
    box-shadow: 0 0 0 5px rgba(185,217,137,.5);
}
.ap-step-label {
    font-size: .68rem; font-weight: 600; color: var(--aphrc-grey);
    text-align: center; margin-top: 6px; line-height: 1.3;
    max-width: 80px; text-transform: uppercase; letter-spacing: .04em;
}
.ap-step.active .ap-step-label,
.ap-step.done   .ap-step-label { color: var(--aphrc-green-dk); }

/* Mobile strip */
/* Top step bar (Back / label / Next) — visible on all sizes */
.ap-stepbar {
    display: flex; align-items: center; gap: 8px;
    background: var(--aphrc-green-lt); border: 1px solid var(--aphrc-green-light);
    border-radius: 8px; padding: 6px 10px; margin-bottom: 6px;
}
.ap-stepbar-label {
    flex: 1; text-align: center;
    font-size: .82rem; font-weight: 700; color: var(--aphrc-green-dk);
}
.ap-stepbar-btn {
    background: var(--aphrc-green); color: #fff; border: none; border-radius: 6px;
    padding: .42rem .85rem; font-size: .82rem; font-weight: 700; cursor: pointer;
    flex-shrink: 0; display: inline-flex; align-items: center;
}
.ap-stepbar-btn.back { background: transparent; color: var(--aphrc-green-dk); border: 1.5px solid #c8ddb8; }
.ap-stepbar-btn:hover { filter: brightness(.96); }
@media (max-width: 600px) {
    .ap-stepper { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   STEPPER DIRECTION CUES — shared by .prof-step (/Profile) and .ap-step
   (/Application/Apply). Both steppers already draw the connector between
   two steps as an ::after on the left-hand step; these rules add an
   arrowhead at the far end of THAT SAME line — no second line — so the
   order of the steps reads at a glance, and let the one line leading out of
   the current step carry a slow highlight as the "you are here, go this
   way" hint. Deliberately understated: a 9px chevron and a 2.6s sweep.
   Defined after both steppers so the .done shorthand doesn't reset it.
   ═══════════════════════════════════════════════════════════════ */

/* The arrowhead. A square with two borders, rotated 45deg so the corner
   between them becomes the tip, sitting at the connector's right end — which
   is 2px shy of the next bubble, so it points into it. */
.prof-step:not(:last-child)::before,
.ap-step:not(:last-child)::before {
    content: '';
    position: absolute;
    /* Connector runs from top:18px for 3px, so its centre is 19.5px; the
       9px box is centred on that. */
    top: 15px;
    right: calc(-50% + 21px);
    width: 9px; height: 9px;
    border-top: 2.5px solid #cdcdcd;
    border-right: 2.5px solid #cdcdcd;
    transform: translate(0, 0) rotate(45deg);
    z-index: 1;
    transition: border-color .3s;
}
/* Steps already behind the candidate: arrowhead matches the green line. */
.prof-step.done:not(:last-child)::before,
.ap-step.done:not(:last-child)::before {
    border-top-color: var(--aphrc-green);
    border-right-color: var(--aphrc-green);
}
/* The step they are on: its outgoing arrowhead nudges forward, on the beat of
   the line's highlight below. */
.prof-step.active:not(:last-child)::before,
.ap-step.active:not(:last-child)::before {
    border-top-color: var(--aphrc-green);
    border-right-color: var(--aphrc-green);
    animation: stepArrowNudge 2.6s ease-in-out infinite;
}
@keyframes stepArrowNudge {
    0%, 100% { transform: translate(0, 0) rotate(45deg); opacity: .8; }
    55%      { transform: translate(3px, 0) rotate(45deg); opacity: 1; }
}

/* The outgoing line itself: a soft green band sweeping along the grey, left to
   right. background-color keeps the grey track, so this is still one line. */
.prof-step.active:not(:last-child)::after,
.ap-step.active:not(:last-child)::after {
    background-color: #e0e0e0;
    background-image: linear-gradient(90deg,
        rgba(185,217,137,0) 0%, var(--aphrc-green) 50%, rgba(185,217,137,0) 100%);
    background-size: 55% 100%;
    background-repeat: no-repeat;
    animation: stepLineFlow 2.6s ease-in-out infinite;
}
@keyframes stepLineFlow {
    0%   { background-position: -60% 50%; }
    100% { background-position: 160% 50%; }
}

/* Motion is a hint here, never the message — the arrowheads and the green
   line still say the same thing standing still. */
@media (prefers-reduced-motion: reduce) {
    .prof-step.active:not(:last-child)::before,
    .ap-step.active:not(:last-child)::before,
    .prof-step.active:not(:last-child)::after,
    .ap-step.active:not(:last-child)::after {
        animation: none;
    }
    .prof-step.active:not(:last-child)::after,
    .ap-step.active:not(:last-child)::after {
        background-image: none;
        background-color: var(--aphrc-green-light);
    }
}

/* Step cards */
.ap-card {
    background: #fff; border: 1px solid #e8eedf;
    border-radius: var(--aphrc-radius); box-shadow: var(--aphrc-shadow);
    margin-bottom: 24px; overflow: hidden;
}
.ap-card-header {
    background: var(--aphrc-green-lt); border-bottom: 1px solid #d4e8b8;
    padding: 14px 20px; display: flex; align-items: center;
    justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ap-card-title {
    display: flex; align-items: center; gap: 10px;
    font-size: .95rem; font-weight: 700; color: var(--aphrc-green-dk);
}
.ap-card-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--aphrc-green); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0;
}
.ap-card-body { padding: 22px 22px 18px; }

/* Sub-labels */
.ap-sub-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #1a1a1a;
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid #f0f4ec;
    padding-bottom: 6px; margin-bottom: 14px;
}
.ap-sub-label i { color: var(--aphrc-green); }

/* Info row in step 1 */
.ap-info-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-bottom: 4px; }
@media (max-width: 768px) { .ap-info-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ap-info-row { grid-template-columns: 1fr; } }
.ap-info-label { font-size: .72rem; color: var(--aphrc-grey); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ap-info-value { font-size: .88rem; color: #333; font-weight: 500; }

/* Profile completeness chips */
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ap-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: .25em .65em; border-radius: 20px;
    font-size: .72rem; font-weight: 600;
}
.ap-chip.ok   { background: var(--aphrc-green-lt); color: var(--aphrc-green-dk); border: 1px solid #c8ddb8; }
.ap-chip.warn { background: #fff8e1; color: #b76f00; border: 1px solid #ffe0b2; }
.ap-chip.miss { background: #fde8e8; color: #c62828; border: 1px solid #f5c6c6; }

/* Nav buttons */
.btn-ap-next {
    background: var(--aphrc-green); color: #fff; border: none;
    border-radius: 7px; padding: .5rem 1.3rem; font-size: .88rem; font-weight: 700;
    cursor: pointer; transition: background .2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-ap-next:hover { background: #5d9933; }
.btn-ap-prev {
    background: transparent; color: var(--aphrc-green-dk);
    border: 1.5px solid #c8ddb8; border-radius: 7px;
    padding: .5rem 1.1rem; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: border-color .2s, background .2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-ap-prev:hover { background: var(--aphrc-green-lt); border-color: var(--aphrc-green); }
.btn-ap-nav-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; gap: 8px;
}
/* On mobile the step Next/Previous bar sticks to the bottom of the screen so it's
   always reachable without scrolling to the end of a long step. */
@media (max-width: 991.98px) {
    .btn-ap-nav-row {
        position: sticky; bottom: 0; z-index: 20;
        background: #fff; padding: 12px 14px;
        margin: 8px -14px 0; border-top: 1px solid #eef0ec;
        box-shadow: 0 -4px 12px rgba(0,0,0,.07);
    }
}
/* On desktop the top step bar already has a Back button, so the in-step
   Previous is redundant — hide it and keep the action right-aligned. */
@media (min-width: 992px) {
    .ap-step-panel .btn-ap-prev { display: none; }
    .ap-step-panel .btn-ap-nav-row { justify-content: flex-end; }
}

/* File upload area */
.ap-file-area {
    border: 2px dashed #c8ddb8; border-radius: 8px;
    padding: 18px; text-align: center; background: #fafef6;
    transition: border-color .2s;
}
.ap-file-area:hover { border-color: var(--aphrc-green); }
.ap-file-area .form-control { border: none; background: transparent; }

/* ── Clickable / drag-and-drop PDF dropzone ── */
.ap-dz {
    position: relative; border: 2px dashed #c8ddb8; border-radius: 10px;
    background: #fbfdf9; padding: 1rem; text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ap-dz:hover { border-color: var(--aphrc-green); background: #f4faee; }
.ap-dz.dragover { border-color: var(--aphrc-green); background: #eef7e4; }
.ap-dz-input { display: none; }
.ap-dz-prompt > i { font-size: 1.6rem; color: var(--aphrc-green); display: block; margin-bottom: .3rem; }
.ap-dz-prompt > div { font-size: .85rem; font-weight: 600; color: var(--aphrc-green-dk); }
.ap-dz-sm { padding: .65rem; }
.ap-dz-sm .ap-dz-prompt > i { font-size: 1.2rem; margin-bottom: .15rem; }
.ap-dz-sm .ap-dz-prompt > div { font-size: .8rem; }
.ap-dz-files { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.ap-dz-file {
    display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
    background: #eef7e4; border: 1px solid #c8ddb8; border-radius: 50rem;
    padding: .2rem .6rem; font-size: .74rem; color: var(--aphrc-green-dk);
}
.ap-dz-file i { flex-shrink: 0; }
.ap-dz-file > span:not(.rm) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ap-dz-file .rm { cursor: pointer; color: #c62828; font-weight: 700; line-height: 1; }

/* ── Editable per-application snapshot editor ── */
.ap-snap-list { margin-top: .5rem; }
.ap-snap-card {
    border: 1px solid #e4e9e0; border-radius: 10px;
    background: #fbfdf9; padding: .85rem 1rem; margin-bottom: .75rem;
}
.ap-snap-card-hd {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .6rem;
}
.ap-snap-card-title { font-weight: 700; font-size: .85rem; color: #1a2e0a; }
.ap-snap-remove {
    border: none; background: transparent; color: #c0392b;
    font-size: .85rem; cursor: pointer; padding: .15rem .4rem; border-radius: 6px;
}
.ap-snap-remove:hover { background: #fdeceb; }
.ap-snap-lbl { font-size: .72rem; font-weight: 600; color: #6b7866; margin-bottom: .15rem; display: block; }
/* Textarea character counters */
.ap-charcount, .prof-charcount { display: block; text-align: right; font-size: .7rem; margin-top: .15rem; }
.ap-snap-empty {
    border: 1px dashed #d4ddca; border-radius: 8px;
    padding: .7rem .9rem; background: #fafef6; margin-top: .25rem;
}

/* ── Compact job summary at top of Apply page (mobile only) ── */
.ap-mobile-job {
    border: 1px solid #e8efe1; border-left: 3px solid var(--aphrc-green);
    background: #fbfdf9; border-radius: 8px; padding: .75rem .9rem; margin-bottom: 1rem;
}
.ap-mobile-job-title { font-weight: 700; font-size: .95rem; color: #1a2e0a; }
.ap-mobile-job-meta {
    display: flex; flex-wrap: wrap; gap: 4px 14px;
    font-size: .76rem; color: var(--aphrc-grey); margin-top: .25rem;
}
.ap-mobile-job-meta i { color: var(--aphrc-green); }
.ap-mobile-job-link {
    display: inline-block; margin-top: .45rem; font-size: .78rem;
    font-weight: 600; color: var(--aphrc-green-dk); text-decoration: none;
}
.ap-mobile-job-link:hover { text-decoration: underline; }

/* "Applying for" header: job summary (left) + 1-2-3 step progress (right) */
.ap-jobhead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    border: 1px solid #e8efe1; border-left: 3px solid var(--aphrc-green);
    background: #fbfdf9; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .4rem;
}
/* Job info (left) and the 1-2-3 step tracker (right) share the banner 50/50 */
.ap-jobhead-info { flex: 1 1 45%; min-width: 220px; }
.ap-jobhead .ap-stepper { flex: 1 1 45%; min-width: 260px; margin-bottom: 0; padding: 0; }

/* Declaration */
.ap-declaration {
    background: var(--aphrc-green-lt); border: 1px solid #c8ddb8;
    border-radius: 8px; padding: 14px 16px;
}

/* Review rows */
.ap-review-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 8px 0; border-bottom: 1px solid #f0f0f0; gap: 12px; font-size: .88rem;
}
.ap-review-row:last-child { border-bottom: none; }
.ap-review-label { color: var(--aphrc-grey); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.ap-review-val   { color: #333; text-align: right; }

/* Sidebar */
.ap-sidebar-card {
    background: #fff; border: 1px solid #e8eedf;
    border-radius: var(--aphrc-radius); box-shadow: var(--aphrc-shadow);
    padding: 16px 18px; position: sticky; top: 76px;
}
.ap-sidebar-header {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--aphrc-grey); margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   HOME — Hero, Job Cards, Search
   ═══════════════════════════════════════════════════════════════ */
.jp-hero {
    background: linear-gradient(135deg, var(--aphrc-green) 0%, var(--aphrc-green-light) 100%);
    position: relative; overflow: hidden; padding: 20px 0 36px;
}
.jp-hero::after {
    content: ''; position: absolute;
    bottom: 0; left: 0; right: 0; height: 28px;
    background: #f5f7fa;
    clip-path: ellipse(55% 100% at 50% 100%);
}
.jp-hero-title {
    font-size: 1.85rem; font-weight: 800; color: #000;
    line-height: 1.15; margin-bottom: 6px;
}
.jp-hero-subtitle {
    color: rgba(0,0,0,.65); font-size: .92rem;
    max-width: 540px; margin-bottom: 18px; line-height: 1.5;
}
/* Search + filters block */
.jp-search-bar { max-width: 640px; }
.jp-filter-row {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 10px; margin-top: 10px;
}
.jp-filter {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.9);
    border-radius: 10px; padding: 0 12px;
    transition: background .15s, border-color .15s;
}
.jp-filter:hover, .jp-filter:focus-within {
    background: #fff; border-color: var(--aphrc-green);
}
.jp-filter i { color: var(--aphrc-green); font-size: .8rem; }
.jp-filter select {
    background: transparent; border: none; outline: none;
    color: #333; font-size: .83rem; font-weight: 600;
    padding: 9px 4px; max-width: 220px; cursor: pointer;
}
.jp-filter select option { color: #333; background: #fff; }
.jp-search-wrap {
    display: flex; background: #fff; border-radius: 12px;
    overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-width: 580px;
}
.jp-search-wrap .jp-search-icon {
    display: flex; align-items: center; padding: 0 16px;
    color: var(--aphrc-grey); font-size: 1rem;
}
.jp-search-wrap input {
    border: none; outline: none; flex: 1;
    font-size: .92rem; padding: 11px 0; color: #333; background: transparent;
}
.jp-search-wrap input::placeholder { color: #bbb; }
/* Green focus highlight on the whole search box when the input is focused.
   The .jp-compact-search variant is listed explicitly so it out-specifies the
   `.jp-compact-search .jp-search-wrap` border/shadow rule defined further down. */
.jp-search-wrap:focus-within,
.jp-compact-search .jp-search-wrap:focus-within {
    border-color: var(--aphrc-green) !important;
    box-shadow: 0 0 0 3px rgba(123,193,72,.28), 0 6px 20px rgba(0,0,0,.12);
}
/* Inline × clear button (sits inside the box, before the Search button). */
.jp-search-wrap .jp-search-clear {
    display: none; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--aphrc-grey);
    cursor: pointer; padding: 0 14px; font-size: .9rem;
}
.jp-search-wrap .jp-search-clear:hover { color: #444; }
.jp-search-wrap .btn-jp-search {
    background: var(--aphrc-green); color: #fff; border: none;
    padding: 0 28px; font-weight: 700; font-size: .9rem;
    border-radius: 0 12px 12px 0; cursor: pointer; transition: background .2s; white-space: nowrap;
}
.jp-search-wrap .btn-jp-search:hover { background: #5d9933; }
.jp-clear-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
    color: rgba(0,0,0,.6); font-size: .82rem; text-decoration: none;
}
.jp-clear-link:hover { color: #000; }
.jp-stats {
    display: flex; flex-direction: row; flex-wrap: wrap;
    gap: 10px; justify-content: flex-end;
}
.jp-stat-card {
    background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.9);
    border-radius: 10px; padding: 10px 16px; text-align: center;
    min-width: 96px; backdrop-filter: blur(4px);
}
.jp-stat-num  { font-size: 1.3rem; font-weight: 800; color: #000; line-height: 1; }
.jp-stat-label {
    font-size: .64rem; color: var(--aphrc-grey); margin-top: 3px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
/* ── Compact header + search (experimental, hero-less) ── */
.jp-compact {
    background: #fff;
    border-bottom: 1px solid #e4e8e0;
    padding: 10px 0;
}
.jp-compact-row {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 14px;
}
.jp-compact-title {
    font-size: 1.15rem; font-weight: 800; color: #1a2e0a;
    margin: 0; line-height: 1.2; white-space: nowrap;
}
.jp-compact-title .jp-accent { color: var(--aphrc-green); }
.jp-compact-search { flex: 1 1 320px; max-width: 460px; }
.jp-compact-search .jp-search-wrap {
    box-shadow: 0 2px 8px rgba(0,0,0,.07); max-width: none;
    border: 1px solid #e4e8e0;
}
.jp-compact-search .jp-search-wrap input { padding: 8px 0; font-size: .88rem; }
.jp-compact-search .btn-jp-search { padding: 0 20px; font-size: .85rem; }
.jp-compact-count {
    display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap;
    color: var(--aphrc-grey); font-size: .82rem; font-weight: 600;
}
.jp-compact-count strong { color: var(--aphrc-green-dk); font-size: 1.05rem; font-weight: 800; }
.jp-compact .jp-clear-link { margin-top: 0; }
@media (max-width: 575.98px) {
    .jp-compact-title { white-space: normal; }
    .jp-compact-search { flex-basis: 100%; max-width: none; }
}

.jp-section-hd  { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.jp-section-hd h4 { font-size: 1.2rem; font-weight: 700; margin: 0; color: #1a2e0a; }
.jp-count-badge {
    background: #e8f5df; color: #3a6b10;
    font-size: .75rem; font-weight: 700; padding: .2em .65em; border-radius: 20px;
}
.jp-grid {
    display: grid; grid-template-columns: 1fr;
    gap: 20px; margin-bottom: 48px;
    max-width: 820px; margin-left: auto; margin-right: auto;
}

/* ── Sticky control strip (Open/Closed tabs + one context card) ──
   Two states, at every breakpoint:
     at rest  - transparent strip; the tabs pill and its companion card float on their
                own, so the listing shows between them.
     .is-stuck - once pinned under the navbar the strip becomes one full-width white
                bar (JS adds the class). The negative side margins cancel the parent
                container's px-3 / px-md-4 padding so the background bleeds edge to
                edge, and the inner cards drop their own shadows so it reads as a
                single toolbar rather than pills sitting on a plank.
   `top` is set in JS from the live navbar height so it tracks the collapsed and
   expanded navbar across breakpoints. */
.jp-stickybar {
    position: sticky; top: 0; z-index: 1010;
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
    /* The vertical padding is identical in both states, and when stuck the negative
       side margins are cancelled by matching side padding — so pinning changes only
       the backdrop, never the position of anything inside. */
    padding: 10px 0; margin-bottom: 6px;
    transition: background .18s ease, box-shadow .18s ease;
}
.jp-stickybar.is-stuck {
    background: #fff;
    border-bottom: 1px solid #e4e8e0;
    box-shadow: 0 4px 14px rgba(0,0,0,.10);
    /* Cancel .container-fluid.px-3 so the bar reaches both edges. */
    margin-left: -1rem; margin-right: -1rem;
    padding-left: 1rem; padding-right: 1rem;
}
@media (min-width: 768px) {
    /* …and .px-md-4 above the md breakpoint. */
    .jp-stickybar.is-stuck {
        margin-left: -1.5rem; margin-right: -1.5rem;
        padding-left: 1.5rem; padding-right: 1.5rem;
    }
}
/* One bar, not pills on a plank. */
.jp-stickybar.is-stuck .jp-tabs { box-shadow: none; }
.jp-stickybar.is-stuck .jp-sticky-search .jp-search-wrap { box-shadow: none; }
.jp-stickybar.is-stuck .jp-closed-note {
    background: transparent; border-color: transparent; box-shadow: none; padding-left: 0;
}
@media (max-width: 767.98px) {
    /* Tighter when it wraps onto two rows, so the bar costs less of a small viewport. */
    .jp-stickybar { gap: 8px 10px; }
    .jp-closed-note { font-size: .75rem; padding: .4rem .9rem; }
    /* No repeated search on a phone. It wraps to a full-width row of its own, so the
       reserved-but-empty slot shows as a gap before it fades in, and once revealed the
       pinned bar would be three rows tall on the smallest screen we support. The
       header's own search is a short scroll away. */
    .jp-sticky-search { display: none !important; }
}

/* Card 2 on the Closed tab: the archive note, floating on its own. */
.jp-closed-note {
    margin: 0; font-size: .8rem; color: #6b6b6b; line-height: 1.4;
    background: #fff; border: 1px solid #e4e8e0; border-radius: 999px;
    padding: .5rem 1.15rem; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.jp-closed-note i { color: var(--aphrc-grey); }

/* Card 2 on the Open tab: the search, faded in once the header's own search has
   scrolled away. It keeps its slot in the strip while hidden so nothing shifts. */
.jp-sticky-search {
    flex: 1 1 240px; max-width: 400px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.jp-sticky-search.show { opacity: 1; visibility: visible; transform: none; }
.jp-sticky-search .jp-search-wrap {
    max-width: none; border: 1px solid #e4e8e0; box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.jp-sticky-search .jp-search-wrap input { padding: 7px 0; font-size: .86rem; }
.jp-sticky-search .btn-jp-search { padding: 0 18px; font-size: .85rem; }

.jp-tabs {
    display: inline-flex; gap: 4px; flex-shrink: 0;
    background: #fff; border: 1px solid #e4e8e0; border-radius: 999px;
    padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.jp-tab {
    border: none; background: transparent; cursor: pointer;
    font-size: .86rem; font-weight: 600; color: var(--aphrc-grey);
    padding: .42rem .95rem; border-radius: 999px;
    display: inline-flex; align-items: center; gap: .4rem;
    transition: background .15s, color .15s;
}
.jp-tab:hover { color: var(--aphrc-green-dk); background: #f3f7ee; }
.jp-tab.active { color: #fff; background: var(--aphrc-green); }
.jp-tab.active:hover { background: var(--aphrc-green); }
.jp-tab-count {
    font-size: .7rem; font-weight: 700; background: #eef7e4; color: #3a7a1a;
    border-radius: 999px; padding: .05em .55em; min-width: 1.4em; text-align: center;
}
.jp-tab.active .jp-tab-count { background: rgba(255,255,255,.3); color: #fff; }
/* The "Recently Closed" tab goes grey (not green) when active, to signal closed. */
#jptab-btn-closed.active { background: var(--aphrc-grey); }
#jptab-btn-closed.active:hover { background: var(--aphrc-grey); }
/* …and its count badge is grey too (not green), matching the closed theme. */
#jptab-btn-closed .jp-tab-count { background: #e6e6e6; color: #6b6b6b; }
#jptab-btn-closed.active .jp-tab-count { background: rgba(255,255,255,.3); color: #fff; }
/* While viewing Recently Closed, keep the Open Positions tab green (not plain grey)
   so it stands out as the way back to open jobs. */
#jptab-btn-open:not(.active) { color: var(--aphrc-green-dk); background: var(--aphrc-green-lt); }

/* ── Job cards (APHRC careers-page "cdc-card" style) ──
   Vertical, roomy cards that mirror https://aphrc.org/careers/ : 1px hairline
   border, 8px radius, 28px padding, uppercase title, icon meta row, a fuller
   multi-line description, then the action row. Column is centred and capped so
   line length stays readable. */
.jp-list {
    display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px;
}
.jp-panel {
    --jp-panel-bg: #fff;
    background: var(--jp-panel-bg); border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 28px; position: relative; transition: box-shadow .2s;
}
.jp-panel:hover { box-shadow: 0 6px 22px rgba(0,0,0,.10); }
.jp-panel-main { min-width: 0; }
.jp-panel-hd { margin-bottom: 12px; }
.jp-panel-title {
    font-size: 1.25rem; font-weight: 700; text-transform: uppercase;
    color: #1a2e0a; margin: 0; line-height: 1.35; letter-spacing: .01em;
}
.jp-panel-meta {
    display: flex; flex-wrap: wrap; gap: 20px;
    font-size: .9rem; color: #555; margin-bottom: 14px;
}
.jp-panel-meta i { color: var(--aphrc-green); }
.jp-panel-meta strong { color: #333; font-weight: 700; }
/* The listing renders the same sanitized rich text as the job page (links, lists,
   emphasis), so the clamp can no longer be -webkit-line-clamp: that counts lines in
   one text block and stops working the moment the summary contains <p> or <ul>.
   Clamp on height instead; the fade is added by script (.is-clamped) only when the
   text really is cut off, so a short summary keeps a clean, unfaded bottom edge. */
.jp-panel-desc {
    font-size: .95rem; color: #444; line-height: 1.7; margin: 0 0 18px;
    position: relative; max-height: 8.5rem; overflow: hidden;
}
.jp-panel-desc.is-clamped::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--jp-panel-bg, #fff));
    pointer-events: none;
}

/* Quill markup inside the summary. Tighter than .jd-rich-text on the job page —
   this is a card, not the advert. */
.jp-panel-desc > :first-child { margin-top: 0; }
.jp-panel-desc > :last-child { margin-bottom: 0; }
.jp-panel-desc p { margin: 0 0 .55rem; }
.jp-panel-desc ul, .jp-panel-desc ol { margin: 0 0 .55rem; padding-left: 1.3rem; }
.jp-panel-desc li { margin-bottom: .2rem; }
.jp-panel-desc a { color: var(--aphrc-green-dk); text-decoration: underline; }
.jp-panel-desc a:hover { color: var(--aphrc-green); }
.jp-panel-desc strong, .jp-panel-desc b { font-weight: 700; color: #333; }
.jp-panel-desc em, .jp-panel-desc i { font-style: italic; }
.jp-panel-desc u { text-decoration: underline; }
.jp-panel-desc s, .jp-panel-desc strike { text-decoration: line-through; }
/* A heading pasted into the summary must not shout over the job title above it. */
.jp-panel-desc h1, .jp-panel-desc h2, .jp-panel-desc h3,
.jp-panel-desc h4, .jp-panel-desc h5, .jp-panel-desc h6 {
    font-size: 1rem; font-weight: 700; color: #1a2e0a; margin: 0 0 .4rem; line-height: 1.4;
}
.jp-panel-desc blockquote {
    margin: 0 0 .55rem; padding-left: .75rem; border-left: 3px solid #e0e0e0; color: #555;
}
.jp-panel-desc table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.jp-panel-desc td, .jp-panel-desc th { border: 1px solid #e6e6e6; padding: .25rem .4rem; }
.jp-panel-side {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    position: relative; z-index: 1;
}
@media (max-width: 575.98px) {
    .jp-panel { padding: 22px; }
    .jp-panel-side { width: 100%; }
    .jp-panel-side > a, .jp-panel-side > span { flex: 1 1 auto; text-align: center; justify-content: center; }
}
.jp-card {
    background: #fff; border-radius: 12px; padding: 22px 22px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07); border: 1px solid #eef0ec;
    display: flex; flex-direction: column; position: relative;
    cursor: pointer; transition: box-shadow .2s, transform .2s;
}
.jp-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.13); transform: translateY(-2px); }
.jp-card-overlay-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.jp-card-actions, .jp-card-footer { position: relative; z-index: 1; }
.jp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.jp-card-title-wrap { flex: 1; min-width: 0; }
.jp-card-title-wrap .jp-card-title { margin-bottom: 4px; }
.jp-org-row  { display: flex; align-items: center; gap: 10px; }
.jp-org-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--aphrc-green), var(--aphrc-green-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .95rem; flex-shrink: 0;
}
.jp-org-name { font-size: .78rem; font-weight: 700; color: #555; }
.jp-org-loc  { font-size: .72rem; color: var(--aphrc-grey); }
.jp-type-pill {
    font-size: .7rem; font-weight: 600; padding: .28em .75em; border-radius: 20px;
    background: #f0f9e6; color: #3a6b10; border: 1px solid #cde9a8; white-space: nowrap;
}
.jp-card-title  { font-size: 1.05rem; font-weight: 700; color: #1a2e0a; margin-bottom: 8px; line-height: 1.3; }
.jp-card-meta   { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--aphrc-grey); margin-bottom: 10px; }
.jp-card-meta i { color: var(--aphrc-green); }
.jp-card-desc {
    font-size: .82rem; color: #666; line-height: 1.55; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    margin-bottom: 16px; flex: 1;
}
.jp-card-footer {
    border-top: 1px solid #f0f2ee; padding-top: 14px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; flex-wrap: wrap;
}
.jp-deadline       { font-size: .75rem; color: var(--aphrc-grey); }
.jp-deadline strong { color: #444; }
.jp-urgency-ok     { color: #28a745; font-weight: 600; }
.jp-urgency-warn   { color: var(--aphrc-yellow); font-weight: 600; }
.jp-urgency-danger { color: #dc3545; font-weight: 700; }
.jp-card-actions   { display: flex; gap: 8px; }
.btn-jp-details {
    font-size: .86rem; font-weight: 600; padding: .5em 1.15em; border-radius: 8px;
    border: 1.5px solid var(--aphrc-green); color: #3a6b10;
    background: transparent; text-decoration: none; transition: background .15s, color .15s;
    display: inline-flex; align-items: center;
}
.btn-jp-details:hover { background: var(--aphrc-green); color: #fff; }
.btn-jp-apply {
    font-size: .86rem; font-weight: 600; padding: .5em 1.3em; border-radius: 8px;
    background: var(--aphrc-green); color: #fff;
    border: 1.5px solid var(--aphrc-green); text-decoration: none; transition: background .15s;
    display: inline-flex; align-items: center;
}
.btn-jp-apply:hover { background: #5d9933; border-color: #5d9933; color: #fff; }
.jp-empty {
    text-align: center; padding: 60px 20px; background: #fff;
    border-radius: 12px; border: 2px dashed #d8ecc4; margin-bottom: 48px;
}
.jp-empty i  { font-size: 3rem; color: var(--aphrc-green-light); margin-bottom: 16px; display: block; }
.jp-empty-img { width: 260px; max-width: 70%; height: auto; margin: 0 auto 20px; display: block; }
.jp-empty h5 { font-weight: 700; color: #1a2e0a; margin-bottom: 8px; }
.jp-empty p  { color: var(--aphrc-grey); font-size: .9rem; margin-bottom: 20px; }

/* ── Recently-closed cards ──
   These reuse the open-position .jp-panel layout wholesale, so the two tabs read as
   one listing. Everything below only mutes the accents (green -> grey) and swaps the
   Apply button for a grey "View Details", so the card still says "closed" at a glance
   without shrinking to an unreadable strip. */
.jp-panel-closed { --jp-panel-bg: #fbfbfa; background: var(--jp-panel-bg); border-color: #e4e4e2; }
.jp-panel-closed:hover { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.jp-panel-closed .jp-panel-hd {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.jp-panel-closed .jp-panel-title { color: #4b4b47; }
.jp-panel-closed .jp-panel-meta i { color: #a8a8a4; }
.jp-panel-closed .jp-panel-meta strong { color: #555; }
.jp-panel-closed .jp-panel-desc { color: #6a6a66; }

/* Status flag in the card header, where an open card carries nothing. */
.jp-closed-flag {
    flex-shrink: 0; display: inline-flex; align-items: center;
    font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    padding: .32em .8em; border-radius: 20px;
    background: #efefec; color: #7a7a74; border: 1px solid #e0e0dc;
}

/* Primary action on a closed card: same shape as .btn-jp-apply, grey instead of green. */
.btn-jp-closed {
    font-size: .86rem; font-weight: 600; padding: .5em 1.3em; border-radius: 8px;
    background: #8a8a84; color: #fff;
    border: 1.5px solid #8a8a84; text-decoration: none; transition: background .15s, border-color .15s;
    display: inline-flex; align-items: center;
}
.btn-jp-closed:hover { background: #6f6f6a; border-color: #6f6f6a; color: #fff; }

/* ── Nationality eligibility (NRP / IRP) ──
   Marks which posts are locked to a nationality so a candidate can see it on the card,
   before spending time on a profile and an application. */
.jp-elig {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .01em;
    padding: .18rem .6rem; border-radius: 20px; white-space: nowrap;
}
.jp-elig-locked { background: #fdecea; color: #a5342a; border: 1px solid #f5c6c1; }
.jp-elig-open   { background: #eef7e4; color: #3a6b10; border: 1px solid #c8ddb8; }
.jp-elig i { font-size: .68rem; }

/* Same pair for the job-detail facts strip, matching the existing .jd-badge shape. */
.jd-badge-locked { background: #fdecea; color: #a5342a; border: 1px solid #f5c6c1; }
.jd-badge-open   { background: #eef7e4; color: #3a6b10; border: 1px solid #c8ddb8; }

/* Persistent "not open to your nationality" banner on the job page. The toastr shown
   on the Apply click fades; this stays until dismissed. */
.jd-block-banner {
    display: flex; align-items: flex-start; gap: .85rem;
    background: #fdecea; border: 1px solid #f5b7b1; border-left: 4px solid #c0392b;
    border-radius: var(--aphrc-radius);
    padding: .9rem 1rem; margin-bottom: .85rem;
}
.jd-block-icon { color: #c0392b; font-size: 1.05rem; margin-top: .15rem; flex-shrink: 0; }
.jd-block-text { flex: 1 1 auto; min-width: 0; font-size: .86rem; line-height: 1.6; color: #6b2f28; }
.jd-block-title { font-weight: 700; color: #922b21; margin-bottom: .15rem; }
.jd-block-close {
    flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
    color: #c0392b; opacity: .65; padding: .1rem .3rem; line-height: 1;
    font-size: .95rem; border-radius: 4px;
}
.jd-block-close:hover { opacity: 1; background: rgba(192,57,43,.1); }

/* ── "Load More" control (shared by both job lists) ── */
.jp-lm-item { scroll-margin-top: var(--jp-sticky-offset, 90px); }
.jp-loadmore { text-align: center; margin: 8px 0 32px; }
.btn-jp-loadmore {
    font-size: .9rem; font-weight: 700; padding: .7em 2.2em; border-radius: 24px;
    border: 1.5px solid var(--aphrc-green); color: #3a6b10; background: #fff;
    cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
    display: inline-flex; align-items: center;
}
.btn-jp-loadmore:hover {
    background: var(--aphrc-green); color: #fff; box-shadow: 0 4px 14px rgba(123,193,72,.28);
}
.jp-lm-count { font-size: .78rem; color: var(--aphrc-grey); margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════
   AUTH — Login & Register pages
   ═══════════════════════════════════════════════════════════════ */
.footer-aphrc.auth-no-margin { margin-top: 0 !important; }

/* Login / Create Account — two shapes out of one markup order (photo, then form).
   Desktop (>=768px): the split — campus photo under a green tint with particles
   drifting over it on the left, the form on the right.
   Phone / narrow: the photo becomes a banner across the top carrying the logo and
   wording, and the form is a white sheet pulled up over the banner's bottom edge.
   The photo used to be display:none below 768px, which left a bare form under a
   small logo — that is what made these pages look unfinished on a phone. */
.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    /* Banner takes its own height, the sheet takes the rest, so on a tall phone
       the white runs to the bottom instead of stopping mid-screen. */
    grid-template-rows: auto minmax(0, 1fr);
    min-height: calc(100vh - 58px);
    /* Phone browsers' toolbars: 100vh overshoots while they are showing. */
    min-height: calc(100dvh - 58px);
    background: #fff;
}
.auth-left  {
    position: relative; overflow: hidden;
    /* Tall enough to read as a photo rather than a stripe, capped so a tablet
       still gets the form above the fold. Landscape phones hit the 190px floor. */
    height: clamp(190px, 36vh, 300px);
    background-color: #17311c;
    /* The view passes only the image URL as --auth-photo, so the crop below stays
       in the stylesheet instead of being locked away in an inline shorthand. */
    background-image: var(--auth-photo);
    background-size: cover;
    background-repeat: no-repeat;
    /* In the banner crop the entrance and the #IamAPHRC sign sit low in the frame;
       centring would show mostly sky. */
    background-position: center 62%;
}
/* Dark green tint sits BELOW the particles so the dots stay visible over it */
.auth-left::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(45,80,21,.80); z-index: 0;
}
/* Particles canvas above the tint, below the text */
#auth-particles     { position: absolute; inset: 0; z-index: 1; }
.auth-left-overlay  {
    position: absolute; inset: 0; background: transparent; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; color: #fff;
    /* Extra at the bottom: the sheet below overlaps the banner by 26px, so the
       wording sits in the part of the banner that stays visible. Everything here
       is sized to fit the banner's 190px floor. */
    padding: 12px 22px 42px;
}
.auth-left-overlay img { display: block; max-width: 104px; margin-bottom: 8px; }
.auth-left-overlay h3 { font-weight: 800; font-size: 1.15rem; margin-bottom: 0; }
.auth-left-overlay p  { opacity: .9; font-size: .78rem; max-width: 300px; line-height: 1.45; margin: 8px 0 0; }
.auth-left-divider { width: 44px; height: 3px; background: var(--aphrc-yellow); border-radius: 2px; margin: 8px auto 0; }
.auth-left-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px; padding: .3em .9em; font-size: .75rem;
    color: var(--aphrc-green-light); font-weight: 600; margin-top: 16px; letter-spacing: .04em;
}
/* The sheet: pulled up over the banner with rounded top corners and a soft shadow
   along its top edge, so the photo reads as behind the form rather than stacked
   above it. */
.auth-right {
    position: relative; z-index: 3;
    display: flex; align-items: flex-start; justify-content: center;
    background: #fff;
    margin-top: -26px;
    padding: 28px 20px 34px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 26px rgba(20,40,20,.12);
}
.auth-box   { width: 100%; max-width: 400px; }

/* Desktop: the split. The banner becomes the full-height left half with the full
   wording; the sheet loses its overlap, radius and shadow and centres its form. */
@media (min-width: 768px) {
    .auth-page { display: flex; align-items: stretch; }
    .auth-left {
        flex: 1 1 0; height: auto; min-height: 400px;
        background-position: center;
    }
    .auth-left-overlay { padding: 48px 36px; }
    .auth-left-overlay img { max-width: 170px; margin-bottom: 26px; }
    .auth-left-overlay h3 { font-size: 1.6rem; margin-bottom: 8px; }
    .auth-left-overlay p  { opacity: .8; font-size: .9rem; line-height: 1.6; margin: 0; }
    .auth-left-divider { width: 50px; margin: 20px auto; }
    .auth-right {
        flex: 1 1 0; align-items: center;
        margin-top: 0; padding: 48px 28px;
        border-radius: 0; box-shadow: none;
    }
}
.auth-box .form-control {
    border-radius: 8px; padding: .65rem .9rem; font-size: .93rem; border: 1.5px solid #e0e0e0;
}
.auth-box .form-control:focus { border-color: var(--aphrc-green); box-shadow: 0 0 0 3px rgba(123,193,72,.2); }
.auth-box .form-label { font-weight: 600; font-size: .83rem; color: #555; margin-bottom: .35rem; }
.pass-wrap          { position: relative; }
.pass-wrap .pass-toggle {
    position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    cursor: pointer; color: var(--aphrc-green); font-size: 1.05rem; line-height: 1;
}
.pass-wrap .pass-toggle:hover { color: #5d9933; }
.btn-auth-primary {
    background: var(--aphrc-green); border: none; color: #fff;
    border-radius: 8px; font-weight: 700; font-size: .95rem;
    padding: .7rem 1rem; transition: background .2s; width: 100%;
}
.btn-auth-primary:hover { background: #5d9933; }
.auth-link      { color: var(--aphrc-green); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: #5d9933; }
.auth-divider {
    display: flex; align-items: center; gap: 12px; margin: 22px 0;
    font-size: .8rem; color: var(--aphrc-grey);
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e8e8e8; }

/* Register */
.auth-wrap { display: flex; min-height: calc(100vh - 58px - 92px); align-items: stretch; }
.auth-img-panel { flex: 1 1 0; position: relative; min-height: 400px; }
@media (max-width: 767px) { .auth-img-panel { display: none; } }
.auth-img-overlay {
    position: absolute; inset: 0;
    background: rgba(123,193,72,.82);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px; text-align: center; color: #fff;
}
.auth-form-panel  { flex: 1 1 0; display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: #fff; overflow-y: auto; }
.auth-form-inner  { width: 100%; max-width: 460px; }
.auth-form-inner .form-control:focus { border-color: var(--aphrc-green); box-shadow: 0 0 0 .2rem rgba(123,193,72,.25); }
.auth-form-inner .btn-primary { background: var(--aphrc-green); border-color: var(--aphrc-green); }
.auth-form-inner .btn-primary:hover { background: #5d9933; border-color: #5d9933; }

/* Live password-requirement checklist (Register / set-password pages) */
#pw-criteria { display: none; background: rgba(185, 217, 137, 0.25); }
.pw-req { font-size: .78rem; margin-bottom: .3rem; color: #b02a37; }
.pw-req:last-child { margin-bottom: 0; }
.pw-req.ok { color: #2e7d32; }
.pw-req i { width: 14px; }
.pw-match-ok { color: #2e7d32; font-size: .8rem; font-weight: 600; }
.pw-match-bad { color: #b02a37; font-size: .8rem; font-weight: 600; }
.invalid-field { border-color: #dc3545 !important; }
/* Agreement checkbox not ticked — red boundary + red label to draw the eye.
   Left padding stays ≥ Bootstrap's 1.5em so the floated checkbox stays inside. */
.invalid-agree {
    border: 1px solid #dc3545; border-radius: 6px;
    padding: .55rem .65rem .55rem 1.9em; background: #fdf2f2;
}
.invalid-agree .form-check-label { color: #b02a37; }

/* ── Modal sticky footer (form wraps body+footer inside scrollable modal) ── */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
}
.modal-dialog-scrollable .modal-content > form .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
.modal-dialog-scrollable .modal-content > form .modal-footer {
    flex-shrink: 0;
}

/* ── Profile Edit form ─────────────────────────────────────── */
.pe-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8ea;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: .5rem;
}
.pe-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #e8e8ea;
    flex-wrap: wrap;
    gap: .5rem;
}
.pe-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: .95rem;
    color: var(--aphrc-green-dk);
}
.pe-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: #eef7e4;
    display: flex; align-items: center; justify-content: center;
    color: var(--aphrc-green);
    font-size: .85rem;
    flex-shrink: 0;
}
.pe-card-body { padding: 1.25rem; }
.pe-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.pe-label .req { color: #c62828; font-size: .75rem; }
.pe-field { margin-bottom: 0; }
.pe-field .form-control,
.pe-field .form-select {
    border: 1px solid #dddcde;
    border-radius: 6px;
    font-size: .875rem;
    min-height: 38px;
    padding: .4rem .65rem;
    transition: border-color .15s, box-shadow .15s;
}
.pe-field .form-control:focus,
.pe-field .form-select:focus {
    border-color: var(--aphrc-green);
    box-shadow: 0 0 0 3px rgba(123,193,72,.18);
    outline: none;
}
.pe-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .875rem 1.25rem;
}
@media (max-width: 576px) {
    /* Keep two compact columns on mobile (first/last, gender/DOB pair up) */
    .pe-grid-2 { gap: .6rem .6rem; }
}
/* Online link rows */
.pe-link-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .65rem;
    border: 1px solid #e8e8ea;
    border-radius: 8px;
    background: #fafafa;
    margin-bottom: .5rem;
}
.pe-link-row:hover { border-color: var(--aphrc-green); background: #f5fbef; }
.pe-link-icon {
    width: 28px; text-align: center; flex-shrink: 0;
    color: var(--aphrc-green); font-size: 1rem;
}
.pe-link-row .form-control {
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: .84rem;
    padding: .3rem .5rem;
    min-height: 34px;
    background: transparent;
}
.pe-link-row .form-control:focus {
    border-color: var(--aphrc-green);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(123,193,72,.15);
    outline: none;
}
.pe-link-name { max-width: 140px; flex-shrink: 0; }

/* ── Job Detail page (jd-*) ───────────────────────────────── */
.jd-back-link {
    display: inline-flex; align-items: center; gap: .45rem;
    margin-bottom: .6rem;
    font-size: .82rem; font-weight: 600; color: var(--aphrc-green-dk);
    text-decoration: none;
    background: #fff; border: 1px solid #e4e8e0; border-radius: 999px;
    padding: .35rem .85rem; box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: background .15s, border-color .15s;
}
.jd-back-link:hover { background: #f3f7ee; border-color: var(--aphrc-green); color: var(--aphrc-green-dk); }
.jd-back-link i { font-size: .75rem; }

.jd-card {
    background: #fff;
    border-radius: var(--aphrc-radius);
    border: 1px solid #e8e8ea;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: .5rem;
}
.jd-card-header {
    display: flex;
    align-items: center;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #e8e8ea;
    gap: .625rem;
}
.jd-card-header-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: .92rem;
    color: var(--aphrc-green-dk);
}
.jd-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    background: var(--aphrc-green-lt);
    display: flex; align-items: center; justify-content: center;
    color: var(--aphrc-green);
    font-size: .8rem;
    flex-shrink: 0;
}
.jd-card-body { padding: 1.25rem; }
/* Job title + meta in header card */
.jd-job-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--aphrc-green-dk);
    margin: 0 0 .35rem;
    line-height: 1.3;
}
.jd-meta-line {
    font-size: .83rem;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-bottom: .85rem;
}
.jd-meta-sep { opacity: .35; }
/* Pill badges */
.jd-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.jd-badge {
    display: inline-flex; align-items: center; gap: .2rem;
    padding: .28rem .72rem;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1;
}
.jd-badge-green  { background: var(--aphrc-green-lt); color: var(--aphrc-green-dk); }
.jd-badge-grey   { background: #f0f0f1; color: #666; }
.jd-badge-red    { background: #fdecea; color: #c62828; }
.jd-badge-amber  { background: #fff3e0; color: #e65100; }
/* Rich-text content (from Quill editor — admin-authored HTML) */
.jd-rich-text { font-size: .88rem; line-height: 1.75; color: #2c2c2c; }
.jd-rich-text p { margin: 0 0 .65rem; }
.jd-rich-text p:last-child { margin-bottom: 0; }
.jd-rich-text ul, .jd-rich-text ol { padding-left: 1.4rem; margin: 0 0 .65rem; }
.jd-rich-text li { margin-bottom: .3rem; }
/* Headings the Quill editor can produce (h1–h6). Shared style here, then a gentle
   descending size scale below so levels are visually ordered (h3 > h4 > h5 …).
   The smallest (h5/h6) stays at .95rem — the size we had — so nothing balloons.
   Previously h4/h5/h6 were uncovered and fell back to Bootstrap's larger defaults
   (e.g. h5 = 1.25rem), which made higher heading numbers render bigger. */
.jd-rich-text h1, .jd-rich-text h2, .jd-rich-text h3,
.jd-rich-text h4, .jd-rich-text h5, .jd-rich-text h6 {
    font-weight: 700;
    color: var(--aphrc-green-dk);
    margin: .75rem 0 .4rem;
    line-height: 1.3;
}
.jd-rich-text h1 { font-size: 1.35rem; }
.jd-rich-text h2 { font-size: 1.2rem; }
.jd-rich-text h3 { font-size: 1.1rem; }
.jd-rich-text h4 { font-size: 1.02rem; }
.jd-rich-text h5 { font-size: .95rem; }
.jd-rich-text h6 { font-size: .95rem; }
.jd-rich-text strong, .jd-rich-text b { font-weight: 700; }
.jd-rich-text em, .jd-rich-text i { font-style: italic; }
.jd-rich-text u { text-decoration: underline; }
.jd-rich-text s, .jd-rich-text strike { text-decoration: line-through; }
.jd-rich-text sub { vertical-align: sub; font-size: .8em; }
.jd-rich-text sup { vertical-align: super; font-size: .8em; }
.jd-rich-text img { max-width: 100%; height: auto; }
/* Tables from the ERP editor - the sanitizer drops their inline borders, so they are ruled here */
.jd-rich-text table { width: 100%; margin: 0 0 .65rem; border-collapse: collapse; table-layout: fixed; }
.jd-rich-text td, .jd-rich-text th { padding: .35rem .6rem; border: 1px solid #d5dcd2; vertical-align: top; text-align: left; }
.jd-rich-text blockquote {
    border-left: 3px solid var(--aphrc-green); margin: .5rem 0;
    padding: .15rem .8rem; color: #555;
}
/* Links authored in the ERP editor — the sanitizer already forces target=_blank. */
.jd-rich-text a { color: var(--aphrc-green-dk); text-decoration: underline; }
.jd-rich-text a:hover { color: var(--aphrc-green); }
/* Quill's presentation classes. These now survive sanitizing, so they need styling
   here as well as in the printable report, or alignment and indent do nothing on the
   job page. Quill 1.3.6 emits <ul>/<ol>; data-list is Quill 2 markup, kept for parity
   with the report. */
.jd-rich-text .ql-align-center  { text-align: center; }
.jd-rich-text .ql-align-right   { text-align: right; }
.jd-rich-text .ql-align-justify { text-align: justify; }
.jd-rich-text .ql-indent-1 { padding-left: 3em; }
.jd-rich-text .ql-indent-2 { padding-left: 6em; }
.jd-rich-text .ql-indent-3 { padding-left: 9em; }
.jd-rich-text .ql-indent-4 { padding-left: 12em; }
.jd-rich-text li[data-list="bullet"]  { list-style-type: disc; }
.jd-rich-text li[data-list="ordered"] { list-style-type: decimal; }
/* Sidebar definition list */
.jd-dl { margin: 0; }
.jd-dl-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .55rem 0;
    border-bottom: 1px solid #f2f2f3;
    gap: .5rem;
}
.jd-dl-row:last-child { border-bottom: none; padding-bottom: 0; }
.jd-dl-row dt {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #999;
    flex-shrink: 0;
    white-space: nowrap;
}
.jd-dl-row dd {
    font-size: .84rem;
    font-weight: 600;
    color: #333;
    text-align: right;
    margin: 0;
}
.jd-dl-row dd.jd-urgent { color: #c62828; }
/* Documents checklist */
.jd-doc-list { list-style: none; padding: 0; margin: 0; }
.jd-doc-list li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .45rem 0;
    border-bottom: 1px solid #f2f2f3;
    font-size: .86rem;
    color: #444;
    line-height: 1.4;
}
.jd-doc-list li:last-child { border-bottom: none; padding-bottom: 0; }
.jd-doc-list li i { color: var(--aphrc-green); margin-top: .15rem; flex-shrink: 0; }
/* Already-applied banner */
.jd-applied-banner {
    border-radius: var(--aphrc-radius);
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--aphrc-green-dk), var(--aphrc-green));
    color: #fff;
    text-align: center;
    margin-bottom: 1.25rem;
}
.jd-applied-banner i { font-size: 1.8rem; display: block; margin-bottom: .4rem; opacity: .9; }
.jd-applied-banner .jd-ab-title { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.jd-applied-banner .jd-ab-sub   { font-size: .78rem; opacity: .85; margin-bottom: .75rem; }

/* Apply CTA in job details sidebar */
.jd-apply-wrap { padding-top: 1rem; border-top: 1px solid #e8e8ea; margin-top: .25rem; }
.btn-jd-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: .7rem 1rem;
    background: var(--aphrc-green);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn-jd-apply:hover  { background: var(--aphrc-green-dk); color: #fff; transform: translateY(-1px); }
.btn-jd-apply:active { transform: translateY(0); }
.jd-apply-deadline {
    text-align: center;
    font-size: .73rem;
    color: #999;
    margin: .45rem 0 0;
}

/* ── Locked apply next button ──────────────────────────────── */
.btn-ap-next.ap-btn-locked {
    background: var(--aphrc-grey);
    border-color: var(--aphrc-grey);
    cursor: not-allowed;
    opacity: .72;
    position: relative;
}
.btn-ap-next.ap-btn-locked::before {
    content: '\f023';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 6px;
    font-size: .8rem;
}

/* ── Job Details — floating sticky bar (job title + Apply Now) ──
   Hidden until the user scrolls past the header card, then slides down just
   below the navbar. `top` is set in JS to the live navbar height. */
.jd-sticky-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1020;
    background: #fff; border-bottom: 1px solid #e4e8e0;
    box-shadow: 0 3px 12px rgba(0,0,0,.09);
    transform: translateY(-120%); transition: transform .25s ease;
    will-change: transform;
}
.jd-sticky-bar.show { transform: translateY(0); }
.jd-sticky-inner {
    display: flex; align-items: center; gap: 16px; padding: 10px 0;
}
.jd-sticky-title {
    font-size: 1rem; font-weight: 700; color: #1a2e0a; margin: 0;
    flex: 1 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jd-sticky-bar .btn-jd-apply { flex-shrink: 0; width: auto; padding: .45rem 1.3rem; font-size: .85rem; }
/* Back rides along in the bar: same pill, minus the standalone bottom margin. */
.jd-sticky-back { margin: 0; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .jd-sticky-title { font-size: .9rem; }
    .jd-sticky-bar .btn-jd-apply { padding: .4rem .9rem; font-size: .8rem; }
    /* Arrow only on a phone — the title and Apply need the width more than the label does. */
    .jd-sticky-back-label { display: none; }
    .jd-sticky-back { padding: .35rem .55rem; }
}

/* ── Job Details — header card, facts strip, masonry ───────── */
.jd-header-card .jd-card-header { flex-wrap: wrap; }
.btn-jd-apply-hd {
    display: inline-flex;
    width: auto;
    padding: .5rem 1.4rem;
    font-size: .85rem;
}
/* Title block and facts share one row: title left, facts right, both top-aligned.
   Below ~768px the facts wrap under the title and pick up a separator, which is the
   only point at which they read as a second row. */
.jd-title-row {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    justify-content: space-between; gap: .5rem 2rem;
}
.jd-title-block { flex: 1 1 300px; min-width: 0; }
.jd-title-block .jd-meta-line { margin-bottom: 0; }
.jd-facts {
    display: flex; flex-wrap: wrap;
    gap: .5rem 2rem;
    flex: 0 1 auto;
    justify-content: flex-end;
    /* Nudge down so the labels line up with the title's cap height rather than its box. */
    padding-top: .2rem;
}
@media (max-width: 767.98px) {
    .jd-facts {
        flex-basis: 100%;
        justify-content: flex-start;
        padding-top: .85rem;
        margin-top: .3rem;
        border-top: 1px solid #f0f2ee;
    }
}
.jd-fact-label {
    font-size: .66rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: #999; margin-bottom: 2px;
}
.jd-fact-value { font-size: .86rem; font-weight: 600; color: #333; }
.jd-fact-value.jd-urgent { color: #c62828; }
/* Single-column content stack */
.jd-stack { display: flex; flex-direction: column; gap: .5rem; }
.jd-stack .jd-card { margin-bottom: 0; }
/* Section headings inside the big "About This Role" card — styled to match
   the card header (.jd-card-header-title): green icon chip + bold heading */
/* The advert's footer text: no heading, so the same rule and gap a section head brings
   keep it from running on from the qualifications */
.jd-advert-footer { margin-top: 1.6rem; padding-top: 1.25rem; border-top: 1px solid #e8e8ea; }
.jd-section-head {
    display: flex; align-items: center; gap: .5rem;
    font-weight: 700; font-size: .92rem; color: var(--aphrc-green-dk);
    margin: 1.6rem 0 .85rem; padding-top: 1.25rem;
    border-top: 1px solid #e8e8ea;
}
.jd-section-head:first-child { margin-top: 0; padding-top: 0; border-top: none; }
/* Legacy masonry (no longer used on details) collapses to one column */
.jd-masonry { column-count: 1; }
/* Horizontal already-applied banner */
.jd-applied-banner-row {
    display: flex; align-items: center; gap: 1rem;
    text-align: left; padding: .9rem 1.25rem;
}
.jd-applied-banner-row i { font-size: 1.5rem; margin-bottom: 0; }
/* Bottom call-to-action strip */
.jd-bottom-cta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--aphrc-green-lt), #fff);
    border: 1px solid #d4e8b8; border-radius: var(--aphrc-radius);
    padding: 1.1rem 1.5rem;
}
.jd-bottom-cta-title { font-weight: 700; font-size: .98rem; color: var(--aphrc-green-dk); }
.jd-bottom-cta-sub   { font-size: .8rem; color: #777; }

/* ── Apply wizard extras ───────────────────────────────────── */
.ap-step-tag {
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--aphrc-green-dk);
    background: rgba(255,255,255,.65);
    border: 1px solid #c8ddb8;
    padding: .25em .7em; border-radius: 20px;
}
.ap-required { color: #dc3545; font-weight: 700; }
.ap-cv-choice { background: var(--aphrc-green-lt); border: 1px solid #c8ddb8; }
/* ── Profile strength checklist ────────────────────────────── */
.prof-check-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem 0;
    border-bottom: 1px solid #f0f4ec;
    font-size: .86rem; color: #444;
}
.prof-check-row:last-child { border-bottom: none; padding-bottom: 0; }
.prof-check-row i { font-size: .95rem; color: #d8d8da; flex-shrink: 0; }
.prof-check-row.done i { color: var(--aphrc-green); }
.prof-check-row.done span { color: #333; }
.prof-check-row a {
    margin-left: auto; flex-shrink: 0;
    font-size: .76rem; font-weight: 700;
    color: var(--aphrc-green); text-decoration: none;
}
.prof-check-row a:hover { color: var(--aphrc-green-dk); text-decoration: underline; }
.prof-check-row.optional span small { font-size: .72rem; }

/* ── Profile documents ─────────────────────────────────────── */
.prof-doc-row {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .7rem;
    border: 1px solid #eef0ec; border-radius: 8px;
    background: #fafcf8; margin-bottom: .45rem;
}
.prof-doc-icon { color: var(--aphrc-green); font-size: 1.05rem; flex-shrink: 0; }
.prof-doc-info { flex: 1; min-width: 0; }
.prof-doc-name {
    font-size: .84rem; font-weight: 600; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prof-doc-meta { font-size: .72rem; color: var(--aphrc-grey); }
.prof-doc-type {
    display: inline-block; padding: .05em .5em; border-radius: 10px;
    background: var(--aphrc-green-lt); color: var(--aphrc-green-dk);
    font-weight: 700; font-size: .66rem; letter-spacing: .03em;
}
.prof-doc-upload {
    border-top: 1px dashed #d8e5c8; padding-top: .85rem;
}

/* ── Apply: chosen-file feedback chip ──────────────────────── */
.ap-file-chosen {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; padding: .3em .8em;
    background: var(--aphrc-green-lt); border: 1px solid #c8ddb8;
    border-radius: 20px; font-size: .78rem; font-weight: 600;
    color: var(--aphrc-green-dk); max-width: 100%;
}
.ap-file-chosen i { color: var(--aphrc-green); flex-shrink: 0; }
.ap-file-chosen .ap-file-chosen-name {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Footer office addresses ───────────────────────────────── */
.footer-address {
    font-style: normal;
    font-size: .72rem;
    line-height: 1.55;
    color: var(--aphrc-grey);
    margin-bottom: 0;
}
.footer-address i { color: var(--aphrc-green); width: 14px; }
.footer-divider {
    border-color: rgba(255,255,255,.15);
    margin: .65rem 0 .5rem;
}
.footer-aphrc .row.gy-4 { --bs-gutter-y: .9rem; }

/* ── Toastr: brand the "Notice" (warning) toast ──────────────────
   toastr ships an orange warning toast; recolour it to the APHRC yellow
   with dark text for contrast (the yellow is too light for white text). */
#toast-container > .toast-warning {
    background-color: var(--aphrc-yellow);
    color: #2d3a14;
}
#toast-container > .toast-warning .toast-title,
#toast-container > .toast-warning .toast-message { color: #2d3a14; }
#toast-container > .toast-warning .toast-close-button { color: #2d3a14; text-shadow: none; opacity: .7; }
#toast-container > .toast-warning .toast-close-button:hover { opacity: 1; }
#toast-container > .toast-warning .toast-progress { background-color: rgba(0,0,0,.25); }
