/* ==========================================================
   Online application form (apply.php) + acknowledgement (application.php)
   Section bars echo the navy headers of the PDF form.
   ========================================================== */
.page-banner.compact { padding: 3rem 0 3.25rem; }
.apply-wrap { padding: 2.25rem 0 0; }
.apply-wrap .container-xl { padding-left: 5.5rem; padding-right: 2rem; }

.btn-nit { background: var(--nit-blue); color: #fff; font-weight: 600; border-radius: 8px; padding: .6rem 1.2rem; border: 0; }
.btn-nit:hover, .btn-nit:focus { background: var(--nit-blue-dark); color: #fff; }
.btn-nit.btn-lg { padding: .75rem 1.6rem; font-size: 1.05rem; }
.btn-light-nit { background: #fff; color: var(--nit-blue); border: 1px solid var(--nit-line); font-weight: 600; border-radius: 8px; padding: .6rem 1.1rem; }
.btn-light-nit:hover { background: var(--nit-blue-50); color: var(--nit-blue); }

.notice-card { max-width: 640px; margin: 1rem auto; text-align: center; background: #fff; border: 1px solid var(--nit-line); border-radius: var(--radius); padding: 2.5rem 1.5rem; box-shadow: var(--shadow-sm); }
.notice-card > i { font-size: 2.6rem; color: var(--nit-blue-600); margin-bottom: .8rem; }
.notice-card h2 { font-size: 1.4rem; font-weight: 800; color: var(--nit-blue); }
.notice-card p { color: var(--nit-muted); }

/* ---------- Layout ---------- */
.apply-grid { display: grid; grid-template-columns: 300px 1fr; gap: 1.75rem; align-items: start; }
.apply-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }

.job-summary { background: var(--nit-blue); color: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-md); }
.job-summary .eyebrow { font-size: .72rem; letter-spacing: .06em; font-weight: 700; opacity: .75; text-transform: uppercase; }
.job-summary h2 { font-size: 1.35rem; font-weight: 800; margin: .3rem 0 .9rem; }
.job-summary dl { margin: 0; display: grid; gap: .55rem; }
.job-summary dl > div { display: flex; justify-content: space-between; gap: .75rem; font-size: .88rem; border-top: 1px solid rgba(255,255,255,.15); padding-top: .55rem; }
.job-summary dt { font-weight: 500; opacity: .8; }
.job-summary dd { margin: 0; font-weight: 700; text-align: right; word-break: break-word; }
.job-summary .hl dd { color: #ffd9dc; }
.job-summary small { font-weight: 500; opacity: .85; }
.side-links { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.side-links a { color: #fff; font-size: .88rem; font-weight: 600; text-decoration: none; background: rgba(255,255,255,.1); border-radius: 6px; padding: .45rem .7rem; }
.side-links a:hover { background: rgba(255,255,255,.2); }

.progress-nav { background: #fff; border: 1px solid var(--nit-line); border-radius: var(--radius); padding: .75rem; }
.progress-nav ol { list-style: none; margin: 0; padding: 0; }
.progress-nav a { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 6px; color: var(--nit-muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.progress-nav a:hover { background: var(--nit-bg); color: var(--nit-blue); }
.progress-nav .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c3ccd8; flex: 0 0 18px; display: grid; place-items: center; font-size: .6rem; color: #fff; }
.progress-nav a.done .dot { background: var(--nit-green); border-color: var(--nit-green); }
.progress-nav a.done .dot::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.progress-nav a.has-err .dot { border-color: var(--nit-red); background: #fdecee; }
.progress-nav a.current { color: var(--nit-blue); background: var(--nit-blue-50); }
.side-help { font-size: .82rem; color: var(--nit-muted); margin: 0 .25rem; }
.req { color: var(--nit-red); font-weight: 700; }
.opt { color: var(--nit-muted); font-weight: 400; font-size: .8rem; }

/* ---------- Form sheet ---------- */
.apply-form { background: #fff; border: 1px solid var(--nit-line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.form-sheet-head { text-align: center; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--nit-line); }
.form-sheet-head h2 { font-size: 1.45rem; font-weight: 800; color: var(--nit-ink); margin: 0; letter-spacing: .01em; }
.form-sheet-head .t1 { font-weight: 700; margin: .2rem 0 0; }
.form-sheet-head .t2 { font-weight: 700; margin: .1rem 0 0; font-size: .92rem; color: var(--nit-blue); }

.form-sec { border: 1px solid var(--nit-line); border-radius: 10px; margin: 0 0 1.25rem; padding: 0; overflow: hidden; scroll-margin-top: 1rem; }
.form-sec legend {
  float: none; width: 100%; margin: 0; padding: .65rem 1rem;
  background: var(--nit-blue); color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.sec-body { padding: 1.1rem 1rem .4rem; }
.grid-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
.grid-fields.addr .fld:first-child { grid-column: 1 / -1; }
.fld { margin-bottom: .95rem; }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: #2b3440; }
.form-control, .form-select { border-color: #cfd8e3; padding: .58rem .8rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--nit-blue-600); box-shadow: 0 0 0 3px rgba(1,66,141,.14); }
.form-control[readonly] { background: var(--nit-bg); }
.input-group-text { background: var(--nit-bg); border-color: #cfd8e3; font-weight: 600; color: var(--nit-muted); }
.form-text { font-size: .78rem; margin-top: .2rem; color: var(--nit-muted); }
.form-text:empty { display: none; }
.static-val { background: var(--nit-blue-50); border: 1px solid #cddcee; border-radius: 8px; padding: .58rem .8rem; font-weight: 700; color: var(--nit-blue); }
.was-validated .form-control:valid, .form-control.is-valid { background-image: none; border-color: #9fd3b4; }
.was-validated .form-select:valid { border-color: #9fd3b4; }

/* Post row with photo box on the right, like the PDF */
.post-row { display: grid; grid-template-columns: 1fr 170px; gap: 1.25rem; align-items: start; }
.upload-tile {
  position: relative; display: grid; place-items: center; cursor: pointer; overflow: hidden;
  border: 2px dashed #b9c6d6; border-radius: 10px; background: var(--nit-bg);
  transition: border-color .15s, background-color .15s;
}
.upload-tile:hover, .upload-tile.drag { border-color: var(--nit-blue-600); background: var(--nit-blue-50); }
.upload-tile.is-invalid { border-color: var(--nit-red); background: #fdf3f4; }
.upload-tile.photo { width: 170px; height: 210px; }
.upload-tile.sign { width: 100%; height: 110px; }
.upload-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-tile.sign img { object-fit: contain; background: #fff; padding: .4rem; }
.upload-tile .ph { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .6rem; color: var(--nit-muted); }
.upload-tile .ph i { font-size: 1.9rem; color: var(--nit-blue-600); margin-bottom: .2rem; }
.upload-tile .ph b { color: var(--nit-blue); font-size: .9rem; }
.upload-tile .ph small { font-size: .74rem; line-height: 1.3; }
.upload-tile.has-file .ph { display: none; }
.upload-tile.has-file::after { content: "Change"; position: absolute; bottom: 6px; right: 6px; background: rgba(1,66,141,.9); color: #fff; font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 4px; }
input[type=file]:focus-visible + .invalid-feedback, .upload-tile:focus-within { outline: 3px solid #ffbf47; }

.same-as { margin-bottom: .9rem; font-weight: 600; }
.same-as .form-check-input:checked { background-color: var(--nit-blue); border-color: var(--nit-blue); }
.grid-fields.locked .form-control, .grid-fields.locked .form-select { background-color: var(--nit-bg); color: var(--nit-muted); pointer-events: none; }

.decl-text { background: var(--nit-bg); border: 1px solid var(--nit-line); border-radius: 8px; padding: .8rem 1rem; font-size: .93rem; margin-bottom: .9rem; }
.decl-check { grid-column: 1 / -1; background: #fffbea; border: 1px solid #f2e3a6; border-radius: 8px; padding: .7rem 1rem .7rem 2.6rem; margin-bottom: 1rem; }
.decl-check .form-check-label { font-weight: 600; }
.decl-check.has-error { background: #fdf3f4; border-color: #f5c6cb; }
.decl-check .form-check-input:checked { background-color: var(--nit-blue); border-color: var(--nit-blue); }
.sign-fld { grid-column: 1 / -1; max-width: 360px; }

.submit-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.1rem; }
.captcha { max-width: 260px; margin: 0; }
.submit-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Review modal */
#reviewModal .modal-title { font-weight: 800; color: var(--nit-blue); font-size: 1.2rem; }
.rv-sec { margin-bottom: 1rem; }
.rv-sec h4 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--nit-blue); color: #fff; padding: .45rem .75rem; border-radius: 6px 6px 0 0; margin: 0; }
.rv-sec table { width: 100%; border: 1px solid var(--nit-line); border-top: 0; font-size: .9rem; }
.rv-sec td { padding: .45rem .75rem; border-top: 1px solid var(--nit-line); vertical-align: top; }
.rv-sec td:first-child { width: 42%; background: #f1f4f8; color: #3a4552; }
.rv-sec td:last-child { font-weight: 600; word-break: break-word; }
.rv-imgs { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.rv-imgs figure { margin: 0; text-align: center; font-size: .8rem; color: var(--nit-muted); }
.rv-imgs img { display: block; border: 1px solid var(--nit-line); border-radius: 6px; margin-bottom: .3rem; background: #fff; }

/* ---------- Acknowledgement / printable form ---------- */
.ack-banner { display: flex; gap: 1rem; align-items: center; background: #e9f6ef; border: 1px solid #b7e0c7; border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.ack-banner > i { font-size: 2.2rem; color: var(--nit-green); }
.ack-banner h2 { font-size: 1.25rem; font-weight: 800; color: #11603a; margin: 0 0 .15rem; }
.ack-banner p { margin: 0; color: #2c5a41; }
.ack-no { display: inline-block; font-family: ui-monospace, Menlo, monospace; background: #fff; border: 1px dashed #7cc39b; border-radius: 6px; padding: .1rem .5rem; font-weight: 700; color: #11603a; }
.ack-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.print-sheet { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid var(--nit-line); box-shadow: var(--shadow-sm); padding: 2rem 2.25rem; color: #111; font-size: .92rem; }
.ps-head { text-align: center; margin-bottom: 1rem; }
.ps-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.ps-head p { margin: .1rem 0; font-weight: 700; }
.ps-top { display: grid; grid-template-columns: 1fr 140px; gap: 1rem; margin-bottom: 1rem; }
.ps-top p { margin: 0 0 .35rem; }
.ps-photo { width: 140px; height: 170px; border: 1px solid #333; object-fit: cover; }
.ps-meta { font-size: .8rem; color: #444; }
.ps-table { width: 100%; border-collapse: collapse; margin-bottom: .6rem; }
.ps-table th { background: #284a6f; color: #fff; text-align: left; padding: .4rem .6rem; font-size: .88rem; text-transform: uppercase; }
.ps-table td { border: 1px solid #bbb; padding: .38rem .6rem; }
.ps-table td:first-child { width: 37%; background: #eef2f6; }
.ps-decl { border: 1px solid #bbb; padding: .55rem .65rem; margin-bottom: 1.2rem; }
.ps-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.ps-sign img { max-height: 60px; max-width: 220px; display: block; border-bottom: 1px solid #333; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) { .apply-grid { grid-template-columns: 260px 1fr; } }
@media (max-width: 991.98px) {
  .apply-wrap .container-xl { padding-left: 1rem; padding-right: 1rem; }
  .apply-grid { grid-template-columns: 1fr; }
  .apply-side { position: static; }
  .progress-nav, .side-help { display: none; }
}
@media (max-width: 767.98px) {
  .apply-form { padding: 1rem .75rem; }
  .grid-fields { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; }
  .photo-box { order: -1; }
  .upload-tile.photo { margin: 0 auto; }
  .photo-box .form-label { display: block; text-align: center; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .captcha { max-width: none; }
  .submit-actions .btn { flex: 1; }
  .print-sheet { padding: 1rem; }
  .ps-top { grid-template-columns: 1fr 100px; }
  .ps-photo { width: 100px; height: 122px; }
}

/* ---------- Print: only the filled form ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; padding: 0; max-width: none; }
  .ps-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table td:first-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .social-rail, .to-top { display: none !important; }
}
