/*
 * Health365 – bieu mau (khoi health365/quote-form): Yeu cau bao gia (Mau 8, Mau 14), Lien he, Gop y.
 * Nap theo khoi (block.json "style"): chi co o trang co bieu mau.
 * Mau chi dung bien --wp--preset--color--* (D-024). Diem gay: 782px (781px trong media query) va 480px.
 * Ban toi (mac dinh, Mau 8): nen contrast, chu base. Ban sang (tone light): nen surface.
 */

.h365-form-section {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem;
	box-sizing: border-box;
	margin-block-start: 3.5rem;
	padding: 3rem;
	border-radius: var(--wp--custom--radius--large);
	scroll-margin-top: 1.5rem;
}

.h365-form-section--dark {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.h365-form-section--light {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.h365-form-section--dark :focus-visible {
	outline-color: var(--wp--preset--color--accent);
}

.h365-form-section__intro {
	display: flex;
	flex: 1 1 18.75rem;
	flex-direction: column;
	gap: 0.875rem;
}

.h365-form-section__intro > * {
	margin: 0;
}

.h365-form-section__eyebrow {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: var(--wp--custom--tracking--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.h365-form-section--dark .h365-form-section__eyebrow {
	color: var(--wp--preset--color--accent);
}

.h365-form-section__title {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.15;
	letter-spacing: -0.8px;
	color: inherit;
}

.h365-form-section__lead {
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--wp--preset--color--body);
}

.h365-form-section--dark .h365-form-section__lead {
	color: var(--wp--preset--color--on-dark);
}

/* ---------- Bieu mau ---------- */
.h365-form {
	display: grid;
	flex: 1 1 27.5rem;
	grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
	gap: 1rem;
	align-content: start;
	min-width: 0;
}

.h365-form.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

.h365-form__status {
	grid-column: 1 / -1;
}

.h365-form__status:empty {
	display: none;
}

.h365-form__status.is-ok,
.h365-form__status.is-error {
	padding: 0.875rem 1rem;
	border-radius: 0.75rem;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
}

.h365-form__status.is-ok {
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--contrast);
}

.h365-form__status.is-error {
	border: var(--wp--custom--border-width) solid var(--wp--preset--color--accent);
}

/* Bay honeypot: an khoi nguoi dung va trinh doc man hinh (aria-hidden), bot van thay o nhap. */
.h365-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

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

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

.h365-field__label {
	font-size: 0.8125rem;
	font-weight: 600;
}

.h365-field__req {
	color: var(--wp--preset--color--accent);
}

.h365-form-section--light .h365-field__req {
	color: var(--wp--preset--color--primary);
}

.h365-field input:not([type="checkbox"]),
.h365-field select,
.h365-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--wp--custom--touch-target);
	padding: 0.875rem 1rem;
	border: var(--wp--custom--border-width) solid var(--wp--preset--color--line-dark);
	border-radius: 0.75rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 0.9375rem;
}

.h365-form-section--light .h365-field input:not([type="checkbox"]),
.h365-form-section--light .h365-field select,
.h365-form-section--light .h365-field textarea {
	border-color: var(--wp--preset--color--border);
}

.h365-field textarea {
	resize: vertical;
}

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

.h365-field__help {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--muted);
}

.h365-form-section--dark .h365-field__help {
	color: var(--wp--preset--color--on-dark);
}

/* Loi khong chi dua vao mau: co tien to "Loi:" va vien trai. */
.h365-field__error {
	grid-column: 1 / -1;
	margin: 0;
	padding-left: 0.625rem;
	border-left: 3px solid var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.5;
}

.h365-form-section--dark .h365-field__error {
	color: var(--wp--preset--color--accent);
}

.h365-field__check {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	min-height: var(--wp--custom--touch-target);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.h365-form-section--dark .h365-field__check {
	color: var(--wp--preset--color--on-dark);
}

.h365-field__check input {
	flex: 0 0 auto;
	width: 1.375rem;
	height: 1.375rem;
	margin: 0;
	accent-color: var(--wp--preset--color--accent);
}

.h365-field__check a {
	color: inherit;
	text-decoration: underline;
}

.h365-form__actions {
	flex-direction: row;
}

.h365-form__submit {
	padding: 1rem 2rem;
	border: 0;
	font-size: 1rem;
	font-weight: 700;
}

/* ---------- Dien thoai, may tinh bang (Mau 14) ---------- */
@media (max-width: 781px) {
	.h365-form-section {
		flex-direction: column;
		gap: 1.5rem;
		margin-block-start: 2.5rem;
		padding: 1.75rem 1.375rem;
		border-radius: var(--wp--custom--radius--medium);
	}

	.h365-form-section__intro,
	.h365-form {
		flex: 0 0 auto;
	}

	.h365-form-section__title {
		font-size: 1.5rem;
		line-height: 1.2;
		letter-spacing: var(--wp--custom--tracking--tight);
	}

	.h365-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.h365-form__submit {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.h365-form-section {
		padding: 1.5rem 1rem;
	}

	.h365-field input:not([type="checkbox"]),
	.h365-field select,
	.h365-field textarea {
		font-size: 1rem; /* iOS khong tu phong to khi o nhap tu 16px. */
	}
}
