/*
 * Form controls: text fields (.fin), the on/off switch, inline validation.
 */

.fin {
	box-sizing: border-box;
	width: 100%;
	min-height: 54px;
	padding: 0 16px;
	border: 1.5px solid #cfc7ba;
	border-radius: 16px;
	background: var(--rbnl-white);
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-body);
	font-size: 17px;
	transition:
		border-color 0.25s var(--rbnl-ease),
		box-shadow 0.25s var(--rbnl-ease);
}

.fin::placeholder {
	color: #a9a6bc;
}

.fin:hover {
	border-color: #9e97b8;
}

.fin:focus {
	outline: none;
	border-color: var(--rbnl-ink);
	box-shadow: var(--rbnl-focus-ring);
}

.fin.inv,
.fin[aria-invalid='true'] {
	border-color: #b42318;
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

select.fin {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 48px;
	cursor: pointer;
}

/* Honeypot: invisible to people, still in the DOM for bots. */
.newsletter__trap,
.form-trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* On/off switch (cookie settings) */
.switch {
	position: relative;
	flex: 0 0 auto;
	width: 56px;
	height: 32px;
	margin: 0;
	border: 0;
	border-radius: var(--rbnl-radius-pill);
	background: #cfc7ba;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: background-color 0.3s var(--rbnl-ease);
}

/* Bigger hit area (44px+) without changing the look. */
.switch::before {
	content: '';
	position: absolute;
	inset: -7px -6px;
}

.switch::after {
	content: '';
	position: absolute;
	top: 4px;
	left: 4px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--rbnl-white);
	box-shadow: 0 1px 3px rgba(33, 30, 100, 0.25);
	transition: transform 0.3s var(--rbnl-ease-spring);
}

.switch:checked {
	background: var(--rbnl-ink);
}

.switch:checked::after {
	transform: translateX(24px);
}

.switch:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Labelled field: label above the control. */
.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.field > label,
.choices > legend {
	padding: 0;
	color: var(--rbnl-ink);
	font-size: 15px;
	font-weight: 500;
}

.field__req {
	color: var(--rbnl-orange-dark);
}

textarea.fin {
	min-height: 0;
	padding: 12px 16px;
	line-height: 1.5;
	resize: vertical;
}

/* Choice pills (radio): the chosen one turns peach. */
.choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
}

.choices > legend {
	margin-bottom: 8px;
}

.choice {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 18px 0 14px;
	border-radius: var(--rbnl-radius-pill);
	background: var(--rbnl-cream);
	color: var(--rbnl-ink);
	cursor: pointer;
	transition: background-color 0.3s var(--rbnl-ease);
}

.choice input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--rbnl-ink);
}

.choice:has(input:checked) {
	background: var(--rbnl-peach);
}

.choice:has(input:focus-visible) {
	outline: 3px solid var(--rbnl-ink);
	outline-offset: 2px;
}

/* Error box above a form (server-side check failed). */
.signup__error p {
	margin: 0;
}

.signup__error ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.signup__error {
	margin: 20px 0 0;
	padding: 14px 16px;
	border-radius: 14px;
	background: #fdeceb;
	color: #b42318;
	font-weight: 500;
}
