/**
 * 悦灵 Forms Frontend Runtime — 前台动态表单展示样式。
 *
 * 仅作用于 .yg-form-embed / .yg-form 命名空间；不覆盖全局 input/textarea/select。
 *
 * @package YueGrowth
 */

.yg-form-embed {
	width: 100%;
	box-sizing: border-box;
	padding: 3.5rem 0 4rem;
	text-align: left;
}

.yg-form-embed > .container {
	width: 100%;
}

.yg-form-embed__head {
	margin-bottom: 1.25rem;
	text-align: center;
}

.yg-form-embed__title {
	margin: 0 0 0.5rem;
	font-size: var(--yg-font-size-h3, clamp(1.25rem, 2vw, 1.75rem));
	font-weight: var(--yg-font-weight-heading, 700);
	color: var(--yg-color-text-primary, #17211f);
	line-height: 1.35;
}

.yg-form-embed__desc {
	margin: 0;
	font-size: var(--yg-font-size-body, 1rem);
	color: var(--yg-color-text-secondary, #65726f);
	line-height: 1.6;
}

.yg-form-embed .lead-form.yg-form {
	position: relative;
	width: 100%;
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
	padding: 0;
	box-sizing: border-box;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.card-surface > .yg-form-embed,
.card-surface .yg-form-embed {
	padding-left: 0;
	padding-right: 0;
}

.yg-form-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	overflow: hidden !important;
}

.yg-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	text-align: left;
}

.yg-form-field,
.yg-form-field--label-top {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.yg-form-field--full {
	grid-column: 1 / -1;
}

.yg-form-field--half {
	grid-column: span 1;
}

.yg-form-field--label-left {
	display: grid;
	grid-template-columns: 130px minmax(0, 1fr);
	gap: 0.625rem 0.875rem;
	align-items: start;
}

.yg-form-field--label-left .yg-form-help {
	grid-column: 2;
}

.yg-form-field--label-hidden {
	position: relative;
}

.yg-form-field--label-hidden .yg-form-label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.yg-form-label {
	display: block;
	font-size: var(--yg-font-size-small, 0.875rem);
	font-weight: 600;
	color: var(--yg-color-text-primary, #17211f);
	line-height: 1.45;
}

.yg-form-required {
	margin-left: 0.125rem;
	color: var(--yg-color-danger, #ef4444);
	font-weight: 700;
}

.yg-form-help {
	margin: 0;
	font-size: var(--yg-font-size-small, 0.8125rem);
	color: var(--yg-color-text-muted, #8a9793);
	line-height: 1.5;
}

.yg-form input[type="text"],
.yg-form input[type="tel"],
.yg-form input[type="email"],
.yg-form input[type="url"],
.yg-form input[type="number"],
.yg-form input[type="search"],
.yg-form textarea,
.yg-form select {
	display: block;
	width: 100%;
	min-height: var(--yg-btn-height-md, 44px);
	padding: 0.625rem 0.875rem;
	box-sizing: border-box;
	font-size: var(--yg-font-size-body, 1rem);
	line-height: 1.45;
	color: var(--yg-color-text-primary, #17211f);
	background: var(--yg-color-surface, #fff);
	border: 1px solid var(--yg-color-border, #e4ece8);
	border-radius: var(--yg-radius-button, 12px);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yg-form textarea {
	min-height: 118px;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
	resize: vertical;
}

.yg-form select {
	appearance: none;
	padding-right: 2.25rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2365726f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 1rem 1rem;
	cursor: pointer;
}

.yg-form input::placeholder,
.yg-form textarea::placeholder {
	color: var(--yg-color-text-muted, #8a9793);
	opacity: 1;
}

.yg-form input:focus,
.yg-form textarea:focus,
.yg-form select:focus {
	outline: 0;
	border-color: var(--yg-color-primary, #18c7d4);
	box-shadow: 0 0 0 3px rgba(var(--yg-color-primary-rgb, 24, 199, 212), 0.15);
}

.yg-form-choices {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.yg-form-choice {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: var(--yg-font-size-body, 1rem);
	color: var(--yg-color-text-primary, #17211f);
	cursor: pointer;
}

.yg-form-choice input {
	width: auto;
	min-height: auto;
	margin-top: 0.2rem;
	flex-shrink: 0;
}

.yg-form-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	min-height: var(--yg-btn-height-md, 44px);
	margin: 20px auto 0;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.yg-lead-status {
	display: block;
	max-width: 36rem;
	margin: 1rem auto 0;
	padding: 0.625rem 0.875rem;
	font-size: var(--yg-font-size-small, 0.875rem);
	line-height: 1.5;
	text-align: center;
	border-radius: var(--yg-radius-button, 12px);
	border: 1px solid transparent;
}

.yg-lead-status[hidden] {
	display: none !important;
}

.yg-lead-status--info {
	color: var(--yg-color-text-primary, #17211f);
	background: var(--yg-color-info-soft, #f0fdfa);
	border-color: rgba(var(--yg-color-primary-rgb, 24, 199, 212), 0.25);
}

.yg-lead-status--success {
	color: #166534;
	background: var(--yg-color-success-soft, #ecfdf5);
	border-color: rgba(34, 197, 94, 0.28);
}

.yg-lead-status--error {
	color: #991b1b;
	background: var(--yg-color-danger-soft, #fef2f2);
	border-color: rgba(239, 68, 68, 0.28);
}

.cta-modal__form.yg-form {
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.cta-modal__form .yg-form-grid--modal,
.cta-modal__form .yg-form-grid {
	grid-template-columns: 1fr;
	gap: 12px;
}

.cta-modal__form .yg-form-field--half,
.cta-modal__form .yg-form-field--full {
	grid-column: 1 / -1;
}

.cta-modal__form .yg-lead-status {
	margin: 12px 0 0;
	max-width: none;
}

.site-footer__top {
	align-items: flex-start;
}

.site-footer__form {
	flex: 0 1 min(22rem, 100%);
	max-width: 22rem;
	max-height: min(23rem, 52vh);
	margin: 0;
	padding: 0 0.25rem 0 0;
	overflow: auto;
	scrollbar-gutter: stable;
	box-sizing: border-box;
}

.site-footer__form-title {
	margin: 0 0 0.625rem;
	font-size: var(--yg-font-size-sm, 0.875rem);
	font-weight: 600;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.96);
}

.site-footer__form-body.yg-form {
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.site-footer__form .yg-form-grid--footer {
	grid-template-columns: 1fr;
	gap: 0.625rem;
}

.site-footer__form .yg-form-label {
	font-size: var(--yg-font-size-xs, 0.8125rem);
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.86);
}

.site-footer__form .yg-form-help {
	font-size: var(--yg-font-size-xs, 0.75rem);
	color: rgba(255, 255, 255, 0.62);
}

.site-footer__form .yg-form input[type="text"],
.site-footer__form .yg-form input[type="tel"],
.site-footer__form .yg-form input[type="email"],
.site-footer__form .yg-form input[type="url"],
.site-footer__form .yg-form input[type="number"],
.site-footer__form .yg-form input[type="search"],
.site-footer__form .yg-form textarea,
.site-footer__form .yg-form select {
	min-height: 2.25rem;
	padding: 0.45rem 0.65rem;
	font-size: var(--yg-font-size-sm, 0.875rem);
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.16);
	border-radius: 0.5rem;
	color: #fff;
}

.site-footer__form .yg-form textarea {
	min-height: 5.25rem;
}

.site-footer__form .yg-form input::placeholder,
.site-footer__form .yg-form textarea::placeholder {
	color: rgba(255, 255, 255, 0.48);
}

.site-footer__form .yg-form-submit {
	min-height: 2.25rem;
	min-width: 6rem;
	margin: 0.75rem 0 0;
	padding: 0.45rem 1rem;
	font-size: var(--yg-font-size-sm, 0.875rem);
}

.site-footer__form .yg-lead-status {
	margin: 12px 0 0;
	text-align: left;
}

@media (max-width: 768px) {
	.yg-form-grid {
		grid-template-columns: 1fr;
	}

	.yg-form-field--half,
	.yg-form-field--full {
		grid-column: 1 / -1;
	}

	.yg-form-field--label-left {
		display: flex;
		flex-direction: column;
		gap: 0.375rem;
	}

	.yg-form-field--label-left .yg-form-help {
		grid-column: auto;
	}

	.site-footer__form .yg-form-grid--footer {
		grid-template-columns: 1fr;
	}

	.site-footer__form {
		flex-basis: 100%;
		max-width: 100%;
		max-height: none;
		overflow: visible;
	}
}
