/*
 * Omegamatrix Forms — front-end stylesheet.
 *
 * Consumes the theme's CSS custom properties (--omtk-*) and degrades to
 * sane fallbacks if the theme is inactive. Class prefix: om-forms-.
 */

.om-forms {
	--om-forms-gap: 16px;
	--om-forms-radius: 4px;
	max-width: 640px;
	font-family: var(--omtk-font-body, Ubuntu, "Helvetica Neue", Helvetica, Arial, sans-serif);
	color: var(--omtk-body, #2d2d2d);
}

.om-forms-title {
	margin-bottom: var(--om-forms-gap);
}

/* --------------------------------------------------------------- honeypot */

.om-forms-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	border: 0;
	margin: -1px;
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

/* ------------------------------------------------------------ error state */

.om-forms-errors {
	padding: 14px 18px;
	border: 1px solid var(--omtk-accent-red, #dd3333);
	border-left-width: 4px;
	margin-bottom: var(--om-forms-gap);
	background-color: #fdecec;
	border-radius: var(--om-forms-radius);
}

.om-forms-errors:focus {
	outline: 2px solid var(--omtk-accent-red, #dd3333);
	outline-offset: 2px;
}

.om-forms-errors__title {
	margin: 0 0 8px;
	font-weight: 600;
}

.om-forms-errors ul {
	margin: 0;
	padding-left: 1.2em;
}

.om-forms-errors a {
	color: #b11212;
	text-decoration: underline;
}

.om-forms-success {
	padding: 14px 18px;
	border: 1px solid #bfe3cd;
	background-color: #e9f5ee;
	border-radius: var(--om-forms-radius);
	color: #1f6b40;
}

/* -------------------------------------------------------------------- row */

.om-forms-row {
	margin-bottom: var(--om-forms-gap);
}

.om-forms-label {
	display: block;
	margin-bottom: 6px;
	color: var(--omtk-heading, #38416c);
	font-family: var(--omtk-font-heading, Raleway, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-weight: 600;
}

.om-forms-required {
	color: var(--omtk-accent-red, #dd3333);
}

.om-forms-field {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--omtk-line, #dbdbdb);
	border-radius: var(--om-forms-radius);
	background-color: var(--omtk-white, #fff);
	color: var(--omtk-body, #2d2d2d);
	font: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.om-forms-field {
	min-height: 140px;
	resize: vertical;
}

.om-forms-field:focus {
	border-color: var(--omtk-accent-red, #dd3333);
	outline: none;
	box-shadow: 0 0 0 3px rgb(221 51 51 / 15%);
}

.om-forms-field[aria-invalid="true"] {
	border-color: var(--omtk-accent-red, #dd3333);
	background-color: #fff7f7;
}

.om-forms-field-error {
	display: block;
	margin-top: 6px;
	color: #b11212;
	font-size: 13px;
}

/* -------------------------------------------------------------- checkboxes */

.om-forms-checkgroup {
	padding: 0;
	border: 0;
	margin: 0;
}

.om-forms-checkgroup legend {
	padding: 0;
	margin-bottom: 6px;
	color: var(--omtk-heading, #38416c);
	font-family: var(--omtk-font-heading, Raleway, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-weight: 600;
}

.om-forms-checkgroup__option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 18px 8px 0;
	font-weight: 400;
}

.om-forms-checkbox-single {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.om-forms-checkbox-single input {
	margin-top: 3px;
}

/* ----------------------------------------------------------------- submit */

.om-forms-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	border: 2px solid var(--omtk-accent-red, #dd3333);
	background-color: var(--omtk-accent-red, #dd3333);
	color: var(--omtk-white, #fff);
	cursor: pointer;
	font-family: var(--omtk-font-heading, Raleway, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.om-forms-submit:hover,
.om-forms-submit:focus-visible {
	border-color: var(--omtk-brand-red, #d71920);
	background-color: var(--omtk-brand-red, #d71920);
}

.om-forms-submit[disabled] {
	cursor: not-allowed;
	opacity: 0.6;
}

/* ------------------------------------------------------------- block editor preview */

.om-forms-block-editor {
	padding: 12px;
	border: 1px dashed var(--omtk-line, #dbdbdb);
	border-radius: var(--om-forms-radius);
}
