/* ==========================================================================
   Colitco — forms
   ========================================================================== */

.colitco-form-wrap {
	min-width: 0;
}

/*
 * The honeypot must be invisible to people but still reachable by the
 * browser, so it cannot use display:none — some bots skip hidden
 * fields, which would defeat the point.
 */
.colitco-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.colitco-form {
	display: grid;
	gap: 1rem;
}

@media (min-width: 640px) {
	.colitco-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.colitco-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.colitco-field--wide {
	grid-column: 1 / -1;
}

.colitco-field label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--foreground);
}

.colitco-required {
	color: var(--negative);
}

.colitco-field [aria-invalid="true"] {
	border-color: var(--negative);
	box-shadow: 0 0 0 1px var(--negative);
}

.colitco-form__submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.colitco-form__note {
	font-size: 0.6875rem;
	line-height: 1.4;
	color: var(--muted-foreground);
	max-width: 52ch;
}

/* Panels -------------------------------------------------------------------- */

.colitco-form-panel {
	padding: 1.5rem;
}

@media (min-width: 640px) {
	.colitco-form-panel { padding: 2rem; }
}

.colitco-form-panel__title {
	font-family: var(--font-editorial);
	font-weight: 400;
	font-size: 1.75rem;
	line-height: 1.2;
	color: var(--primary);
}

.colitco-form-panel__intro {
	margin-top: 0.5rem;
	margin-bottom: 1.5rem;
	max-width: 60ch;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--secondary-foreground);
}

/* Notices ------------------------------------------------------------------- */

.form-notice {
	padding: 0.875rem 1rem;
	border: 1px solid var(--border);
	border-left-width: 3px;
	border-radius: calc(var(--radius) - 2px);
	background: var(--card);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.form-notice--success {
	border-left-color: var(--positive);
	color: var(--foreground);
}

.form-notice--error {
	border-left-color: var(--negative);
	color: var(--foreground);
}

/* Inside the dark newsletter panel the notice needs its own colours. */
.newsletter .form-notice {
	border-color: color-mix(in oklab, var(--primary-foreground) 25%, transparent);
	background: color-mix(in oklab, var(--primary-foreground) 10%, transparent);
	color: var(--primary-foreground);
}

/* Newsletter signup --------------------------------------------------------- */

.newsletter-form__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
}

.newsletter-form__row input[type="email"] {
	min-width: 0;
}

.newsletter .newsletter-form__row input[type="email"] {
	border-color: color-mix(in oklab, var(--primary-foreground) 25%, transparent);
	background: color-mix(in oklab, var(--primary-foreground) 10%, transparent);
	color: var(--primary-foreground);
}

.newsletter .newsletter-form__row input::placeholder {
	color: color-mix(in oklab, var(--primary-foreground) 50%, transparent);
}

.newsletter-form__row .btn {
	flex-shrink: 0;
}

/* ==========================================================================
   Cookie consent
   ========================================================================== */

.consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 200;
	border-top: 1px solid var(--border);
	background: var(--card);
	box-shadow: 0 -4px 24px color-mix(in oklab, var(--primary) 12%, transparent);
}

.consent[hidden] {
	display: none;
}

.consent__inner {
	display: grid;
	gap: 1rem;
	width: min(calc(100% - 2rem), var(--shell-max));
	margin-inline: auto;
	padding-block: 1rem;
}

@media (min-width: 768px) {
	.consent__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}
}

.consent__text {
	max-width: 80ch;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--secondary-foreground);
}

.consent__text a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.consent__actions .btn {
	flex: 1;
	min-width: 8rem;
}

@media (min-width: 768px) {
	.consent__actions .btn { flex: none; }
}
