/**
 * Clavé contact form.
 *
 * Inherits the theme's existing identity rather than introducing a new one:
 * the same sage greens, Playfair for the heading, Dancing Script reserved for
 * the brand accent, Lato for everything else. Sized to sit inside the contact
 * page's .contact-flex-box-single column alongside the existing details.
 *
 * All selectors are prefixed .clave-contact so nothing leaks into the rest of
 * the site, and the theme's global `* { margin: 0 }` reset is accounted for
 * rather than assumed away.
 */

.clave-contact {
	--cc-green: var(--header-green, #709663);
	--cc-green-soft: var(--primary-green, #9ab596);
	--cc-ink: var(--text-dark, #333);
	--cc-muted: var(--text-gray, #666);
	--cc-cream: var(--bg-cream, #f4f4f4);
	--cc-line: #e0e4de;
	--cc-error: #b4483c;

	font-family: var(--font-sans, "Lato", sans-serif);
	color: var(--cc-ink);
	max-width: 640px;
	text-align: left;
}

/* --- Headings ---------------------------------------------------------- */

.clave-contact__heading {
	font-family: var(--font-serif, "Playfair Display", serif);
	font-size: 2rem;
	font-weight: 600;
	color: var(--cc-green);
	margin: 0 0 10px;
	line-height: 1.2;
}

.clave-contact__intro {
	margin: 0 0 26px;
	font-size: 0.95rem;
	color: var(--cc-muted);
	line-height: 1.6;
}

/* --- Layout ------------------------------------------------------------ */

.clave-contact__form {
	display: block;
}

.clave-contact__row {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}

.clave-contact__row > .clave-contact__field {
	flex: 1 1 220px;
	min-width: 0; /* lets flex children actually shrink */
}

.clave-contact__field {
	margin-bottom: 18px;
}

/* --- Labels ------------------------------------------------------------ */

.clave-contact__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--cc-muted);
}

.clave-contact__req {
	color: var(--cc-green-soft);
	margin-left: 2px;
}

.clave-contact__optional {
	margin-left: 4px;
	font-weight: 400;
	letter-spacing: 0.4px;
	text-transform: none;
	color: #a3a9a0;
	font-size: 0.7rem;
}

/* --- Inputs ------------------------------------------------------------ */

.clave-contact__input {
	display: block;
	width: 100%;
	padding: 13px 14px;

	font-family: inherit;
	font-size: 0.95rem;
	color: var(--cc-ink);
	line-height: 1.5;

	background: #fbfcfa;
	border: 1px solid var(--cc-line);
	border-radius: 2px;

	transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.clave-contact__input::placeholder {
	color: #aeb4ab;
}

.clave-contact__input:focus {
	outline: none;
	background: #fff;
	border-color: var(--cc-green-soft);
	box-shadow: 0 0 0 3px rgba(154, 181, 150, 0.26);
}

.clave-contact__input.has-error {
	border-color: var(--cc-error);
	background: #fdf7f6;
}

.clave-contact__textarea {
	resize: vertical;
	min-height: 150px;
}

/* Native select arrow removed above, so draw one back in. */
.clave-contact__select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23709663' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 11px;
	padding-right: 38px;
	cursor: pointer;
}

/* --- Character count --------------------------------------------------- */

.clave-contact__count {
	margin: 6px 0 0;
	font-size: 0.7rem;
	color: #a3a9a0;
	text-align: right;
}

.clave-contact__count.is-near {
	color: var(--cc-error);
}

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

.clave-contact__consent {
	margin-top: 4px;
}

.clave-contact__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--cc-muted);
	cursor: pointer;
}

.clave-contact__checkbox input {
	margin-top: 3px;
	width: 16px;
	height: 16px;
	accent-color: var(--cc-green);
	flex: 0 0 auto;
}

/* --- Errors ------------------------------------------------------------ */

.clave-contact__error {
	margin: 6px 0 0;
	font-size: 0.78rem;
	color: var(--cc-error);
	min-height: 0;
}

.clave-contact__error:empty {
	display: none;
}

/* --- Honeypot ---------------------------------------------------------- */

.clave-contact__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* --- Actions ----------------------------------------------------------- */

.clave-contact__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 22px;
}

/* Mirrors the theme's .btn so the form reads as part of the site. */
.clave-contact__submit {
	display: inline-block;
	background-color: #7b9e76;
	color: #fff;
	padding: 14px 35px;
	text-transform: uppercase;
	font-family: inherit;
	font-size: 0.8rem;
	letter-spacing: 1px;
	font-weight: 700;
	border: none;
	border-radius: 0;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.clave-contact__submit:hover {
	opacity: 0.9;
}

.clave-contact__submit[disabled] {
	opacity: 0.55;
	cursor: default;
}

.clave-contact__status {
	margin: 0;
	font-size: 0.85rem;
}

.clave-contact__status.is-error {
	color: var(--cc-error);
}

.clave-contact__status.is-success {
	color: var(--cc-green);
	font-weight: 700;
}

/* --- Sent state -------------------------------------------------------- */

.clave-contact.is-sent .clave-contact__form {
	display: none;
}

.clave-contact__sent {
	padding: 28px 26px;
	background: var(--cc-cream);
	border-left: 3px solid var(--cc-green);
}

.clave-contact__sent-title {
	font-family: var(--font-script, "Dancing Script", cursive);
	font-size: 1.9rem;
	color: var(--cc-green);
	margin: 0 0 6px;
	line-height: 1.1;
}

.clave-contact__sent-body {
	margin: 0;
	color: var(--cc-muted);
	font-size: 0.95rem;
}

/* --- Focus visibility -------------------------------------------------- */

.clave-contact :focus-visible {
	outline: 2px solid var(--cc-green);
	outline-offset: 2px;
}

/* --- Narrow screens ---------------------------------------------------- */

@media (max-width: 640px) {
	.clave-contact__row {
		display: block;
	}

	.clave-contact__heading {
		font-size: 1.65rem;
	}

	.clave-contact__submit {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.clave-contact__input,
	.clave-contact__submit {
		transition: none;
	}
}
