/**
 * Theme forms and the GDPR consent control.
 *
 * The consent block deliberately shares the field styling of the form it sits
 * in — same border, radius, spacing and type scale — so it reads as part of the
 * form rather than as a bolted-on legal notice.
 */

.franchesco-form-section {
	padding-block: var(--space-section);
	background: var(--color-bg);
	color: var(--color-text);
}

.franchesco-form-section--alt {
	background: var(--color-bg-alt);
}

.franchesco-form-card {
	width: min(100% - 2.5rem, 46rem);
	margin-inline: auto;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	padding: clamp(1.5rem, 4vw, var(--space-16));
}

.franchesco-form-card__title {
	margin-bottom: var(--space-3);
}

.franchesco-form-card__intro {
	color: var(--color-text-muted);
	margin-bottom: var(--space-12);
}

.franchesco-form__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-6);
}

.franchesco-form__grid--three {
	grid-template-columns: repeat(3, 1fr);
}

.franchesco-form__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	margin: 0 0 var(--space-8);
}

.franchesco-form__field label {
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-text);
}

.franchesco-form__field input,
.franchesco-form__field select,
.franchesco-form__field textarea {
	width: 100%;
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: var(--color-text);
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: var(--space-4) var(--space-6);
	transition: border-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}

.franchesco-form__field input:hover,
.franchesco-form__field select:hover,
.franchesco-form__field textarea:hover {
	border-color: var(--color-neutral-400);
}

.franchesco-form__field input:focus,
.franchesco-form__field select:focus,
.franchesco-form__field textarea:focus {
	border-color: var(--color-primary-600);
	box-shadow: 0 0 0 3px var(--color-primary-100);
	outline: none;
}

/* The honeypot: present for bots, invisible and unreachable for people. */
.franchesco-form__field--hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.franchesco-form__error {
	margin: 0;
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--color-danger);
}

.franchesco-form__notice,
.franchesco-form__success {
	margin: 0 0 var(--space-8);
	padding: var(--space-4) var(--space-6);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	font-weight: 500;
	border: 1px solid var(--color-border);
}

.franchesco-form__notice {
	color: var(--color-danger);
	border-color: var(--color-danger);
	background: var(--color-primary-50);
}

.franchesco-form__success {
	color: var(--color-success);
	border-color: var(--color-success);
	background: transparent;
}

.franchesco-form__actions {
	margin: var(--space-8) 0 0;
}

/* ------------------------------------------------------- Consent control */

.franchesco-consent {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: var(--space-3) var(--space-4);
	margin-block: var(--space-8);
	padding: var(--space-6);
	background: var(--color-bg-alt);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}

.franchesco-consent__input {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.2rem 0 0;
	accent-color: var(--color-primary-600);
	flex: none;
	cursor: pointer;
}

.franchesco-consent__label {
	font-size: var(--text-sm);
	font-weight: 400;
	line-height: 1.5;
	color: var(--color-text-muted);
	cursor: pointer;
}

.franchesco-consent__link {
	font-weight: 600;
	color: var(--color-primary-600);
}

.franchesco-consent__error {
	grid-column: 1 / -1;
	display: none;
	margin: 0;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-danger);
}

.franchesco-consent--error {
	border-color: var(--color-danger);
	background: var(--color-primary-50);
}

.franchesco-consent--error .franchesco-consent__error {
	display: block;
}

/* --------------------------------------------- Footer newsletter sign-up */

.franchesco-newsletter__title {
	font-family: var(--font-body);
	font-size: var(--text-sm);
	text-transform: uppercase;
	letter-spacing: var(--letter-wide);
	color: var(--color-neutral-400);
	margin-bottom: var(--space-6);
}

.franchesco-newsletter__intro {
	font-size: var(--text-sm);
	color: var(--color-neutral-100);
}

.franchesco-newsletter .franchesco-form__field {
	margin-bottom: var(--space-6);
}

.franchesco-newsletter .franchesco-form__field label {
	color: var(--color-neutral-100);
}

.franchesco-newsletter .franchesco-form__field input {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.24);
	color: var(--color-text-invert);
}

.franchesco-newsletter .franchesco-consent {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.24);
}

.franchesco-newsletter .franchesco-consent__label {
	color: var(--color-neutral-100);
}

.franchesco-newsletter .franchesco-consent__link {
	color: var(--color-neutral-0);
}

.franchesco-newsletter .franchesco-form__success {
	color: var(--color-neutral-0);
	border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 720px) {
	.franchesco-form__grid,
	.franchesco-form__grid--three {
		grid-template-columns: 1fr;
	}
}
