/*
 * Form area printed by the [tber_form] shortcode.
 * The accent follows the theme's "primary" colour when it has one; otherwise a fixed blue,
 * never the text colour (a white button label on a white button). Muted text is a fixed grey
 * that stays readable (7:1 on white). Set --tber-accent / --tber-muted on .tber-form to change them.
 */

.tber-form {
	display: grid;
	gap: 1rem;
	--tber-accent: var(--wp--preset--color--primary, #2271b1);
	--tber-muted: #50575e;
	--tber-line: var(--wp--preset--color--unitone-light-gray, #e5e7eb);
}

.tber-form p,
.tber-form ul,
.tber-form dl {
	margin: 0;
}

.tber-form__meta {
	color: var(--tber-muted);
	font-weight: 700;
}

.tber-form__notice {
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--tber-accent);
	background: #fff;
	font-weight: 700;
}

.tber-form__errors {
	padding: 0.75rem 1rem 0.75rem 2rem;
	border-left: 4px solid #d63638;
	background: #fff;
	color: #b32d2e;
}

.tber-form__status {
	font-weight: 700;
}

.tber-form__summary {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1.5rem;
}

.tber-form__summary dt {
	color: var(--tber-muted);
	font-weight: 700;
}

.tber-form__summary dd {
	margin: 0;
}

.tber-form button {
	padding: 0.7em 1.6em;
	border: 1px solid var(--tber-accent);
	border-radius: 8px;
	background: var(--tber-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.tber-form__cancel button {
	background: #fff;
	color: var(--tber-accent);
}

.tber-form__form {
	display: grid;
	gap: 2.25rem;
	margin: 0;
	padding-top: 1rem;
	border-top: 1px solid var(--tber-line);
}

.tber-form__cancel {
	margin: 0;
}

.tber-form__field {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.tber-form__field label,
.tber-form__field legend {
	font-weight: 700;
}

.tber-form__field legend {
	margin-bottom: 0.35rem;
	padding: 0;
}

.tber-form__field .tber-form__choice {
	display: block;
	font-weight: 400;
	line-height: 1.6;
}

.tber-form__choice:has(input:disabled) {
	color: var(--tber-muted);
}

.tber-form__field input[type="text"],
.tber-form__field input[type="email"],
.tber-form__field textarea {
	width: 100%;
	max-width: 32rem;
	padding: 0.6em 0.8em;
	border: 1px solid var(--tber-line);
	border-radius: 6px;
	background: #fff;
	font: inherit;
	box-sizing: border-box;
}

.tber-form__field input[type="number"],
.tber-form__field input[type="date"] {
	padding: 0.6em 0.8em;
	border: 1px solid var(--tber-line);
	border-radius: 6px;
	background: #fff;
	font: inherit;
	justify-self: start;
}

.tber-form__field small {
	color: var(--tber-muted);
}

.tber-form__rating {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

.tber-form__required {
	margin-left: 0.5em;
	padding: 0.1em 0.5em;
	border-radius: 4px;
	background: #d63638;
	color: #fff;
	font-size: 0.75em;
	font-weight: 700;
	vertical-align: middle;
}

/* The honeypot: out of sight and out of the accessibility tree. */
.tber-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
