/* ==========================================================
   APPLICATION WIZARD (template/css/application.css)
   Progress panel on the reading-start side (right in Urdu, left in English),
   green section bar, 4 steps, review + declaration.
========================================================== */

.wizard-hero {
    position: relative; min-height: 174px; overflow: hidden; direction: ltr;
    background: linear-gradient(90deg, #c7d7ce, #f7f7f2 50%, #d8d0c2); border-bottom: 1px solid #dfe7e4;
}
.wizard-hero::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 29%;
    background: linear-gradient(90deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .18)), url('../img/mosque.jpg') center / cover no-repeat; opacity: .92;
}
.wizard-hero::after {
    content: ""; position: absolute; inset: 0 0 0 auto; width: 27%;
    background: linear-gradient(270deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .2)), url('../img/books.jpg') center / cover no-repeat; opacity: .88;
}
.hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .82) 27%, rgba(255, 255, 255, .9) 50%, rgba(255, 255, 255, .82) 73%, rgba(255, 255, 255, .04));
}
.wizard-hero-inner { position: relative; z-index: 2; max-width: 1168px; min-height: 174px; margin: auto; padding: 14px 20px; display: flex; align-items: center; justify-content: center; }
.wizard-title { text-align: center; color: var(--green); }
.wizard-title .eyebrow { display: none; }
.wizard-title h1 { margin: 0; font-family: var(--font-urdu); font-size: 31px; line-height: 1.5; color: var(--green); text-shadow: 0 1px #fff; direction: rtl; }
.wizard-title h3 { margin: 0 0 2px; font: 700 19px var(--font-serif); color: #1c302a; }
.wizard-title p { margin: 0; font-size: 13px; color: #52635d; }

.wizard-shell { max-width: 1168px; margin: 11px auto 0; padding: 0 12px 40px; }

.wizard-card {
    display: grid; grid-template-columns: 278px minmax(0, 1fr); background: #fff; border: 1px solid #dbe5e2; border-radius: 10px;
    box-shadow: 0 3px 15px rgba(21, 62, 51, .08); overflow: hidden;
}
.wizard-card.single { display: block; }
.wizard-loading { grid-column: 1 / -1; min-height: 360px; display: flex; align-items: center; justify-content: center; }
.closed-box { padding: 60px 24px; text-align: center; }
.closed-box h2 { color: var(--green); margin: 0 0 18px; }

/* ── progress panel ── */
.wizard-progress { background: #fff; border-inline-end: 1px solid #e2e9e7; padding: 0 0 14px; min-width: 0; }
.progress-summary { height: 60px; padding: 0 19px; border-bottom: 1px solid #dbe5e2; display: flex; align-items: center; }
.progress-summary strong { font-family: var(--font-urdu); font-size: 22px; color: var(--green); }
[lang="en"] .progress-summary strong { font-family: var(--font-latin); font-size: 18px; }

.steps { padding: 11px 13px 0; display: flex; flex-direction: column; }
.step-dot {
    position: relative; min-height: 74px; padding: 9px 6px; display: flex; align-items: center; gap: 13px;
    color: #1f312c; background: transparent; border: 0; text-align: start; font: inherit; cursor: pointer; width: 100%;
}
.step-dot:disabled { cursor: default; opacity: .55; }
.step-dot:not(:disabled):hover { background: #f1f7f4; }
.step-dot::after { content: ""; position: absolute; inset-inline-start: 24px; top: 63px; width: 2px; height: 24px; background: #d6e2df; }
.step-dot:last-child::after { display: none; }
.step-dot > span {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: #e8eff1; color: #344a44;
    font: 700 17px Arial; display: flex; align-items: center; justify-content: center;
}
.step-dot.active > span, .step-dot.done > span { background: #0b9a68; color: #fff; }
.step-dot.current > span { box-shadow: 0 0 0 3px rgba(11, 154, 104, .18); }
.step-dot.active { color: #0b5d47; }
.step-dot > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-dot b { font: 700 15px var(--font-latin); }
[lang="ur"] .step-dot b { font: 700 16px var(--font-urdu); line-height: 1.2; }
.step-dot small { font: 400 11px Arial, sans-serif; color: #7a8984; }

.sidebar-note { margin: 13px 13px 0; padding: 13px 14px; background: #f1f7ff; border: 1px solid #c9def8; border-radius: 9px; }
.sidebar-note strong { display: block; color: #0a5f8e; font-size: 14px; margin-bottom: 5px; }
.sidebar-note p { margin: 0; font-size: 12px; line-height: 1.9; color: #526b79; }

/* ── form area ── */
.wizard-form { min-width: 0; display: flex; flex-direction: column; }
.wizard-body { flex: 1; }

.section-title {
    position: relative; margin: 0; min-height: 60px; padding: 10px 22px; background: var(--green); color: #fff;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-direction: row-reverse;
    font-family: var(--font-latin); font-size: 21px; line-height: 1.5;
}
[lang="ur"] .section-title { font-family: var(--font-urdu); font-size: 23px; line-height: 1.55; flex-direction: row; }
.section-title small { font: 700 12px Arial; opacity: .92; white-space: nowrap; }
.section-title span { flex: 1; text-align: start; }

.required-note { margin: 12px 20px 6px; padding: 6px 10px; background: #f7faf9; border-inline-start: 3px solid #0b7658; border-radius: 4px; font-size: 12px; color: #6c7c77; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 17px; padding: 12px 20px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.info-note {
    margin: 14px 20px 6px; padding: 10px 13px; background: #f4faf7; border: 1px solid #d8e7e2; border-inline-start: 3px solid #0b7357;
    border-radius: 6px; color: #4d5f59; font-size: 13px; line-height: 1.8;
}
.info-note.compact { margin-top: 4px; }
.draft-note { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; background: #fffaf0; border-color: #f0dfb2; border-inline-start-color: var(--orange); }
.wizard-form .alert-error { margin: 12px 20px 0; }

.academic-single { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 12px; padding: 14px 20px 18px; }
.marks-warning { display: none; margin: 10px 20px 0; padding: 10px 13px; border: 1px solid #efb1aa; border-inline-start: 4px solid #d94b3f; border-radius: 7px; background: #fff3f1; color: #a52f27; font-size: 13px; font-weight: 700; }
.marks-warning.show { display: block; }

.subheading {
    margin: 6px 0 0; padding: 9px 20px; background: #e1ebf8; border-top: 1px solid #cfdae8; border-bottom: 1px solid #cfdbe9;
    color: #164c70; font-weight: 700; font-size: 15px;
}
[lang="ur"] .subheading { font-family: var(--font-urdu); font-size: 17px; }

.choice-card { margin: 14px 20px 6px; padding: 12px 14px; border: 1px solid #d7e3df; border-radius: 8px; background: #fafdfc; }
.choice-card.has-error { border-color: var(--red); background: #fff7f6; }
.choice-card h4 { margin: 0 0 8px; font-size: 14px; color: #38554d; }
.radio-row { display: flex; gap: 28px; align-items: center; min-height: 40px; }
.radio-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
.radio-row input, .notify-row input, .declaration-check input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.optional-scholarship { padding-top: 8px; }
.notify-row { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 14px 20px 4px; }
.notify-row label { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }

.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 20px 4px; }
.review-card { border: 1px solid #dce7e3; border-radius: 8px; overflow: hidden; background: #fff; }
.review-head { padding: 8px 12px; background: #edf6f2; color: var(--green); font-size: 13px; font-weight: 800; }
.review-body { padding: 4px 12px; }
.review-item { display: grid; grid-template-columns: 42% 58%; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #e4ece9; font-size: 12.5px; }
.review-item:last-child { border-bottom: 0; }
.review-item span { color: #71817b; }
.review-item strong { color: #243b34; word-break: break-word; }

.declaration-box { margin: 18px 20px; padding: 16px; border: 1px solid #cedfd8; border-radius: 8px; background: #f8fbfa; }
.declaration-box.has-error { border-color: var(--red); background: #fff7f6; }
.declaration-title { font-size: 16px; font-weight: 800; color: var(--green); margin-bottom: 8px; }
.declaration-box p { margin: 0; color: #425950; font-size: 13.5px; line-height: 2; text-align: justify; }
.declaration-check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14px; font-weight: 800; color: #234b3e; cursor: pointer; }
.signature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.signature-grid > div { padding: 9px 11px; background: #fff; border: 1px solid #dce8e4; border-radius: 6px; min-height: 52px; }
.signature-grid span { display: block; font-size: 11px; color: #7b8c85; margin-bottom: 5px; }
.signature-grid strong, .signature-grid em { font-size: 13px; color: #29483f; font-style: normal; word-break: break-word; }

.wizard-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px;
    border-top: 1px solid #e1e8e5; background: #fbfdfc;
}
.footer-center { text-align: center; }
.step-counter { font-size: 12px; font-weight: 800; color: #36574d; }
.save-status { font-size: 11px; color: #85938e; min-height: 14px; }
.wizard-footer .btn { min-width: 132px; }

/* ── success ── */
.success-box { margin: 25px; padding: 40px 22px; text-align: center; border: 1px solid #cfe5dc; background: #f5fbf8; border-radius: 16px; }
.success-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; }
.success-box h2 { color: var(--green); margin: 0 0 8px; }
.success-box .btn-row { justify-content: center; }
.application-number { display: inline-block; margin: 8px 0 14px; padding: 12px 24px; border-radius: 9px; background: #fff; border: 1px dashed #8fb9aa; color: var(--green); font: bold 22px Arial; letter-spacing: 1px; }
.success-docs { padding: 0 25px 25px; }
.success-docs .panel { margin-top: 0; }

.reference-instructions-image { margin: 20px auto 0; max-width: 1168px; line-height: 0; }
.reference-instructions-image img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 3px 15px rgba(21, 62, 51, .06); }

/* ── document uploader (shared with the status page) ── */
.doc-list { display: flex; flex-direction: column; }
.doc-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr auto; gap: 8px 14px; align-items: center; padding: 11px 0; border-bottom: 1px dashed #dce6e2; }
.doc-row:last-child { border-bottom: 0; }
.doc-name { font-weight: 700; font-size: 14px; color: #2b463d; }
.doc-files { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.doc-file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.doc-file .fname { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #40564f; }
.doc-remark { flex-basis: 100%; font-size: 12.5px; color: #a52f27; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 0; }
.file-btn.busy { opacity: .6; pointer-events: none; }

/* ── tablet ── */
@media (max-width: 980px) {
    .wizard-card { grid-template-columns: 224px minmax(0, 1fr); }
    .form-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .academic-single { grid-template-columns: repeat(2, 1fr); }
    .review-grid { grid-template-columns: 1fr; }
}

/* ── phone: progress panel becomes a compact 4-step strip on top ── */
@media (max-width: 720px) {
    .wizard-hero, .wizard-hero-inner { min-height: 150px; }
    .wizard-title h1 { font-size: 22px; }
    .wizard-title h3 { font-size: 15px; }
    .wizard-title p { font-size: 11px; }
    .wizard-shell { padding: 0 8px 30px; margin-top: 8px; }

    .wizard-card { display: block; }
    .wizard-progress { border-inline-end: 0; border-bottom: 1px solid #e2e9e7; padding-bottom: 6px; }
    .progress-summary { display: none; }
    .steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px 2px; gap: 2px; }
    .step-dot { min-height: 64px; flex-direction: column; justify-content: flex-start; gap: 4px; text-align: center; padding: 4px 2px; }
    .step-dot::after { display: none; }
    .step-dot > span { flex-basis: 32px; width: 32px; height: 32px; font-size: 15px; }
    .step-dot > div { align-items: center; }
    .step-dot b { font-size: 10.5px; line-height: 1.25; text-align: center; }
    [lang="ur"] .step-dot b { font-size: 11px; line-height: 1.55; }
    .step-dot small { display: none; }
    .sidebar-note { display: none; }

    .section-title { padding: 10px 14px; min-height: 54px; font-size: 17px; }
    [lang="ur"] .section-title { font-size: 19px; }
    .section-title small { display: none; }
    .form-grid, .form-grid.cols-3, .academic-single { grid-template-columns: 1fr; padding-inline: 14px; gap: 12px; }
    .required-note, .info-note, .marks-warning, .choice-card, .declaration-box, .notify-row, .review-grid { margin-inline: 14px; }
    .notify-row, .review-grid { padding-inline: 0; }
    .subheading { padding-inline: 14px; }
    .signature-grid { grid-template-columns: 1fr; }
    .wizard-form .alert-error { margin-inline: 14px; }

    .wizard-footer { padding: 10px 12px; position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); }
    .wizard-footer .btn { min-width: 0; padding: 10px 14px; font-size: 13px; }
    .footer-center { min-width: 70px; }
    .save-status { display: none; }

    .doc-row { grid-template-columns: 1fr; }
    .success-box { margin: 12px; padding: 28px 14px; }
    .success-docs { padding: 0 12px 16px; }
}

/* ── CAPTCHA (security check) ── */
.captcha-box { margin: 0 20px 18px; padding: 14px 16px; border: 1px solid #cedfd8; border-radius: 8px; background: #fff; }
.captcha-box.has-error { border-color: var(--red); background: #fff7f6; }
.captcha-box > label { display: block; font-size: 14px; font-weight: 800; color: #234b3e; margin-bottom: 8px; }
.captcha-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.captcha-img-wrap { width: 200px; height: 64px; border: 1px solid #cbd9d6; border-radius: 8px; overflow: hidden; background: #f3f8f5; display: flex; align-items: center; justify-content: center; direction: ltr; }
.captcha-img { display: block; width: 200px; height: 64px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.captcha-input { max-width: 240px; text-transform: uppercase; letter-spacing: 3px; font-weight: 700; }
.captcha-input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.spinner.small { width: 24px; height: 24px; border-width: 3px; }
/* honeypot: off-screen, not display:none (some bots skip display:none fields) */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 720px) { .captcha-box { margin-inline: 14px; } .captcha-input { max-width: 100%; } }

/* ── "you have already applied" ── */
.already-box { padding: 40px 24px; text-align: center; }
.already-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; }
.already-box h2 { color: var(--green); margin: 0 0 8px; }
.already-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin: 18px auto; }
.already-facts > div { background: #f7faf9; border: 1px solid #dce8e4; border-radius: 12px; padding: 13px 15px; }
.already-facts span { display: block; color: #74857f; font-size: 13px; margin-bottom: 5px; }
.already-facts strong { font-size: 16px; color: #254b40; word-break: break-word; }
.already-box .btn-row { justify-content: center; }
@media (max-width: 720px) { .already-facts { grid-template-columns: 1fr; } .already-box { padding: 28px 14px; } }
