/*
 * HDL Forms — structural styles only.
 *
 * Colors and typography inherit from the active theme. Every visual value
 * uses a CSS custom property with a soft fallback, so Kepler-family sites
 * pick up their design tokens automatically and any other theme still gets
 * a sane default. No brand values live here.
 */

.hdl-form {
	display: block;
}

.hdl-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--hdl-form-gap, 14px);
}

.hdl-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	grid-column: 1 / -1;
}

.hdl-form__field--half {
	grid-column: auto / span 1;
}

@media (max-width: 640px) {
	.hdl-form__field--half {
		grid-column: 1 / -1;
	}
}

.hdl-form__field input,
.hdl-form__field textarea,
.hdl-form__field select {
	font: inherit;
	color: inherit;
	width: 100%;
	box-sizing: border-box;
	background: var(--hdl-form-field-bg, var(--paper-2, rgba(0, 0, 0, 0.04)));
	border: 1px solid var(--hdl-form-field-border, var(--rule, rgba(0, 0, 0, 0.15)));
	border-radius: var(--hdl-form-field-radius, 10px);
	padding: 12px 14px;
}

.hdl-form__field input:focus,
.hdl-form__field textarea:focus,
.hdl-form__field select:focus {
	outline: none;
	border-color: var(--hdl-form-accent, var(--blue, #2563eb));
	box-shadow: 0 0 0 4px var(--hdl-form-focus-ring, rgba(37, 99, 235, 0.1));
}

.hdl-form__field [aria-invalid="true"] {
	border-color: var(--hdl-form-error, var(--warn, #b32d2e));
}

.hdl-form__error {
	font-size: 0.85em;
	color: var(--hdl-form-error, var(--warn, #b32d2e));
}

.hdl-form__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

.hdl-form__check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.hdl-form__check input {
	width: auto;
}

.hdl-form__submit {
	margin-top: var(--hdl-form-gap, 14px);
	cursor: pointer;
}

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

.hdl-form__notice {
	margin: 0 0 var(--hdl-form-gap, 14px);
}

.hdl-form__notice:empty {
	display: none;
}

.hdl-form__notice--success {
	color: var(--hdl-form-success, var(--ok, #1e7a4f));
}

.hdl-form__notice--error {
	color: var(--hdl-form-error, var(--warn, #b32d2e));
}

/* Honeypot: off-screen, not display:none (some bots skip hidden inputs). */
.hdl-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
