/*
 * jobgetr.ai inquiry form - the shared structured form.
 *
 * A business record rather than a SaaS card: label in one column,
 * control in the other, thin rules between rows, square corners, no
 * shadow. Phones stack label over control in one column. Controls are
 * scoped through .jg-form because the Newspaper theme styles input,
 * select and textarea by element and attribute and would otherwise
 * outrank a bare class.
 */

.jg-form {
	--f-ink: var(--jg-navy, #131f49);
	--f-body: #1f2329;
	--f-soft: var(--jg-gray, #717176);
	--f-line: var(--jg-border, #e1e4ea);
	--f-rule: #eceef2;
	--f-brand: var(--jg-accent, #ff6a13);
	--f-bad: #c0392b;
	--f-mono: var(--jg-font-mono, ui-monospace, SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace);

	box-sizing: border-box;
	width: 100%;
	max-width: 860px;
	color: var(--f-body);
}

.jg-form * {
	box-sizing: border-box;
}

/* ---- the record */
.jg-form .jg-form__set {
	margin: 0;
	padding: 0;
	border: 1px solid var(--f-line);
	border-bottom: 0;
}

.jg-form .jg-form__legend {
	width: 100%;
	margin: 0;
	padding: 14px 20px;
	border-bottom: 1px solid var(--f-line);
	background: #f6f7f9;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--f-ink);
	float: left; /* a legend cannot be a grid/flex child; this keeps it a full-width bar */
}

.jg-form__row {
	display: grid;
	grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
	gap: 0 24px;
	align-items: start;
	clear: both;
	padding: 16px 20px;
	border-bottom: 1px solid var(--f-rule);
}

.jg-form__row[hidden] {
	display: none;
}

.jg-form__row:last-of-type {
	border-bottom: 1px solid var(--f-line);
}

.jg-form__row--wide {
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
}

.jg-form__label-cell {
	padding-top: 9px;
}

.jg-form__row--wide .jg-form__label-cell {
	padding-top: 0;
}

.jg-form .jg-form__label {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--f-ink);
}

.jg-form__req {
	margin-left: 2px;
	color: var(--f-brand);
}

.jg-form__optional {
	display: block;
	margin-top: 2px;
	font-family: var(--f-mono);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--f-soft);
}

.jg-form__help {
	margin: 4px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--f-soft);
}

/* ---- controls */
.jg-form .jg-form__input,
.jg-form .jg-form__select,
.jg-form .jg-form__textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 9px 11px;
	border: 1px solid var(--f-line);
	border-radius: 2px;
	background: #fff;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--f-body);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jg-form .jg-form__textarea {
	min-height: 150px;
	resize: vertical;
}

.jg-form .jg-form__select {
	height: auto;
	appearance: auto;
	-webkit-appearance: menulist;
}

.jg-form .jg-form__input:focus,
.jg-form .jg-form__select:focus,
.jg-form .jg-form__textarea:focus {
	outline: none;
	border-color: var(--f-brand);
	box-shadow: 0 0 0 3px rgba(255, 106, 19, 0.18);
}

.jg-form .jg-form__input:focus-visible,
.jg-form .jg-form__select:focus-visible,
.jg-form .jg-form__textarea:focus-visible {
	outline: 2px solid var(--f-brand);
	outline-offset: 1px;
}

.jg-form [aria-invalid="true"] {
	border-color: var(--f-bad);
}

.jg-form__error {
	margin: 6px 0 0;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--f-bad);
}

.jg-form__error[hidden] {
	display: none;
}

/* ---- the honeypot: out of sight, out of the tab order */
.jg-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- foot */
.jg-form__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0 0;
}

.jg-form__consent {
	flex: 1 1 320px;
	margin: 0;
	max-width: 62ch;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--f-soft);
}

.jg-form__consent a {
	color: var(--f-ink) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
}

.jg-form__consent a:hover,
.jg-form__consent a:focus {
	color: var(--f-brand) !important;
}

.jg-form .jg-form__submit {
	flex: 0 0 auto;
	padding: 13px 26px;
	border: 1px solid var(--f-ink);
	border-radius: 2px;
	background: var(--f-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.jg-form .jg-form__submit:hover,
.jg-form .jg-form__submit:focus {
	border-color: var(--f-brand);
	background: var(--f-brand);
	color: #0b1426;
}

.jg-form .jg-form__submit:focus-visible {
	outline: 2px solid var(--f-brand);
	outline-offset: 3px;
}

.jg-form .jg-form__submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* ---- messages */
.jg-form__notice {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-left: 3px solid var(--f-bad);
	background: #fdf3f2;
	font-size: 14px;
	line-height: 1.5;
	color: var(--f-body);
}

.jg-form__notice[hidden] {
	display: none;
}

.jg-form__done {
	padding: 26px 24px;
	border: 1px solid var(--f-line);
	border-left: 3px solid var(--f-brand);
	background: #f6f7f9;
}

.jg-form__done[hidden] {
	display: none;
}

.jg-form__done-title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--f-ink);
}

.jg-form__done-text {
	margin: 0;
	max-width: 60ch;
	font-size: 15px;
	line-height: 1.55;
	color: var(--f-body);
}

.jg-form__form[hidden] {
	display: none;
}

/* ---- responsive */
@media (max-width: 767px) {
	.jg-form__row,
	.jg-form__row--wide {
		grid-template-columns: minmax(0, 1fr);
		gap: 7px;
		padding: 14px 14px;
	}

	.jg-form__label-cell {
		padding-top: 0;
	}

	.jg-form .jg-form__legend {
		padding: 12px 14px;
	}

	.jg-form .jg-form__input,
	.jg-form .jg-form__select,
	.jg-form .jg-form__textarea {
		font-size: 16px; /* no zoom-on-focus in iOS Safari */
	}

	.jg-form .jg-form__textarea {
		min-height: 130px;
	}

	.jg-form__foot {
		align-items: stretch;
		gap: 14px;
	}

	.jg-form .jg-form__submit {
		width: 100%;
	}

	.jg-form__done {
		padding: 20px 16px;
	}
}
