/* Form — the message card (class .dba-form): header, text area, "I need help with" chips, name / email / send,
   and the notice box. Sizes here are plain rem; the Home page scales them to the board in pages/home.css. */

.dba-form {
	display: grid;
	gap: 1rem;
	padding: 1.25rem;
	background: var(--dba-surface);
	border: 1px solid var(--dba-line);
	border-radius: var(--dba-radius-m);
	box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.28);
}

.dba-form p,
.dba-form fieldset {
	margin: 0;
}

/* Visible only to screen readers: the fields have placeholders, the labels keep them accessible */
.dba-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Header: "You" bubble, "Message as You", and a New message button that clears the form */
.dba-form__head {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.875rem;
}

.dba-form__you {
	display: grid;
	flex: none;
	place-items: center;
	width: 1.625rem;
	height: 1.625rem;
	border-radius: 50%;
	background: var(--dba-accent);
	color: var(--dba-accent-ink);
	font-size: 0.5625rem;
	font-weight: 600;
}

.dba-form__as {
	color: var(--dba-ink-soft);
}

.dba-form__as strong {
	color: var(--dba-ink);
}

.dba-form__new {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-left: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--dba-muted);
	font: inherit;
	cursor: pointer;
}

.dba-form__new:hover {
	color: var(--dba-ink);
}

.dba-form__new .dba-icon {
	width: 1rem;
	height: 1rem;
}

.dba-form__field {
	display: grid;
	gap: 0.4em;
}

.dba-form input[type="text"],
.dba-form input[type="email"],
.dba-form textarea {
	width: 100%;
	padding: 0.7em 0.85em;
	background: var(--dba-surface);
	border: 1px solid var(--dba-field-line);
	border-radius: var(--dba-radius-s);
	color: var(--dba-ink);
	font: inherit;
	line-height: 1.35;
}

.dba-form input::placeholder,
.dba-form textarea::placeholder {
	color: var(--dba-muted);
}

.dba-form textarea {
	min-height: 6.5em;
	resize: vertical;
}

.dba-form input:focus-visible,
.dba-form textarea:focus-visible {
	outline: 2px solid var(--dba-accent);
	outline-offset: 1px;
}

.dba-form [aria-invalid="true"] {
	border-color: var(--dba-ink);
}

/* "I need help with": chips you can switch on and off (real checkboxes, so it works without JavaScript) */
.dba-form__topics {
	min-width: 0;
	padding: 0;
	border: 0;
}

.dba-form__topics legend {
	padding: 0;
	color: var(--dba-ink-soft);
	font-size: 0.875rem;
}

.dba-topics {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.dba-topic {
	position: relative;
	cursor: pointer;
}

.dba-topic input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}

.dba-topic span {
	display: block;
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--dba-line);
	border-radius: 999px;
	background: var(--dba-surface);
	color: var(--dba-ink);
	font-size: 0.875rem;
	line-height: 1.2;
	transition: background-color var(--dba-dur-s) var(--dba-ease), border-color var(--dba-dur-s) var(--dba-ease), color var(--dba-dur-s) var(--dba-ease);
}

.dba-topic:hover span {
	border-color: var(--dba-ink);
}

.dba-topic input:checked + span {
	border-color: var(--dba-accent);
	background: var(--dba-accent-soft);
	color: var(--dba-accent);
	font-weight: 600;
}

.dba-topic input:focus-visible + span {
	outline: 2px solid var(--dba-accent);
	outline-offset: 2px;
}

/* Name, email and the send button on one row */
.dba-form__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 0.625rem;
	align-items: stretch;
}

.dba-form__submit {
	justify-content: center;
	white-space: nowrap;
}

/* Trap field for bots: out of sight, out of the tab order */
.dba-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.dba-form__notice {
	padding: 0.75em 1em;
	border-radius: var(--dba-radius-s);
	font-weight: 600;
	line-height: 1.4;
}

.dba-form__notice p + p {
	margin-top: 0.25em;
}

.dba-form__notice--ok {
	background: var(--dba-tint-green);
	color: var(--dba-green);
}

.dba-form__notice--error {
	background: var(--dba-tint-beige);
	border-left: 3px solid var(--dba-ink);
}
