/**
 * AW Forms front-end styles. Minimal and theme-friendly.
 *
 * Brand hooks: a theme can set these custom properties (globally or on the
 * form wrap) to tie the form into the site's brand. Sensible generic
 * fallbacks apply when they are not defined.
 *
 *   --aw-form-accent   primary button / focus colour
 *   --aw-form-error    invalid field + error message colour
 *   --aw-form-border   input border colour
 *   --aw-form-radius   corner radius
 */

.aw-form-wrap {
	--aw-form-accent: var( --aw-brand-primary, #1c5d4c );
	--aw-form-error: var( --aw-brand-danger, #b32d2e );
	--aw-form-border: var( --aw-brand-border, #c3c4c7 );
	--aw-form-radius: var( --aw-brand-radius, 4px );
}

.aw-form__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 1rem;
}

.aw-form__field label {
	font-weight: 600;
}

.aw-form__field input,
.aw-form__field textarea {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var( --aw-form-border );
	border-radius: var( --aw-form-radius );
	font: inherit;
}

.aw-form__field input:focus,
.aw-form__field textarea:focus {
	outline: 2px solid var( --aw-form-accent );
	outline-offset: 1px;
	border-color: var( --aw-form-accent );
}

.aw-form__field textarea {
	resize: vertical;
}

.aw-form__required {
	color: var( --aw-form-error );
}

/* Inline per-field validation (replaces the browser's native bubble). */
.aw-form__field--invalid input,
.aw-form__field--invalid textarea {
	border-color: var( --aw-form-error );
	box-shadow: 0 0 0 1px var( --aw-form-error );
}

.aw-form__error {
	color: var( --aw-form-error );
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1.4;
}

.aw-form__submit {
	padding: 0.6rem 1.5rem;
	border: none;
	border-radius: var( --aw-form-radius );
	background: var( --aw-form-accent );
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.aw-form__submit:hover {
	opacity: 0.92;
}

.aw-form__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.aw-form__notice {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: var( --aw-form-radius );
}

.aw-form__notice--success {
	background: #edfaef;
	border: 1px solid var( --aw-form-accent );
}

.aw-form__notice--error {
	background: #fcf0f1;
	border: 1px solid var( --aw-form-error );
}
