/* ============================================================
   UDM — Expression of Interest (Form UDM/EOI/01)
   Public aspirant registration page. Builds on the tokens in
   udm-design.css and reuses .udm-ff / .udm-btn from udm-pages.css.
   ============================================================ */

/* ░░ HERO ░░ */
.eoi-hero {
    position: relative;
    background: linear-gradient(135deg, var(--udm-night) 0%, #4A1216 55%, var(--udm-primary-dark) 100%);
    color: #fff;
    padding: 72px 0 84px;
    overflow: hidden;
}

.eoi-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--udm-primary), var(--udm-accent));
}

.eoi-hero__inner {
    max-width: var(--udm-wrap);
    margin: 0 auto;
    padding: 0 var(--udm-wrap-pad);
    position: relative;
    z-index: 1;
}

.eoi-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 183, 5, .16);
    border: 1px solid rgba(242, 183, 5, .4);
    color: var(--udm-accent);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: var(--udm-radius-pill);
}

.eoi-hero__title {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 18px 0 14px;
    max-width: 18ch;
}

.eoi-hero__title span { color: var(--udm-accent); }

.eoi-hero__desc {
    font-size: 1.02rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .85);
    max-width: 62ch;
    margin: 0 0 26px;
}

.eoi-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Deadline / countdown chip */
.eoi-deadline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--udm-radius-pill);
    padding: 9px 16px;
    font-size: .88rem;
    font-weight: 600;
}

.eoi-deadline i { color: var(--udm-accent); font-size: 1.05rem; }

/* ░░ SECTION SHELL ░░ */
.eoi-section {
    max-width: var(--udm-wrap);
    margin: 0 auto;
    padding: 56px var(--udm-wrap-pad);
}

.eoi-section--alt { background: var(--udm-surface); max-width: none; }
.eoi-section--alt > * { max-width: var(--udm-wrap); margin-inline: auto; }

.eoi-shead { text-align: center; margin-bottom: 34px; }

.eoi-shead__eyebrow {
    display: block;
    color: var(--udm-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.eoi-shead__title {
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 800;
    color: var(--udm-ink);
    margin: 0 0 10px;
}

.eoi-shead__sub {
    color: var(--udm-muted);
    font-size: .98rem;
    max-width: 62ch;
    margin: 0 auto;
    line-height: 1.7;
}

/* ░░ FEE SCHEDULE ░░ */
.eoi-fees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.eoi-fee {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: var(--udm-radius);
    padding: 22px 20px;
    text-align: center;
    transition: transform .25s var(--udm-ease), box-shadow .25s var(--udm-ease);
}

.eoi-fee:hover { transform: translateY(-4px); box-shadow: var(--udm-shadow-lg); }

.eoi-fee__ico {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(211, 0, 15, .08);
    color: var(--udm-primary);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.eoi-fee__name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--udm-ink);
    margin: 0 0 6px;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eoi-fee__amount {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--udm-primary);
}

.eoi-fee__note { display: block; font-size: .74rem; color: var(--udm-muted); margin-top: 4px; }

/* ░░ PAY-TO PANEL ░░ */
.eoi-paypanel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 26px;
}

.eoi-paycard {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-left: 4px solid var(--udm-accent);
    border-radius: var(--udm-radius-sm);
    padding: 20px 22px;
}

.eoi-paycard h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--udm-ink);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eoi-paycard dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.eoi-paycard dt { font-size: .82rem; color: var(--udm-muted); font-weight: 600; }
.eoi-paycard dd { font-size: .9rem; color: var(--udm-ink); font-weight: 700; margin: 0; }

/* ░░ PAY-NOW STEPS ░░
   The whole manual-payment flow hangs off these four lines, so they are styled to be
   read and followed on a phone while the aspirant is in the M-Pesa menu. */
.eoi-paysteps {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-left: 4px solid var(--udm-whatsapp);
    border-radius: var(--udm-radius-sm);
    padding: 20px 22px;
}

.eoi-paysteps__h {
    font-size: 1rem;
    font-weight: 800;
    color: var(--udm-ink);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eoi-paysteps__h i { color: var(--udm-whatsapp); }

.eoi-paysteps__list {
    margin: 0 0 14px;
    padding-left: 20px;
    font-size: .9rem;
    color: var(--udm-ink);
    line-height: 2.1;
}

.eoi-paysteps__val {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 800;
    font-size: 1rem;
    background: rgba(31, 168, 85, .1);
    color: #11602F;
    border-radius: 6px;
    padding: 2px 10px;
    margin-left: 2px;
    user-select: all;
}

.eoi-paysteps__hint { font-size: .78rem; color: var(--udm-muted); margin-left: 4px; }

.eoi-paysteps__note {
    font-size: .82rem;
    color: var(--udm-muted);
    line-height: 1.7;
    margin: 0 0 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--udm-border);
}

.eoi-payform { margin: 0; }

/* ░░ WHO PAID ░░
   Grouped and tinted so it reads as one question ("who made this payment?")
   rather than three more fields tacked onto the payment block. */
.eoi-payer {
    background: rgba(42, 13, 16, .03);
    border: 1px dashed var(--udm-border);
    border-radius: var(--udm-radius-sm);
    padding: 16px 18px;
}

.eoi-payer__h {
    font-size: .88rem;
    font-weight: 800;
    color: var(--udm-ink);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.eoi-payer__h i { color: var(--udm-primary); }

.eoi-payer__hint {
    font-size: .76rem;
    font-weight: 500;
    color: var(--udm-muted);
}

.eoi-payer__note {
    font-size: .8rem;
    color: #11602F;
    background: rgba(31, 168, 85, .09);
    border-left: 3px solid var(--udm-whatsapp);
    border-radius: 4px;
    padding: 8px 12px;
    margin: 14px 0 0;
    line-height: 1.6;
}

/* ░░ FORM SHELL ░░ */
.eoi-form-wrap {
    max-width: 920px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: var(--udm-radius);
    box-shadow: var(--udm-shadow-lg);
    overflow: hidden;
}

.eoi-form-wrap__head {
    background: var(--udm-night);
    color: #fff;
    padding: 22px 28px;
}

.eoi-form-wrap__head h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px; }
.eoi-form-wrap__head p { font-size: .85rem; color: rgba(255, 255, 255, .72); margin: 0; }
.eoi-form-wrap__head .eoi-formcode { color: var(--udm-accent); font-weight: 700; }

.eoi-form-body { padding: 28px; }

/* Lettered section headers — mirrors the printed form's A/B/C bands */
.eoi-fsec {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 34px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--udm-border);
}

.eoi-fsec:first-of-type { margin-top: 0; }

.eoi-fsec__letter {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 7px;
    background: var(--udm-primary);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    display: grid;
    place-items: center;
}

.eoi-fsec__h { font-size: 1rem; font-weight: 800; color: var(--udm-ink); margin: 0; letter-spacing: .02em; }
.eoi-fsec__hint { font-size: .8rem; color: var(--udm-muted); margin-left: auto; text-align: right; }

/* ░░ DECLARATION ROWS (Section D) ░░ */
.eoi-decl {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--udm-border);
}

.eoi-decl:last-child { border-bottom: none; }
.eoi-decl__text { flex: 1; font-size: .89rem; color: var(--udm-ink); line-height: 1.6; }
.eoi-decl__opts { display: flex; gap: 8px; flex: none; padding-top: 2px; }

.eoi-radio {
    position: relative;
    display: inline-flex;
}

.eoi-radio input { position: absolute; opacity: 0; width: 0; height: 0; }

.eoi-radio span {
    display: inline-grid;
    place-items: center;
    min-width: 54px;
    padding: 7px 12px;
    border: 1px solid var(--udm-border-strong);
    border-radius: var(--udm-radius-pill);
    font-size: .8rem;
    font-weight: 700;
    color: var(--udm-muted);
    cursor: pointer;
    transition: all .18s var(--udm-ease);
    user-select: none;
}

.eoi-radio input:checked + span {
    background: var(--udm-night);
    border-color: var(--udm-night);
    color: #fff;
}

.eoi-radio input:focus-visible + span { outline: 2px solid var(--udm-primary); outline-offset: 2px; }

/* "No" answers that block eligibility get a red treatment */
.eoi-radio input[data-blocking="true"]:checked + span {
    background: var(--udm-primary);
    border-color: var(--udm-primary);
}

/* ░░ DOCUMENT UPLOADS (Section E) ░░ */
.eoi-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

.eoi-doc {
    border: 1px dashed var(--udm-border-strong);
    border-radius: var(--udm-radius-sm);
    padding: 14px 16px;
    background: var(--udm-surface-2);
    transition: border-color .2s var(--udm-ease), background .2s var(--udm-ease);
}

.eoi-doc:hover { border-color: var(--udm-primary); background: #fff; }
.eoi-doc--filled { border-style: solid; border-color: var(--udm-whatsapp); background: rgba(31, 168, 85, .05); }
.eoi-doc--invalid { border-color: var(--udm-primary); background: rgba(211, 0, 15, .04); }

.eoi-doc__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--udm-ink);
    margin-bottom: 4px;
}

.eoi-doc__req { color: var(--udm-primary); }
.eoi-doc__opt { font-size: .7rem; font-weight: 600; color: var(--udm-muted); background: var(--udm-surface); padding: 2px 7px; border-radius: var(--udm-radius-pill); }
.eoi-doc__help { font-size: .76rem; color: var(--udm-muted); margin: 0 0 8px; }
.eoi-doc__input { width: 100%; font-size: .8rem; }
.eoi-doc__chosen { display: block; font-size: .76rem; color: var(--udm-whatsapp); font-weight: 600; margin-top: 6px; }

/* ░░ PHOTO UPLOAD ░░ */
.eoi-photo {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px dashed var(--udm-border-strong);
    border-radius: var(--udm-radius-sm);
    background: var(--udm-surface-2);
}

.eoi-photo__preview {
    width: 92px;
    height: 112px;
    flex: none;
    border-radius: 8px;
    border: 1px solid var(--udm-border);
    background: #fff center/cover no-repeat;
    display: grid;
    place-items: center;
    color: var(--udm-muted);
    font-size: 1.6rem;
    overflow: hidden;
}

.eoi-photo__preview img { width: 100%; height: 100%; object-fit: cover; }

/* Once a verified crop is in, hide the placeholder glyph behind it. */
.eoi-photo__preview.has-photo i { display: none; }
.eoi-photo__preview.has-photo { border-color: var(--udm-whatsapp); }

/* ░░ PASSPORT-PHOTO CHECK (face-api) ░░ */
.udm-photochk {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 7px;
    font-size: .79rem;
    font-weight: 600;
    line-height: 1.5;
}

.udm-photochk i { font-size: .95rem; flex: none; margin-top: 1px; }
.udm-photochk--ok { color: #11602F; }
.udm-photochk--bad { color: var(--udm-primary); }
.udm-photochk--check { color: var(--udm-muted); }

/* Spin the loader glyph while detection runs. */
.udm-photochk--check i { animation: udm-photochk-spin 1s linear infinite; }

@keyframes udm-photochk-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .udm-photochk--check i { animation: none; }
}

/* ░░ PAYMENT MODE PICKER (Section F) ░░ */
.eoi-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }

.eoi-mode { position: relative; }
.eoi-mode input { position: absolute; opacity: 0; width: 0; height: 0; }

.eoi-mode span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1.5px solid var(--udm-border-strong);
    border-radius: var(--udm-radius-sm);
    font-size: .88rem;
    font-weight: 700;
    color: var(--udm-ink);
    cursor: pointer;
    background: #fff;
    transition: all .18s var(--udm-ease);
}

.eoi-mode span i { font-size: 1.2rem; color: var(--udm-muted); }
.eoi-mode input:checked + span { border-color: var(--udm-primary); background: rgba(211, 0, 15, .04); box-shadow: 0 0 0 3px rgba(211, 0, 15, .08); }
.eoi-mode input:checked + span i { color: var(--udm-primary); }
.eoi-mode input:disabled + span { opacity: .45; cursor: not-allowed; }

/* ░░ CONSENT ROWS (Section G) ░░ */
.eoi-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--udm-surface-2);
    border-radius: var(--udm-radius-sm);
    margin-bottom: 10px;
}

.eoi-consent input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--udm-primary); }
.eoi-consent label { font-size: .85rem; color: var(--udm-ink); line-height: 1.6; margin: 0; cursor: pointer; }

/* ░░ FEEDBACK ░░ */
.eoi-fieldmsg { display: block; font-size: .78rem; color: var(--udm-primary); font-weight: 600; margin-top: 5px; min-height: 1em; }

.eoi-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--udm-radius-sm);
    font-size: .87rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.eoi-alert i { font-size: 1.15rem; flex: none; margin-top: 1px; }
.eoi-alert--info { background: rgba(42, 13, 16, .05); border-left: 3px solid var(--udm-night); color: var(--udm-ink); }
.eoi-alert--warn { background: rgba(242, 183, 5, .12); border-left: 3px solid var(--udm-accent); color: var(--udm-ink); }
.eoi-alert--error { background: rgba(211, 0, 15, .07); border-left: 3px solid var(--udm-primary); color: var(--udm-primary-dark); }
.eoi-alert--ok { background: rgba(31, 168, 85, .09); border-left: 3px solid var(--udm-whatsapp); color: #11602F; }

/* ░░ FEE CALLOUT ░░ */
.eoi-feebox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--udm-night);
    color: #fff;
    border-radius: var(--udm-radius-sm);
    margin-bottom: 18px;
}

.eoi-feebox__label { font-size: .82rem; color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.eoi-feebox__amount { font-size: 1.6rem; font-weight: 800; color: var(--udm-accent); line-height: 1; }
.eoi-feebox__note { font-size: .78rem; color: rgba(255, 255, 255, .62); }

/* ░░ SUCCESS PANEL ░░ */
.eoi-success { text-align: center; padding: 48px 28px; }

.eoi-success__ico {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(31, 168, 85, .12);
    color: var(--udm-whatsapp);
    display: grid;
    place-items: center;
    font-size: 2.4rem;
}

.eoi-success h3 { font-size: 1.4rem; font-weight: 800; color: var(--udm-ink); margin: 0 0 10px; }
.eoi-success p { color: var(--udm-muted); font-size: .95rem; line-height: 1.7; max-width: 52ch; margin: 0 auto 22px; }

.eoi-refbox {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--udm-surface-2);
    border: 1px dashed var(--udm-border-strong);
    border-radius: var(--udm-radius-sm);
    padding: 14px 22px;
    margin-bottom: 24px;
}

.eoi-refbox__label { font-size: .75rem; color: var(--udm-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.eoi-refbox__value { font-size: 1.15rem; font-weight: 800; color: var(--udm-primary); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.eoi-refbox button { background: none; border: none; color: var(--udm-muted); font-size: 1.1rem; cursor: pointer; padding: 4px; }
.eoi-refbox button:hover { color: var(--udm-primary); }

/* ░░ STATUS LOOKUP ░░ */
.eoi-status-card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: var(--udm-radius);
    box-shadow: var(--udm-shadow-lg);
    padding: 32px;
}

.eoi-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: var(--udm-radius-pill);
    font-size: .78rem;
    font-weight: 700;
}

.eoi-chip--success { background: rgba(31, 168, 85, .13); color: #11602F; }
.eoi-chip--danger { background: rgba(211, 0, 15, .1); color: var(--udm-primary-dark); }
.eoi-chip--warning { background: rgba(242, 183, 5, .18); color: #7A5B00; }
.eoi-chip--info { background: rgba(13, 110, 253, .1); color: #0A4FA8; }
.eoi-chip--primary { background: rgba(42, 13, 16, .09); color: var(--udm-night); }
.eoi-chip--secondary { background: var(--udm-surface-2); color: var(--udm-muted); }

.eoi-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 20px 0 0; }
.eoi-dl dt { font-size: .82rem; color: var(--udm-muted); font-weight: 600; }
.eoi-dl dd { font-size: .9rem; color: var(--udm-ink); font-weight: 700; margin: 0; }

/* ░░ CLOSED NOTICE ░░ */
.eoi-closed { max-width: 620px; margin: 0 auto; text-align: center; padding: 64px 24px; }

.eoi-closed__ico {
    width: 86px;
    height: 86px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--udm-surface-2);
    color: var(--udm-muted);
    display: grid;
    place-items: center;
    font-size: 2.6rem;
}

.eoi-closed h2 { font-size: 1.6rem; font-weight: 800; color: var(--udm-ink); margin: 0 0 12px; }
.eoi-closed p { color: var(--udm-muted); line-height: 1.7; margin: 0 0 24px; }

/* ░░ RESPONSIVE ░░ */
@media (max-width: 768px) {
    .eoi-hero { padding: 52px 0 60px; }
    .eoi-form-body { padding: 20px 16px; }
    .eoi-form-wrap__head { padding: 18px 20px; }
    .eoi-decl { flex-direction: column; gap: 10px; }
    .eoi-decl__opts { width: 100%; }
    .eoi-radio { flex: 1; }
    .eoi-radio span { width: 100%; }
    .eoi-fsec__hint { display: none; }
    .eoi-docs { grid-template-columns: 1fr; }
}
