/* Created by Claude (Anthropic), model Claude Opus 5. Review before relying on it. */

/* ==========================================================================
   form.css - the form itself: fields, controls, validation, actions
   --------------------------------------------------------------------------
   Depends only on the tokens declared in base.css. Every colour here goes
   through a variable, so the whole form re-themes from the single `brand`
   colour in branding.yml - there are no literal colours below.
   ========================================================================== */

/* --- field grid --------------------------------------------------------- */

.fields {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1.5rem 1.25rem;
	margin-top: 2rem;
}

.field--full   { grid-column: span 6; }
.field--half   { grid-column: span 3; }
.field--third  { grid-column: span 2; }

@media (max-width: 40rem) {
	.field--half, .field--third { grid-column: span 6; }
	.fields { gap: 1.375rem 0; }
}

.field { min-width: 0; }

.field--static + .field { margin-top: .25rem; }

/* --- labels and help ---------------------------------------------------- */

.field__label {
	display: block;
	font-size: .9375rem;
	font-weight: 600;
	letter-spacing: -.005em;
	color: var(--text);
	margin-bottom: .4rem;
	padding: 0;
}

.field__sublabel {
	display: block;
	font-size: .8125rem;
	font-weight: 500;
	color: var(--text-muted);
	margin-bottom: .3rem;
}

.req { color: var(--accent); font-weight: 700; }

.required-note {
	font-size: .8125rem;
	color: var(--text-faint);
}

.field__help {
	font-size: .875rem;
	color: var(--text-muted);
	margin-bottom: .55rem;
	padding: .7rem .9rem;
	background: var(--surface-sunken);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent-line);
	border-radius: var(--radius-sm);
}

.intro {
	color: var(--text-muted);
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}
.intro strong { color: var(--text); }

/* --- inputs ------------------------------------------------------------- */

.input {
	display: block;
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	padding: .6rem .75rem;
	transition: border-color .12s ease, box-shadow .12s ease;
	appearance: none;
}

.input::placeholder { color: var(--text-faint); }

.input:hover { border-color: var(--text-faint); }

.input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-ring);
}

textarea.input { resize: vertical; min-height: 6rem; line-height: 1.55; }

.input--mono { font-family: var(--font-mono); letter-spacing: .04em; }

select.input {
	/* Chevron drawn inline so the page stays free of external assets. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7273' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .8rem center;
	padding-right: 2.25rem;
}

/* --- input with a suffix (the € on the fee field) ----------------------- */

.input-affix { position: relative; }

.input-affix .input { padding-right: 2.5rem; }

.input-affix__suffix {
	position: absolute;
	right: .8rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	pointer-events: none;
}

/* The yearly total, injected by form.js next to the fee field. */
.fee-preview {
	margin-top: .55rem;
	padding: .7rem .9rem;
	font-size: .875rem;
	color: var(--text);
	background: var(--accent-soft);
	border: 1px solid var(--accent-line);
	border-radius: var(--radius-sm);
}
.fee-preview strong { font-weight: 650; }

/* --- checkboxes and radios ---------------------------------------------- */

/*
 * A <fieldset> keeps the group accessible - the <legend> is what a screen
 * reader announces before each option - but browsers position a legend *inside*
 * the fieldset's top border, so a bordered fieldset draws its border straight
 * through the heading.
 *
 * The fix is to leave the fieldset itself unstyled and put the box on an inner
 * element. The legend then sits above a border that is not there, which is
 * exactly where every other field label sits.
 */
.group {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

/* The <legend>. Browsers give it an inline padding of their own. */
.group > .field__label {
	padding: 0;
	margin-bottom: .5rem;
}

.group__options {
	display: flex;
	flex-direction: column;
	gap: .6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1rem 1.1rem;
	background: var(--surface-sunken);
}

.check { display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start; }

.check input[type="checkbox"],
.check input[type="radio"] {
	appearance: none;
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin: .18rem 0 0 0;
	border: 1.5px solid var(--border-strong);
	background: var(--surface);
	cursor: pointer;
	transition: border-color .12s ease, background-color .12s ease;
}

.check input[type="checkbox"] { border-radius: 4px; }
.check input[type="radio"]    { border-radius: 50%; }

.check input:hover { border-color: var(--accent); }

.check input:checked {
	background-color: var(--accent);
	border-color: var(--accent);
	background-repeat: no-repeat;
	background-position: center;
}

.check input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5 4.5 8.5 11 1.5'/%3E%3C/svg%3E");
}

.check input[type="radio"]:checked {
	background-image: radial-gradient(circle, white 0 32%, transparent 34%);
}

.check label {
	cursor: pointer;
	font-size: .9375rem;
	line-height: 1.5;
	color: var(--text);
}

/* A consent paragraph is long-form text, not a one-line option. */
.check--consent {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1rem 1.1rem;
	background: var(--surface-sunken);
}

.check--consent label {
	font-size: .875rem;
	color: var(--text-muted);
	line-height: 1.55;
}

.check--other {
	display: block;
	margin-top: .35rem;
	padding-top: .75rem;
	border-top: 1px dashed var(--border);
}

/* --- validation --------------------------------------------------------- */

.field.is-invalid .input,
.field.is-invalid .group__options,
.field.is-invalid .check--consent {
	border-color: var(--danger);
}

.field.is-invalid .input:focus {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

.field__error {
	margin-top: .4rem;
	font-size: .8125rem;
	font-weight: 550;
	color: var(--danger);
}

.alert {
	margin-top: 1.5rem;
	padding: .9rem 1.1rem;
	background: var(--danger-soft);
	border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
	border-left: 3px solid var(--danger);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-size: .9375rem;
}

.alert__list {
	margin-top: .5rem;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem .9rem;
	font-size: .875rem;
}
.alert__list a { color: var(--danger); }

/* --- actions ------------------------------------------------------------ */

.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.form-actions--centered {
	justify-content: center;
	border-top: 0;
	padding-top: 0;
}

.button {
	display: inline-block;
	font: inherit;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.2;
	padding: .7rem 1.4rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .12s ease, border-color .12s ease, transform .06s ease;
}

.button:hover { background: var(--surface-sunken); border-color: var(--text-faint); }
.button:active { transform: translateY(1px); }

.button--primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-contrast);
}

.button--primary:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

.button--small { padding: .35rem .8rem; font-size: .8125rem; }

.button[aria-busy="true"] { opacity: .65; pointer-events: none; }

@media (max-width: 30rem) {
	.form-actions { flex-direction: column-reverse; align-items: stretch; }
	.button { width: 100%; text-align: center; }
	.required-note { text-align: center; }
}

/* --- honeypot ----------------------------------------------------------- */

/* Off-screen rather than display:none - some bots skip hidden inputs. */
.hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
