/* The forms' own sheet (design review, 06.10.2026): joining, signing in, writing to the team, and the member's own
   forms. Only the screens that hold one load it; the shared sheet is at its byte ceiling. */

/* A username or an address is Latin text: in a right-to-left field its hyphen jumped to the wrong end. */
[dir="rtl"] :is(#bnb-login, #bnb-join-username, input[type="email"], input[type="url"], input[type="tel"]) {
	direction: ltr;
	text-align: right;
}

/* A form page opens on the form, not on a hero title. */
:is(.bnb-join-page, .bnb-contact-page, .bnb-community-dashboard, .bnb-account-page) .bnb-page-intro {
	margin-block-end: 1.5rem;
}

:is(.bnb-join-page, .bnb-contact-page, .bnb-community-dashboard, .bnb-account-page) .bnb-page-intro h1 {
	font-size: clamp(2rem, 3.6vw, 2.75rem);
	letter-spacing: 0;
}

/* The owner's words above a form: what the form gives, set apart from the fields' own small print. */
.bnb-form-intro {
	background: color-mix(in srgb, var(--bnb-gold-pale) 45%, var(--bnb-surface));
	border-radius: var(--bnb-r);
	margin-block: 0 1.25rem;
	max-inline-size: 44rem;
	padding: 0.9rem 1.25rem;
}

.bnb-form-intro :is(p, li) {
	font-size: 0.95rem;
	line-height: 1.6;
}

.bnb-form-intro p {
	margin-block: 0 0.5rem;
}

.bnb-form-intro > :last-child {
	margin-block-end: 0;
}

/* A label sits close to its own field, and a group starts with air above it. Every gap used to be the same. */
:is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form, .bnb-auth-form) {
	row-gap: 0.4rem;
}

:is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form, .bnb-auth-form) > label:not(:has(> input)) {
	display: block;
	margin-block-start: 1.1rem;
}

:is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form, .bnb-auth-form) > label:not(:has(> input)):first-of-type {
	margin-block-start: 0;
}

:is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form, .bnb-auth-form) > :is(fieldset, details, .bnb-check-row, label:has(> input)) {
	margin-block: 1.1rem 0;
}

:is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form) .bnb-form-help {
	font-size: 0.9rem;
	margin-block: 0;
}

.bnb-portal-page form label small {
	color: var(--bnb-muted);
	font-weight: 500;
	margin-inline-start: 0.35rem;
}

/* The field the error names. */
.bnb-portal-page [aria-invalid="true"] {
	border-color: var(--bnb-danger);
	border-width: 2px;
}

.bnb-portal-page :is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form) > .bnb-button {
	margin-block-start: 1.25rem;
	min-inline-size: 10rem;
}

/* Signing in: one action, the way back to a forgotten password beside it, and joining set apart below. */
label[for="bnb-2fa"] {
	color: var(--bnb-muted);
	font-size: 0.92rem;
	font-weight: 500;
}

.bnb-auth-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-block-start: 1.1rem;
}

.bnb-auth-actions .bnb-button {
	margin: 0;
	min-inline-size: 10rem;
}

.bnb-auth-actions a:not(.bnb-button) {
	align-items: center;
	display: inline-flex;
	min-block-size: 44px;
}

.bnb-auth-alt {
	border-block-start: 1px solid var(--bnb-line);
	margin-block-start: 1.5rem;
	padding-block-start: 1.25rem;
}

.bnb-auth-alt p {
	margin-block: 0 0.75rem;
}

/* A phone shows one frame, not a card inside a card, and the main action across the screen. */
@media (max-width: 40rem) {
	:is(.bnb-join-form, .bnb-contact-form) {
		background: none;
		border: 0;
		box-shadow: none;
		padding: 0;
	}

	.bnb-portal-page :is(.bnb-join-form, .bnb-contact-form, .bnb-community-panel form) > .bnb-button,
	.bnb-auth-actions .bnb-button {
		inline-size: 100%;
		justify-self: stretch;
		min-block-size: 52px;
	}
}

/* The support line under a form is a thumb target too. */
@media (pointer: coarse) {
	.bnb-auth-aside a {
		align-items: center;
		display: inline-flex;
		min-block-size: 44px;
	}
}
