/*
 * FIIP Mail — front-end form styles.
 * Inherits the theme's CSS variables (--ink, --paper, --orange, --blue, --font).
 * Falls back gracefully if used outside the Fix It In Post theme.
 */

.fiip-mail-form {
	--fm-ink: var(--ink, #000);
	--fm-paper: var(--paper, #f2ede4);
	--fm-orange: var(--orange, #e8743c);
	--fm-hair: var(--paper-hair, rgba(242, 237, 228, 0.14));
	font-family: var(--font, "Inter", system-ui, sans-serif);
	max-width: 560px;
	margin: 0 auto;
}

/* Honeypot — visually and programmatically removed for humans. */
.fiip-mail-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fiip-mail-fields {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: stretch;
	border: 1px solid var(--fm-hair);
	border-radius: 999px;
	padding: 0.4rem 0.4rem 0.4rem 1.1rem;
	background: rgba(255, 255, 255, 0.02);
	transition: border-color 0.2s ease;
}

.fiip-mail-form:focus-within .fiip-mail-fields {
	border-color: var(--fm-orange);
}

.fiip-mail-input {
	flex: 1 1 220px;
	min-width: 0;
	background: transparent;
	border: none;
	outline: none;
	color: var(--fm-paper);
	font-size: 1.0625rem;
	padding: 0.7rem 0.4rem;
	font-family: inherit;
}

.fiip-mail-input::placeholder {
	color: var(--paper-mute, rgba(242, 237, 228, 0.45));
}

.fiip-mail-submit {
	flex: 0 0 auto;
	white-space: nowrap;
	cursor: pointer;
}

.fiip-mail-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-top: 0.85rem;
	font-size: 0.85rem;
	color: var(--paper-dim, rgba(242, 237, 228, 0.7));
	line-height: 1.45;
}

.fiip-mail-consent input {
	margin-top: 0.2rem;
	accent-color: var(--fm-orange);
}

.fiip-mail-msg {
	min-height: 1.2em;
	margin: 0.85rem 0 0;
	font-size: 0.95rem;
	font-weight: 600;
}

.fiip-mail-msg.is-ok {
	color: var(--blue, #6fc9e8);
}

.fiip-mail-msg.is-error {
	color: var(--fm-orange);
}

.fiip-mail-form.is-loading .fiip-mail-submit {
	opacity: 0.6;
	pointer-events: none;
}

.fiip-mail-form.is-done .fiip-mail-fields,
.fiip-mail-form.is-done .fiip-mail-consent {
	display: none;
}

/* Screen-reader-only label. */
.fiip-mail-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 540px) {
	.fiip-mail-fields {
		border-radius: 16px;
		flex-direction: column;
		padding: 0.6rem;
	}
	.fiip-mail-submit {
		width: 100%;
	}
}
