/*
 * NSHPCA Forms – matches the Healing Pathways application look
 * (purple #59436b, orange #fcb021). Field markup reuses JetFormBuilder class
 * names, so site-wide styles for those classes still apply.
 *
 * Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 px.
 */
.nshpca-form {
	--nf-purple: #59436b;
	--nf-purple-dark: #46344f;
	--nf-orange: #fcb021;
	--nf-text: #2b2233;
	--nf-muted: #5f5768;
	--nf-border: #b9b2c2;
	--nf-line: #e2dde7;
	--nf-card: #f4f3f6;
	--nf-error: #b3261e;
	--nf-ok: #1e7b3a;
	--nf-radius: 8px;
	max-width: 1080px;
	margin: 32px auto 56px;
	padding: 0 16px;
	color: var(--nf-text);
	font-size: 17px;
	line-height: 1.55;
}
/* Plain pages (no Elementor banner): clear the site header's menu row. */
.page-content > .nshpca-form,
.entry-content > .nshpca-form { margin-top: 140px; }
@media (max-width: 1024px) {
	.page-content > .nshpca-form,
	.entry-content > .nshpca-form { margin-top: 32px; }
}

.nshpca-form *, .nshpca-form *::before, .nshpca-form *::after { box-sizing: border-box; }
.nshpca-form [hidden] { display: none !important; }

/* ---------- Progress bar ----------
 * Equal columns: number on top, label underneath and wrapping inside its own
 * column, so labels can never run into each other at any width. */
.nshpca-form .nshpca-progress {
	list-style: none; display: grid; grid-template-columns: repeat(var(--nshpca-steps, 6), minmax(0, 1fr));
	gap: 0; margin: 0 0 24px; padding: 20px 12px 18px;
	background: var(--nf-purple); border-radius: var(--nf-radius);
}
.nshpca-form .nshpca-progress__step {
	position: relative; list-style: none; margin: 0; padding: 0 6px;
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	text-align: center; cursor: pointer; min-width: 0;
}
/* Connector line from this step's number to the next one. */
.nshpca-form .nshpca-progress__step:not(:last-child)::after {
	content: ""; position: absolute; top: 21px; left: calc(50% + 30px); right: calc(-50% + 30px);
	height: 2px; background: rgba(255,255,255,.4);
}
.nshpca-form .nshpca-progress__step.is-done:not(:last-child)::after { background: #fff; }
.nshpca-form .nshpca-progress__dot {
	position: relative; z-index: 1; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
	border: 2px solid rgba(255,255,255,.55); color: rgba(255,255,255,.9); background: var(--nf-purple);
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 18px; line-height: 1; transition: background .15s, color .15s, box-shadow .15s;
}
.nshpca-form .nshpca-progress__step.is-active .nshpca-progress__dot { border-color: #fff; color: #fff; box-shadow: 0 0 0 3px var(--nf-orange); }
.nshpca-form .nshpca-progress__step.is-done .nshpca-progress__dot { background: #fff; color: var(--nf-purple); border-color: #fff; }
.nshpca-form .nshpca-progress__label {
	display: block; max-width: 11em; color: rgba(255,255,255,.85);
	font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.nshpca-form .nshpca-progress__step.is-active .nshpca-progress__label { color: #fff; }

.nshpca-form-steptext { font-weight: 700; color: var(--nf-purple); margin: 0 0 12px; font-size: 16px; }
@media (min-width: 901px) { .nshpca-form-steptext { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 900px) { .nshpca-form .nshpca-progress { display: none; } }

/* ---------- Card ---------- */
.nshpca-form__form {
	background: var(--nf-card); border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
	padding: 40px 48px;
}
@media (max-width: 767px) { .nshpca-form__form { padding: 24px 16px; } }

.nshpca-form .nshpca-heading {
	color: var(--nf-text); font-size: 28px; font-weight: 600; line-height: 1.25;
	margin: 40px 0 20px; padding: 0 0 12px; border-bottom: 2px solid var(--nf-line);
}
.nshpca-step > .nshpca-heading:first-child { margin-top: 0; }
.nshpca-form .nshpca-paragraph { color: var(--nf-muted); margin: -4px 0 24px; max-width: 70ch; }

/* ---------- Fields ---------- */
.nshpca-form .nshpca-row { margin: 0 0 24px; padding: 0; }
.nshpca-form .nshpca-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.nshpca-form .nshpca-fieldset legend { padding: 0; margin: 0 0 8px; float: none; width: 100%; }
.nshpca-form .nshpca-label { margin: 0; padding: 0; }
.nshpca-form .nshpca-label__text {
	display: block; color: var(--nf-purple); font-weight: 700; font-size: 18px; line-height: 1.35;
	margin: 0 0 8px; padding: 0;
}
.nshpca-form .nshpca-required { color: var(--nf-orange); margin-left: 2px; }
.nshpca-form .nshpca-desc { color: var(--nf-muted); font-size: 15px; line-height: 1.5; margin: -2px 0 12px; padding: 0; background: none; }
.nshpca-form .nshpca-field { margin: 0; padding: 0; }

.nshpca-form .nshpca-input:not([type=radio]):not([type=checkbox]) {
	display: block; width: 100%; min-height: 52px; margin: 0;
	padding: 12px 16px; border: 1px solid var(--nf-border); border-radius: 6px;
	background: #fff; font: inherit; font-size: 17px; color: var(--nf-text); line-height: 1.4;
	box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.nshpca-form textarea.nshpca-input { min-height: 150px; resize: vertical; }
.nshpca-form select.nshpca-input { max-width: 420px; appearance: auto; }
.nshpca-form .nshpca-input::placeholder { color: #8b8494; }
.nshpca-form .nshpca-input:focus { outline: none; border-color: var(--nf-purple); box-shadow: 0 0 0 3px rgba(89,67,107,.22); }
@media (max-width: 767px) { .nshpca-form select.nshpca-input { max-width: 100%; } }

/* Radios & checkboxes */
.nshpca-form .nshpca-choices { display: grid; gap: 12px 24px; margin: 4px 0 0; padding: 0; }
.nshpca-form .nshpca-row--checkbox .nshpca-choices { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.nshpca-form .nshpca-choice { margin: 0; padding: 0; }
.nshpca-form .nshpca-choice__label {
	display: inline-flex; align-items: flex-start; gap: 10px; margin: 0; padding: 0;
	cursor: pointer; font-size: 17px; line-height: 1.35; color: var(--nf-text); font-weight: 400;
}
.nshpca-form .nshpca-choice__text { padding-top: 1px; }
/* Native controls only (no theme/plugin pseudo-boxes). */
.nshpca-form .nshpca-choice__label::before, .nshpca-form .nshpca-choice__label::after,
.nshpca-form .nshpca-choice__text::before, .nshpca-form .nshpca-choice__text::after { content: none !important; display: none !important; }
.nshpca-form input.nshpca-choice__input {
	-webkit-appearance: auto; appearance: auto; position: static; opacity: 1; visibility: visible;
	width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; padding: 0; flex: 0 0 20px;
	accent-color: var(--nf-purple); box-shadow: none;
}

/* Errors */
.nshpca-form .nshpca-row.has-error .nshpca-input:not([type=radio]):not([type=checkbox]),
.nshpca-form .nshpca-row.has-error .nshpca-files__drop { border-color: var(--nf-error); }
.nshpca-form .nshpca-error { color: var(--nf-error); font-weight: 600; font-size: 15px; margin: 8px 0 0; }
.nshpca-form .nshpca-error::before { content: "! "; }

/* Switch */
.nshpca-switch { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 4px 0 0; }
.nshpca-switch input.nshpca-input { appearance: none; -webkit-appearance: none; width: 48px !important; min-height: 0 !important; height: 28px; padding: 0 !important; border: 0 !important; border-radius: 14px; background: #b8b2c0; position: relative; flex: 0 0 48px; cursor: pointer; transition: background .15s; margin: 0; }
.nshpca-switch input.nshpca-input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.nshpca-switch input.nshpca-input:checked { background: var(--nf-purple); }
.nshpca-switch input.nshpca-input:checked::after { transform: translateX(20px); }
.nshpca-switch__text { font-size: 17px; line-height: 1.45; padding-top: 2px; }

/* ---------- Files ---------- */
.nshpca-files__list { list-style: none; margin: 0 0 12px; padding: 0; }
.nshpca-files__list:empty { display: none; }
.nshpca-files__item {
	display: flex; align-items: center; gap: 12px 14px;
	background: #fff; border: 1px solid var(--nf-line); border-left: 4px solid var(--nf-ok);
	border-radius: 6px; padding: 10px 12px; margin: 0 0 8px; list-style: none;
}
.nshpca-files__thumb {
	flex: 0 0 64px; width: 64px; height: 64px; padding: 0; margin: 0;
	border: 1px solid var(--nf-line); border-radius: 6px; background: #f6f4f8; overflow: hidden;
	display: flex; align-items: center; justify-content: center; cursor: pointer;
}
span.nshpca-files__thumb { cursor: default; }
.nshpca-files__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nshpca-files__thumb.is-doc { background: var(--nf-purple); border-color: var(--nf-purple); }
.nshpca-files__type { color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.nshpca-files__thumb:focus-visible { outline: 3px solid rgba(252,176,33,.7); outline-offset: 2px; }
.nshpca-files__meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nshpca-files__name { font-weight: 600; color: var(--nf-text); word-break: break-word; line-height: 1.35; }
.nshpca-files__size { color: var(--nf-muted); font-size: 14px; }
.nshpca-files__ok { color: var(--nf-ok); font-weight: 600; }
.nshpca-files__links { font-size: 14px; }
/* The theme styles every <button>; reset ours so they keep the form's look. */
.nshpca-form button.nshpca-files__link,
.nshpca-form a.nshpca-files__link {
	display: inline; width: auto; min-height: 0; margin: 0; padding: 0;
	background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0;
	color: var(--nf-purple) !important; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none;
	text-decoration: underline; cursor: pointer; line-height: 1.4;
}
.nshpca-form button.nshpca-files__link:hover, .nshpca-form a.nshpca-files__link:hover { color: var(--nf-purple-dark) !important; }
.nshpca-form button.nshpca-files__thumb { background: #f6f4f8 !important; padding: 0 !important; min-height: 0; box-shadow: none !important; }
.nshpca-form button.nshpca-files__thumb.is-doc { background: var(--nf-purple) !important; }
.nshpca-form button.nshpca-files__remove { background: #fff !important; color: var(--nf-error) !important; text-transform: none; letter-spacing: 0; min-height: 0; }
.nshpca-files__state { font-size: 14px; color: var(--nf-muted); }
@media (max-width: 560px) { .nshpca-files__item { flex-wrap: wrap; } .nshpca-files__remove { margin-left: 0; } }
.nshpca-files__remove, .nshpca-files__dismiss {
	margin-left: auto; background: #fff; border: 1px solid var(--nf-line); color: var(--nf-error);
	border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
}
.nshpca-files__remove:hover, .nshpca-files__dismiss:hover { border-color: var(--nf-error); }
.nshpca-files__item.is-uploading { border-left-color: var(--nf-orange); }
.nshpca-files__item.is-error { border-left-color: var(--nf-error); }
.nshpca-files__item.is-error .nshpca-files__state { color: var(--nf-error); }
.nshpca-files__progress { flex: 1 1 140px; height: 8px; background: #ebe7ee; border-radius: 4px; overflow: hidden; }
.nshpca-files__progress span { display: block; height: 100%; width: 0; background: var(--nf-orange); transition: width .2s; }
.nshpca-files__drop {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
	border: 2px dashed #a79fb1; border-radius: 8px; background: #fff;
	padding: 20px 16px; text-align: center; cursor: pointer; margin: 0; transition: border-color .15s, background .15s;
}
.nshpca-files__drop:hover, .nshpca-files__drop.is-over { border-color: var(--nf-purple); background: #f8f5fa; }
.nshpca-files__cta { display: inline-block; background: var(--nf-purple); color: #fff; font-weight: 700; font-size: 16px; padding: 8px 18px; border-radius: 6px; }
.nshpca-files__hint { color: var(--nf-muted); font-size: 15px; }
.nshpca-files__input { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nshpca-files__drop:focus-within { outline: 3px solid rgba(89,67,107,.3); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.nshpca-actions {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
	margin: 32px 0 0; padding: 24px 0 0; border-top: 1px solid var(--nf-line);
}
.nshpca-actions__saved { margin-left: auto; color: var(--nf-muted); font-size: 14px; }
.nshpca-actions .nshpca-btn--primary { margin-left: 0; }
.nshpca-form .nshpca-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	font: inherit; font-weight: 700; font-size: 17px; line-height: 1.2; letter-spacing: .02em;
	border-radius: 6px; padding: 14px 28px; min-height: 50px; cursor: pointer;
	border: 2px solid var(--nf-purple); text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.nshpca-form .nshpca-btn--primary { background: var(--nf-purple); color: #fff; }
.nshpca-form .nshpca-btn--primary:hover, .nshpca-form .nshpca-btn--primary:focus-visible { background: var(--nf-purple-dark); border-color: var(--nf-purple-dark); color: #fff; }
.nshpca-form .nshpca-btn--secondary { background: #fff; color: var(--nf-purple); }
.nshpca-form .nshpca-btn--secondary:hover, .nshpca-form .nshpca-btn--secondary:focus-visible { background: #f3eef7; }
.nshpca-form .nshpca-btn:focus-visible { outline: 3px solid rgba(252,176,33,.7); outline-offset: 2px; }
.nshpca-form .nshpca-btn:disabled { opacity: .6; cursor: wait; }
@media (max-width: 560px) {
	.nshpca-actions { flex-direction: column-reverse; align-items: stretch; }
	.nshpca-actions__saved { margin: 0; text-align: center; }
	.nshpca-form .nshpca-btn { width: 100%; }
}

/* ---------- Status line ---------- */
.nshpca-form__status { position: sticky; top: 8px; z-index: 5; font-size: 15px; font-weight: 600; margin: 0 0 12px; padding: 10px 14px; border-radius: 6px; background: #fff; border: 1px solid var(--nf-line); }
.nshpca-form__status:empty { display: none; }
.nshpca-form__status.is-ok { color: var(--nf-ok); border-color: #b9e0c5; background: #f1faf4; }
.nshpca-form__status.is-pending { color: var(--nf-muted); }
.nshpca-form__status.is-error { color: #fff; background: var(--nf-error); border-color: var(--nf-error); }
.admin-bar .nshpca-form__status { top: 40px; }

/* ---------- Submitted ---------- */
.nshpca-submitted { background: #fff; border: 1px solid var(--nf-line); border-top: 6px solid var(--nf-ok); border-radius: 12px; padding: 32px 24px; text-align: center; margin: 0 0 24px; }
.nshpca-submitted p { margin: 0 0 12px; }
.nshpca-submitted__icon, .nshpca-popup__icon { width: 56px; height: 56px; border-radius: 50%; background: #e7f6ec; color: var(--nf-ok); font-size: 32px; line-height: 56px; margin: 0 auto 12px; }
.nshpca-submitted h2 { margin: 0 0 12px; font-size: 26px; }

/* ---------- Popup ---------- */
.nshpca-popup { position: fixed; inset: 0; background: rgba(43,34,51,.55); display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 16px; }
.nshpca-popup__box { background: #fff; max-width: 460px; width: 100%; border-radius: 12px; padding: 32px 24px; text-align: center; border-top: 6px solid var(--nf-purple); box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.nshpca-popup__box h2 { margin: 0 0 8px; font-size: 22px; }
.nshpca-popup__box p { margin: 0 0 20px; }

/* ---------- File viewer ---------- */
.nshpca-viewer { position: fixed; inset: 0; background: rgba(20,14,26,.75); z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.nshpca-viewer__box { background: #fff; border-radius: 10px; width: min(1100px, 100%); height: min(90vh, 100%); display: flex; flex-direction: column; overflow: hidden; }
.nshpca-viewer__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #e2dde7; font-size: 15px; }
.nshpca-viewer__bar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nshpca-viewer__open { color: #59436b; font-weight: 700; }
.nshpca-viewer button.nshpca-viewer__close { background: #59436b !important; color: #fff !important; border: 0 !important; border-radius: 6px; padding: 8px 18px; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; cursor: pointer; min-height: 0; }
.nshpca-viewer button.nshpca-viewer__close:hover { background: #46344f !important; }
.nshpca-viewer__body { flex: 1; min-height: 0; background: #f0eef2; display: flex; align-items: center; justify-content: center; overflow: auto; }
.nshpca-viewer__body img { max-width: 100%; max-height: 100%; }
.nshpca-viewer__body iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- Notices / demo fill ---------- */
.nshpca-form--notice { background: #fff8e6; border-left: 6px solid var(--nf-orange); padding: 16px 20px; border-radius: 6px; }
.nshpca-autofill { margin: 0 0 16px; padding: 12px 16px; border: 2px dashed #b54708; border-radius: var(--nf-radius); background: #fffaeb; color: #7a2e0e; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 15px; }
.nshpca-autofill .nshpca-btn { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.nshpca-form.is-busy { cursor: progress; }

/* ---------- Your applications (one account, several applications) ---------- */
.nshpca-form a.nshpca-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
/* Own white panel: on the Portal page the "Apply Now" box above has a fixed
 * height, so the list starts over its lower edge. */
.nshpca-form.nshpca-apps { position: relative; z-index: 1; background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 4px 18px rgba(43, 34, 51, .08); }
.nshpca-apps .nshpca-apps__item { background: var(--nf-card); }
@media (max-width: 640px) {
	.nshpca-form.nshpca-apps { padding: 20px 16px; }
}
.nshpca-apps__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 8px; }
.nshpca-apps__head h2 { margin: 0; font-size: 28px; }
.nshpca-apps__note { margin: 0 0 24px; color: var(--nf-muted); }
.nshpca-apps__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.nshpca-apps__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid var(--nf-line); border-left: 6px solid var(--nf-purple); border-radius: var(--nf-radius); padding: 16px 20px; }
.nshpca-apps__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nshpca-apps__title { font-size: 19px; overflow-wrap: anywhere; }
.nshpca-apps__org, .nshpca-apps__meta { color: var(--nf-muted); font-size: 15px; }
.nshpca-apps__badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-right: 4px; }
.nshpca-apps__badge.is-submitted { background: #e3f3e8; color: var(--nf-ok); }
.nshpca-apps__badge.is-draft { background: #fff3d6; color: #7a5200; }
.nshpca-apps__badge.is-locked { background: var(--nf-card); color: var(--nf-muted); }
.nshpca-apps__item .nshpca-btn { flex: 0 0 auto; }
.nshpca-apps__back { margin: 0 0 12px; font-size: 15px; }
.nshpca-apps__back a, .nshpca-apps__links a { color: var(--nf-purple); }
.nshpca-apps__links { margin-top: 16px; font-size: 15px; }
@media (max-width: 640px) {
	.nshpca-apps__item { flex-direction: column; align-items: stretch; }
	.nshpca-apps__item .nshpca-btn { width: 100%; }
}
.nshpca-apps__current { margin: 0 0 16px; padding: 12px 16px; background: #e3f3e8; border-left: 6px solid var(--nf-ok); border-radius: 6px; font-size: 16px; }
