/**
 * Hire Across Euro — application forms.
 *
 * Prefix: hap-. The chat plugin owns hae-, the job board owns hv-.
 * Element resets are wrapped in :where() so they sit at zero specificity and
 * never out-specify a single-class rule below them.
 */

.hap-wrap {
	--hap-accent: #e85a2a;
	--hap-dark: #1e293b;
	--hap-line: #e2e8f0;
	--hap-muted: #64748b;
	--hap-bad: #b91c1c;
	--hap-radius: 10px;

	/* Astra renders .ast-container as a flex row, so a plain block wrapper
	   shrink-to-fits and leaves a gutter down one side. */
	width: 100%;
	flex: 1 1 auto;
	min-width: 0;

	max-width: 860px;
	margin: 0;
	color: var(--hap-dark);
	font-size: 16px;
	line-height: 1.6;
}

:where(.hap-wrap p, .hap-wrap h2, .hap-wrap ul, .hap-wrap li) {
	margin: 0;
	padding: 0;
}

:where(.hap-wrap ul) {
	list-style: none;
}

.hap-title {
	margin: 0 0 6px;
	font-size: 26px;
	line-height: 1.25;
	font-weight: 700;
}

.hap-intro {
	margin: 0 0 24px;
	color: var(--hap-muted);
}

/* ------------------------------------------------------------------ grid */

.hap-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.hap-field--full {
	grid-column: 1 / -1;
}

@media (max-width: 640px) {
	.hap-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------- fields */

.hap-label {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
}

.hap-req {
	color: var(--hap-accent);
}

.hap-wrap .hap-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	border: 1px solid var(--hap-line);
	border-radius: var(--hap-radius);
	background: #fff;
	color: var(--hap-dark);
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.hap-wrap select.hap-input {
	/* Keep the native arrow but match the height of the text inputs. */
	height: auto;
	min-height: 45px;
	appearance: auto;
}

.hap-wrap textarea.hap-input {
	min-height: 120px;
	resize: vertical;
}

.hap-wrap .hap-input:focus {
	outline: none;
	border-color: var(--hap-accent);
	box-shadow: 0 0 0 3px rgba(232, 90, 42, .15);
}

.hap-wrap .hap-input[readonly] {
	background: #f8fafc;
	color: var(--hap-muted);
}

.hap-wrap .hap-file {
	padding: 9px 13px;
	background: #f8fafc;
	cursor: pointer;
}

.hap-hint {
	margin: 6px 0 0;
	color: var(--hap-muted);
	font-size: 13px;
}

.hap-field.is-invalid .hap-input {
	border-color: var(--hap-bad);
}

.hap-field-error {
	margin: 6px 0 0;
	color: var(--hap-bad);
	font-size: 13px;
}

/* -------------------------------------------------------------- messages */

.hap-errors {
	margin: 0 0 20px;
	padding: 14px 16px;
	border: 1px solid #fecaca;
	border-left: 3px solid var(--hap-bad);
	border-radius: var(--hap-radius);
	background: #fef2f2;
	color: #7f1d1d;
	font-size: 14px;
}

.hap-errors ul {
	margin: 8px 0 0;
}

.hap-errors li {
	margin: 3px 0 0;
	padding-left: 14px;
	position: relative;
}

.hap-errors li::before {
	content: "•";
	position: absolute;
	left: 2px;
}

.hap-done {
	padding: 26px 24px;
	border: 1px solid #bbf7d0;
	border-radius: var(--hap-radius);
	background: #f0fdf4;
	color: #14532d;
}

.hap-done-title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
}

/* --------------------------------------------------------------- consent */

.hap-consent {
	margin: 22px 0 0;
	font-size: 14px;
	color: var(--hap-muted);
}

.hap-consent label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	cursor: pointer;
}

.hap-wrap .hap-consent input[type="checkbox"] {
	flex: 0 0 auto;
	margin: 3px 0 0;
	width: 17px;
	height: 17px;
	accent-color: var(--hap-accent);
}

/* --------------------------------------------------------------- actions */

.hap-actions {
	margin: 24px 0 0;
}

.hap-wrap .hap-btn {
	display: inline-block;
	padding: 13px 30px;
	border: 0;
	border-radius: var(--hap-radius);
	background: var(--hap-accent);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background .15s ease, transform .05s ease;
}

.hap-wrap .hap-btn:hover,
.hap-wrap .hap-btn:focus {
	background: #cf4a1e;
	color: #fff;
}

.hap-wrap .hap-btn:active {
	transform: translateY(1px);
}

.hap-wrap .hap-btn[disabled] {
	opacity: .6;
	cursor: default;
}

/* The honeypot must be reachable by a bot and invisible to everyone else. */
.hap-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
