/**
 * Hypermedia Forms — estilos do front-end.
 *
 * Filosofia: herdar o máximo possível do tema.
 *  - font-family: inherit  → usa a fonte do tema.
 *  - --hf-accent           → cor do botão; por padrão tenta cores comuns do tema.
 *  - O restante usa currentColor e tons neutros derivados, sem "brigar" com o tema.
 */

.hf-wrap {
	/* Cor de destaque: herda de variáveis comuns de temas; cai para um tom escuro elegante. */
	--hf-accent: var(--wp--preset--color--primary, var(--e-global-color-primary, var(--theme-palette-color-1, #16321f)));
	--hf-accent-contrast: #ffffff;
	--hf-radius: 14px;
	--hf-border: color-mix(in srgb, currentColor 18%, transparent);
	--hf-border-focus: var(--hf-accent);
	--hf-field-bg: color-mix(in srgb, currentColor 3%, transparent);
	--hf-label: color-mix(in srgb, currentColor 85%, transparent);
	--hf-placeholder: color-mix(in srgb, currentColor 45%, transparent);
	--hf-gap: 18px;

	font-family: inherit;
	max-width: 640px;
	margin: 0 auto;
	width: 100%;
}

/* Fallback para navegadores sem color-mix. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.hf-wrap {
		--hf-border: rgba(0, 0, 0, .14);
		--hf-field-bg: rgba(0, 0, 0, .02);
		--hf-label: currentColor;
		--hf-placeholder: rgba(0, 0, 0, .4);
	}
}

.hf-form {
	font-family: inherit;
	color: inherit;
}

.hf-title {
	font-family: inherit;
	font-size: 1.5em;
	line-height: 1.2;
	margin: 0 0 6px;
	color: inherit;
}

.hf-subtitle {
	font-family: inherit;
	margin: 0 0 20px;
	opacity: .75;
	font-size: .95em;
}

.hf-fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hf-gap);
}

.hf-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	flex: 1 1 100%;
	min-width: 0;
}

/* Larguras (modo grid). No modo empilhado, tudo vira 100%. */
.hf-layout-grid .hf-w-half {
	flex: 1 1 calc(50% - var(--hf-gap));
}

.hf-label {
	font-family: inherit;
	font-weight: 600;
	font-size: .9em;
	color: var(--hf-label);
	line-height: 1.3;
}

.hf-req {
	color: var(--hf-accent);
}

.hf-input {
	font-family: inherit;
	font-size: 1em;
	color: inherit;
	width: 100%;
	box-sizing: border-box;
	padding: 13px 16px;
	background: var(--hf-field-bg);
	border: 1.5px solid var(--hf-border);
	border-radius: var(--hf-radius);
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
}

.hf-textarea {
	resize: vertical;
	min-height: 130px;
}

.hf-input::placeholder {
	color: var(--hf-placeholder);
	opacity: 1;
}

.hf-input:focus {
	outline: none;
	border-color: var(--hf-border-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--hf-accent) 18%, transparent);
	background: transparent;
}

.hf-select {
	cursor: pointer;
	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 d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 40px;
}

/* Choices (radio/checkbox) */
.hf-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 2px;
}

.hf-choice {
	display: flex;
	align-items: center;
	gap: 9px;
	cursor: pointer;
	font-size: .95em;
	line-height: 1.3;
}

.hf-choice input {
	width: 17px;
	height: 17px;
	accent-color: var(--hf-accent);
	margin: 0;
	flex-shrink: 0;
}

/* Botão */
.hf-actions {
	margin-top: 24px;
}

.hf-submit {
	font-family: inherit;
	font-weight: 700;
	font-size: 1.02em;
	color: var(--hf-accent-contrast);
	background: var(--hf-accent);
	border: none;
	border-radius: var(--hf-radius);
	padding: 16px 28px;
	width: 100%;
	cursor: pointer;
	transition: transform .12s ease, filter .18s ease, box-shadow .18s ease;
	line-height: 1.2;
	letter-spacing: .01em;
}

.hf-submit:hover {
	filter: brightness(1.08);
	box-shadow: 0 8px 24px -10px var(--hf-accent);
}

.hf-submit:active {
	transform: translateY(1px);
}

.hf-submit[disabled] {
	opacity: .6;
	cursor: progress;
}

.hf-submit.hf-loading .hf-submit-label {
	opacity: .6;
}

/* Mensagens */
.hf-message {
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: var(--hf-radius);
	font-size: .95em;
	line-height: 1.4;
}

.hf-message--success {
	background: color-mix(in srgb, #1a9d55 12%, transparent);
	border: 1.5px solid color-mix(in srgb, #1a9d55 40%, transparent);
	color: inherit;
}

.hf-message--error {
	background: color-mix(in srgb, #d64545 10%, transparent);
	border: 1.5px solid color-mix(in srgb, #d64545 45%, transparent);
	color: inherit;
}

.hf-wa-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 20px;
	background: #25d366;
	color: #fff;
	border-radius: var(--hf-radius);
	text-decoration: none;
	font-weight: 700;
}

.hf-wa-cta:hover {
	filter: brightness(1.05);
	color: #fff;
}

/* Honeypot */
.hf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Responsivo */
@media (max-width: 600px) {
	.hf-layout-grid .hf-w-half {
		flex: 1 1 100%;
	}
}

/* =====================================================================
 * Tela de confirmação de envio
 * ================================================================== */

.hf-confirmation {
	text-align: center;
	padding: 40px 24px;
	border: 1.5px solid color-mix(in srgb, #1a9d55 32%, transparent);
	background: color-mix(in srgb, #1a9d55 7%, transparent);
	border-radius: var(--hf-radius);
}

/* Fallback sem color-mix. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.hf-confirmation {
		border-color: rgba(26, 157, 85, .35);
		background: rgba(26, 157, 85, .06);
	}
}

.hf-confirmation-inner {
	max-width: 460px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.hf-confirmation-title {
	font-family: inherit;
	font-size: 1.35em;
	line-height: 1.25;
	margin: 6px 0 0;
	color: inherit;
}

.hf-confirmation-text {
	font-family: inherit;
	margin: 0;
	opacity: .85;
	font-size: 1em;
	line-height: 1.5;
}

.hf-confirmation-actions:empty {
	display: none;
}

.hf-confirmation-actions {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

/* Botão de ação — usa a cor de destaque do tema. */
.hf-action-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 22px;
	background: var(--hf-accent);
	color: var(--hf-accent-contrast, #fff);
	border-radius: var(--hf-radius);
	text-decoration: none;
	font-family: inherit;
	font-weight: 700;
	transition: filter .15s ease;
}

.hf-action-cta:hover {
	filter: brightness(1.06);
	color: var(--hf-accent-contrast, #fff);
}

.hf-confirmation-again {
	font-family: inherit;
	margin-top: 8px;
	background: none;
	border: none;
	padding: 6px 4px;
	cursor: pointer;
	font-size: .92em;
	font-weight: 600;
	color: var(--hf-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	opacity: .85;
	transition: opacity .15s ease;
}

.hf-confirmation-again:hover {
	opacity: 1;
}

/* Check animado */
.hf-check {
	width: 68px;
	height: 68px;
}

.hf-check svg {
	width: 100%;
	height: 100%;
	display: block;
}

.hf-check-circle {
	stroke: #1a9d55;
	stroke-width: 2.5;
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
}

.hf-check-mark {
	stroke: #1a9d55;
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
}

.hf-confirmation--in .hf-check-circle {
	animation: hf-draw .5s ease forwards;
}

.hf-confirmation--in .hf-check-mark {
	animation: hf-draw .35s .42s ease forwards;
}

.hf-confirmation--in .hf-confirmation-inner > * {
	animation: hf-rise .45s .2s both ease;
}

@keyframes hf-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes hf-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hf-confirmation--in .hf-check-circle,
	.hf-confirmation--in .hf-check-mark,
	.hf-confirmation--in .hf-confirmation-inner > * {
		animation: none;
	}
	.hf-check-circle,
	.hf-check-mark { stroke-dashoffset: 0; }
}

/* =====================================================================
 * Campo de CEP — indicador de carregamento durante a busca
 * ================================================================== */

.hf-input.hf-cep-loading {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M12 2a10 10 0 0 1 10 10h-2a8 8 0 0 0-8-8V2z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 44px;
}
