/*
 * VitaNova Forms: front end.
 *
 * The wrapper carries appearance classes chosen per form (Settings > Forms) or per shortcode:
 *   .vnf-layout-underline | -outlined | -filled | -classic     field style
 *   .vnf-container-plain  | -card | -bordered | -tinted        panel around the form
 *   .vnf-cols-auto        | -one                               column layout
 *   .vnf-btn-auto         | -full,  .vnf-btn-left | -center | -right
 *   .vnf-counters-on      | -off                               "0 / 50" character counters
 *
 * Colours follow the vitanova.org.za brand (deep green #00594c, gold hover #b56900).
 */
.vnf-wrap {
	--vnf-accent: #00594c;
	--vnf-accent-soft: rgba(0, 89, 76, .12);
	--vnf-hover: #b56900;
	--vnf-active: #b47a2b;
	--vnf-error: #951f21;
	--vnf-text: #1f2a27;
	--vnf-muted: #5b6663;
	--vnf-label: #6b7572;
	--vnf-border: #b9c4c0;
	--vnf-border-soft: #dfe6e3;
	--vnf-bg: #ffffff;
	--vnf-fill: #f3f6f5;
	--vnf-radius: 0px;
	--vnf-field-radius: 0px;
	--vnf-font-size: 16px; /* 16px stops iOS zooming into fields */
	font-family: inherit;
	color: var(--vnf-text);
	width: 100%;
	box-sizing: border-box;
}
.vnf-wrap *, .vnf-wrap *::before, .vnf-wrap *::after { box-sizing: border-box; }
.vnf-wrap [hidden] { display: none !important; }

/* ------------------------------------------------------------------ Containers */
.vnf-container-card,
.vnf-container-bordered,
.vnf-container-tinted {
	padding: 48px 56px 44px;
	background: var(--vnf-bg);
	border-radius: 28px;
}
.vnf-container-card { box-shadow: 0 10px 40px rgba(31, 42, 39, .08), 0 1px 3px rgba(31, 42, 39, .05); }
.vnf-container-bordered { border: 1px solid var(--vnf-border-soft); }
.vnf-container-tinted { background: #f2f7f6; --vnf-bg: #f2f7f6; --vnf-fill: #e7efed; }
@media (max-width: 782px) {
	.vnf-container-card,
	.vnf-container-bordered,
	.vnf-container-tinted { padding: 32px 22px 28px; border-radius: 18px; }
}

/* ------------------------------------------------------------------ Grid */
.vnf-row {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 26px 30px;
}
.vnf-col-12 { grid-column: span 12; }
.vnf-col-6 { grid-column: span 6; }
.vnf-cols-one .vnf-col-6 { grid-column: span 12; }
@media (max-width: 640px) {
	.vnf-col-6 { grid-column: span 12; }
	.vnf-row { gap: 22px; }
}
.vnf-layout-classic .vnf-row { gap: 18px 20px; }

.vnf-field { position: relative; margin: 0; min-width: 0; }
.vnf-control { position: relative; display: flex; flex-direction: column; }
.vnf-req { color: var(--vnf-error); }

/* Shared input reset */
.vnf-wrap .vnf-input {
	display: block;
	width: 100%;
	margin: 0;
	font: inherit;
	font-size: var(--vnf-font-size);
	line-height: 1.4;
	color: var(--vnf-text);
	background: var(--vnf-bg);
	border: 1px solid var(--vnf-border);
	border-radius: var(--vnf-field-radius);
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.vnf-wrap .vnf-input::placeholder { color: #8b9592; opacity: 1; }
.vnf-wrap .vnf-input:focus { outline: none; }
.vnf-wrap .vnf-textarea { resize: vertical; }

/* Label base: sits after the input in the DOM; layouts position it. */
.vnf-label {
	display: block;
	margin: 0;
	padding: 0;
	line-height: 1.4;
	color: var(--vnf-text);
}

/* ------------------------------------------------------------------ Layout: classic (labels above boxed fields) */
.vnf-layout-classic .vnf-control .vnf-label { order: -1; }
.vnf-layout-classic .vnf-label { margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.vnf-layout-classic .vnf-input { min-height: 46px; padding: 11px 14px; }
.vnf-layout-classic .vnf-input:hover { border-color: var(--vnf-accent); }
.vnf-layout-classic .vnf-input:focus { border-color: var(--vnf-accent); box-shadow: 0 0 0 3px var(--vnf-accent-soft); }
.vnf-layout-classic .vnf-textarea { min-height: 140px; }

/* ------------------------------------------------------------------ Floating-label layouts (underline, outlined, filled) */
.vnf-layout-underline .vnf-label,
.vnf-layout-outlined .vnf-label,
.vnf-layout-filled .vnf-label {
	position: absolute;
	top: 0;
	left: 0;
	max-width: calc(100% - 8px);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: var(--vnf-font-size);
	font-weight: 400;
	color: var(--vnf-label);
	pointer-events: none;
	transform-origin: left top;
	transition: transform .18s ease, color .18s ease, top .18s ease, background .18s ease;
}
/* Real placeholders only appear once the label has floated up */
.vnf-layout-underline .vnf-input:not(:focus)::placeholder,
.vnf-layout-outlined .vnf-input:not(:focus)::placeholder,
.vnf-layout-filled .vnf-input:not(:focus)::placeholder { color: transparent; }
.vnf-layout-underline .vnf-input:focus ~ .vnf-label,
.vnf-layout-underline .vnf-input:not(:placeholder-shown) ~ .vnf-label,
.vnf-layout-outlined .vnf-input:focus ~ .vnf-label,
.vnf-layout-outlined .vnf-input:not(:placeholder-shown) ~ .vnf-label,
.vnf-layout-filled .vnf-input:focus ~ .vnf-label,
.vnf-layout-filled .vnf-input:not(:placeholder-shown) ~ .vnf-label { color: var(--vnf-accent); }
/* Non-floating labels (multi-choice legend, file upload) in these layouts */
.vnf-layout-underline .vnf-fieldset .vnf-label,
.vnf-layout-outlined .vnf-fieldset .vnf-label,
.vnf-layout-filled .vnf-fieldset .vnf-label,
.vnf-layout-underline .vnf-type-file > .vnf-label,
.vnf-layout-outlined .vnf-type-file > .vnf-label,
.vnf-layout-filled .vnf-type-file > .vnf-label {
	position: static;
	margin-bottom: 8px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--vnf-text);
	white-space: normal;
	pointer-events: auto;
	transform: none;
}

/* Underline: the vitanova.org.za look. Single bottom rule, label floats up and shrinks. */
.vnf-layout-underline .vnf-input {
	min-height: 44px;
	padding: 14px 0 8px;
	background: transparent;
	border-width: 0 0 1px;
	border-color: var(--vnf-border);
	border-radius: 0;
}
.vnf-layout-underline .vnf-textarea { min-height: 120px; }
.vnf-layout-underline .vnf-label { top: 14px; }
.vnf-layout-underline .vnf-input:hover { border-color: var(--vnf-accent); }
.vnf-layout-underline .vnf-input:focus { border-color: var(--vnf-accent); box-shadow: 0 1px 0 0 var(--vnf-accent); }
.vnf-layout-underline .vnf-input:focus ~ .vnf-label,
.vnf-layout-underline .vnf-input:not(:placeholder-shown) ~ .vnf-label { top: 0; transform: translateY(-6px) scale(.75); }
.vnf-layout-underline .vnf-control { padding-top: 6px; }

/* Outlined: full border with the label notched into it. */
.vnf-layout-outlined { --vnf-field-radius: 6px; }
.vnf-layout-outlined .vnf-input { min-height: 54px; padding: 15px 16px; }
.vnf-layout-outlined .vnf-textarea { min-height: 140px; }
.vnf-layout-outlined .vnf-label { top: 16px; left: 12px; padding: 0 5px; }
.vnf-layout-outlined .vnf-input:hover { border-color: var(--vnf-accent); }
.vnf-layout-outlined .vnf-input:focus { border-color: var(--vnf-accent); box-shadow: inset 0 0 0 1px var(--vnf-accent); }
.vnf-layout-outlined .vnf-input:focus ~ .vnf-label,
.vnf-layout-outlined .vnf-input:not(:placeholder-shown) ~ .vnf-label {
	top: 0;
	background: var(--vnf-bg);
	transform: translateY(-50%) scale(.78);
}

/* Filled: soft tinted field, label floats inside. */
.vnf-layout-filled { --vnf-field-radius: 10px; }
.vnf-layout-filled .vnf-input {
	min-height: 58px;
	padding: 24px 16px 10px;
	background: var(--vnf-fill);
	border-color: transparent;
}
.vnf-layout-filled .vnf-textarea { min-height: 150px; }
.vnf-layout-filled .vnf-label { top: 19px; left: 16px; }
.vnf-layout-filled .vnf-input:hover { background: #ebf0ee; }
.vnf-layout-filled .vnf-input:focus { background: var(--vnf-bg); border-color: var(--vnf-accent); box-shadow: 0 0 0 3px var(--vnf-accent-soft); }
.vnf-layout-filled .vnf-input:focus ~ .vnf-label,
.vnf-layout-filled .vnf-input:not(:placeholder-shown) ~ .vnf-label { top: 10px; transform: scale(.75); }

/* ------------------------------------------------------------------ Character counters */
.vnf-count {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	line-height: 1.2;
	text-align: right;
	color: var(--vnf-muted);
}
.vnf-counters-off .vnf-count { display: none; }
.vnf-count.vnf-count-full { color: var(--vnf-error); }

/* ------------------------------------------------------------------ Errors, descriptions */
.vnf-has-error .vnf-input,
.vnf-has-error .vnf-input:focus,
.vnf-has-error .vnf-drop { border-color: var(--vnf-error) !important; }
.vnf-has-error .vnf-input:focus { box-shadow: 0 0 0 3px rgba(149, 31, 33, .15); }
.vnf-layout-underline .vnf-has-error .vnf-input:focus { box-shadow: 0 1px 0 0 var(--vnf-error); }
.vnf-has-error .vnf-label { color: var(--vnf-error) !important; }
.vnf-error {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--vnf-error);
}
.vnf-error:empty { display: none; }
.vnf-desc { display: block; margin-top: 8px; font-size: 13px; color: var(--vnf-muted); }

/* ------------------------------------------------------------------ Multi-choice pills */
.vnf-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.vnf-fieldset legend { float: left; width: 100%; }
.vnf-layout-classic .vnf-fieldset legend { margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.vnf-pills { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.vnf-pill { position: relative; margin: 0; cursor: pointer; }
.vnf-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vnf-pill span {
	display: inline-block;
	padding: 9px 16px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--vnf-text);
	background: var(--vnf-bg);
	border: 1px solid var(--vnf-border);
	border-radius: 999px;
	transition: all .15s ease;
}
.vnf-pill:hover span { border-color: var(--vnf-accent); }
.vnf-pill input:checked + span { color: #fff; background: var(--vnf-accent); border-color: var(--vnf-accent); }
.vnf-pill input:focus-visible + span { box-shadow: 0 0 0 3px var(--vnf-accent-soft); }

/* ------------------------------------------------------------------ Consent checkbox */
.vnf-consent {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--vnf-muted);
	cursor: pointer;
}
.vnf-consent input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.vnf-consent-box {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	background: var(--vnf-bg);
	border: 1px solid var(--vnf-border);
	border-radius: 3px;
	transition: all .15s ease;
}
.vnf-consent input:checked + .vnf-consent-box {
	background: var(--vnf-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 16px no-repeat;
	border-color: var(--vnf-accent);
}
.vnf-consent input:focus-visible + .vnf-consent-box { box-shadow: 0 0 0 3px var(--vnf-accent-soft); }
.vnf-has-error .vnf-consent-box { border-color: var(--vnf-error); }
.vnf-consent-text a { color: var(--vnf-accent); text-decoration: underline; }

/* ------------------------------------------------------------------ File upload (dashed drop zone, as on the site) */
.vnf-drop { position: relative; border: 1px dashed #8f9995; background: transparent; border-radius: var(--vnf-field-radius); transition: all .15s ease; }
.vnf-drop:hover, .vnf-drop.vnf-drag { border-color: var(--vnf-accent); background: var(--vnf-accent-soft); }
.vnf-layout-filled .vnf-drop { background: var(--vnf-fill); border-color: transparent; }
.vnf-layout-classic .vnf-drop { background: #f7f9f8; border-color: var(--vnf-border); }
.vnf-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.vnf-drop-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 28px 16px;
	text-align: center;
	font-size: 14px;
	color: var(--vnf-muted);
	cursor: pointer;
}
.vnf-drop-inner svg { color: #6b7572; }
.vnf-drop-inner strong { color: var(--vnf-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.vnf-drop:hover .vnf-drop-inner svg { color: var(--vnf-accent); }
.vnf-file-input:focus-visible + .vnf-drop-inner { outline: 3px solid var(--vnf-accent-soft); }
.vnf-file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.vnf-file-list:empty { display: none; }
.vnf-file-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 6px;
	padding: 8px 12px;
	font-size: 14px;
	background: #f7f9f8;
	border: 1px solid #e3e9e7;
	border-radius: var(--vnf-field-radius);
}
.vnf-file-list .vnf-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vnf-file-remove {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--vnf-error);
	background: transparent;
	border: 0;
	cursor: pointer;
}

/* ------------------------------------------------------------------ Captcha, honeypot, form error */
.vnf-captcha-field { margin-top: 26px; }
.vnf-btn-center .vnf-captcha { display: flex; justify-content: center; }
.vnf-btn-right .vnf-captcha { display: flex; justify-content: flex-end; }
.vnf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.vnf-form-error {
	margin: 18px 0 0;
	padding: 12px 14px;
	font-size: 14px;
	color: var(--vnf-error);
	background: rgba(149, 31, 33, .06);
	border-left: 3px solid var(--vnf-error);
}

/* ------------------------------------------------------------------ Submit */
.vnf-actions { display: flex; margin-top: 26px; }
.vnf-btn-left .vnf-actions { justify-content: flex-start; }
.vnf-btn-center .vnf-actions { justify-content: center; }
.vnf-btn-right .vnf-actions { justify-content: flex-end; }
.vnf-wrap .vnf-submit,
.vnf-wrap .vnf-again {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 10px 26px;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	color: #fff;
	background: var(--vnf-accent);
	border: 0;
	border-radius: var(--vnf-radius);
	cursor: pointer;
	transition: background .15s ease;
}
.vnf-btn-full .vnf-submit { width: 100%; }
.vnf-layout-outlined .vnf-submit, .vnf-layout-outlined .vnf-again { border-radius: 6px; }
.vnf-layout-filled .vnf-submit, .vnf-layout-filled .vnf-again { border-radius: 999px; padding-left: 34px; padding-right: 34px; }
.vnf-wrap .vnf-submit:hover,
.vnf-wrap .vnf-again:hover { background: var(--vnf-hover); color: #fff; }
.vnf-wrap .vnf-submit:active { background: var(--vnf-active); }
.vnf-wrap .vnf-submit:focus-visible,
.vnf-wrap .vnf-again:focus-visible { outline: 3px solid var(--vnf-accent-soft); outline-offset: 2px; }
.vnf-wrap .vnf-submit[disabled] { opacity: .75; cursor: progress; }
@media (max-width: 640px) { .vnf-wrap .vnf-submit { width: 100%; } }

.vnf-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vnf-spin .7s linear infinite;
}
.vnf-busy .vnf-spinner { display: inline-block; }
@keyframes vnf-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Success */
.vnf-success {
	padding: 32px 24px;
	text-align: center;
	background: #f2f7f6;
	border-top: 3px solid var(--vnf-accent);
	outline: none;
}
.vnf-container-card .vnf-success,
.vnf-container-bordered .vnf-success,
.vnf-container-tinted .vnf-success { background: transparent; border-top: 0; padding: 8px 0; }
.vnf-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 12px;
	color: #fff;
	background: var(--vnf-accent);
	border-radius: 50%;
}
.vnf-success-message { font-size: 17px; line-height: 1.6; }
.vnf-success-message p { margin: 0 0 8px; padding: 0; }
.vnf-wrap .vnf-again {
	margin-top: 14px;
	min-height: 0;
	padding: 10px 20px;
	font-size: 14px;
	color: var(--vnf-accent);
	background: transparent;
	border: 1px solid var(--vnf-accent);
}
.vnf-wrap .vnf-again:hover { color: #fff; background: var(--vnf-accent); }

@media (prefers-reduced-motion: reduce) {
	.vnf-wrap * { transition: none !important; animation-duration: 1.5s !important; }
}
