/**
 * Maravian Forms - public form styling. Prefix: mwc-form__.
 *
 * Inherits the theme: text colour and font come from the page, borders and tints are mixed
 * from currentColor, so the same CSS reads correctly on light and dark themes without
 * guessing which one it is on. Never use prefers-color-scheme here (see CLAUDE.md).
 */

.mwc-form {
	--mwc-form-line: color-mix(in srgb, currentColor 22%, transparent);
	--mwc-form-tint: color-mix(in srgb, currentColor 4%, transparent);
	--mwc-form-error: #c62828;
	--mwc-form-ok: #2e7d32;
	color: inherit;
	font: inherit;
	max-width: 760px;
}

.mwc-form__title {
	margin: 0 0 0.8em;
}

.mwc-form__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 1.1em 4%;
}

.mwc-form__field {
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	min-width: 0;
}

.mwc-form__field--half {
	flex: 1 1 48%;
}

@media (max-width: 600px) {
	.mwc-form__field--half {
		flex-basis: 100%;
	}
}

.mwc-form__label {
	font-weight: 600;
	padding: 0;
}

.mwc-form__req {
	color: var(--mwc-form-error);
}

.mwc-form input[type="text"],
.mwc-form input[type="email"],
.mwc-form input[type="tel"],
.mwc-form input[type="url"],
.mwc-form input[type="number"],
.mwc-form input[type="date"],
.mwc-form select,
.mwc-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.6em 0.75em;
	border: 1px solid var(--mwc-form-line);
	border-radius: 6px;
	background: var(--mwc-form-tint);
	color: inherit;
	font: inherit;
}

.mwc-form input[type="file"] {
	padding: 0.6em;
	border: 1px dashed var(--mwc-form-line);
	border-radius: 6px;
	background: var(--mwc-form-tint);
	color: inherit;
	max-width: 100%;
}

.mwc-form input:focus-visible,
.mwc-form select:focus-visible,
.mwc-form textarea:focus-visible {
	outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
	outline-offset: 1px;
}

.mwc-form__fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}

.mwc-form__choice {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	font-weight: 400;
	cursor: pointer;
}

.mwc-form__choice input {
	margin-top: 0.25em;
}

.mwc-form__help,
.mwc-form__limits {
	font-size: 0.85em;
	opacity: 0.75;
}

.mwc-form__heading {
	flex: 1 1 100%;
	margin: 0.6em 0 0;
	padding-bottom: 0.3em;
	border-bottom: 1px solid var(--mwc-form-line);
}

.mwc-form__text {
	flex: 1 1 100%;
}

.mwc-form__error {
	color: var(--mwc-form-error);
	font-size: 0.9em;
}

.mwc-form__field.has-error input,
.mwc-form__field.has-error select,
.mwc-form__field.has-error textarea {
	border-color: var(--mwc-form-error);
}

.mwc-form__notice {
	padding: 0.8em 1em;
	border-radius: 6px;
	border: 1px solid var(--mwc-form-line);
	background: var(--mwc-form-tint);
	margin-bottom: 1em;
}

.mwc-form__notice--error {
	border-color: color-mix(in srgb, var(--mwc-form-error) 60%, transparent);
}

.mwc-form__notice--ok {
	border-color: color-mix(in srgb, var(--mwc-form-ok) 60%, transparent);
}

.mwc-form__notice p:last-child {
	margin-bottom: 0;
}

.mwc-form__actions {
	margin-top: 1.4em;
}

.mwc-form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* The honeypot: off-screen, not display:none (some bots skip hidden inputs). */
.mwc-form__hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mwc-form [hidden],
.mwc-form[hidden] {
	display: none !important;
}
