/*
 * Glix Forms — front end.
 *
 * Every rule starts at .wpu-form-wrap so theme and Elementor kit styles can't
 * restyle the fields. "Modern" styles the fields and button; "Theme" (WpUtilities
 * → Forms → Settings) keeps only the layout, so the theme's own field styles apply.
 */

.wpu-form-wrap {
	--wpu-form-accent: #4f46e5;
	--wpu-form-text: #1f2937;
	--wpu-form-muted: #6b7280;
	--wpu-form-border: #d1d5db;
	--wpu-form-error: #dc2626;
	--wpu-form-radius: 8px;
	margin: 0 0 1.5em;
	scroll-margin-top: 100px;
}
.wpu-form-wrap *,
.wpu-form-wrap *::before,
.wpu-form-wrap *::after {
	box-sizing: border-box;
}
.wpu-form-wrap .wpu-form {
	position: relative;
	margin: 0;
	padding: 0;
}
.wpu-form-wrap .wpu-form__title {
	margin: 0 0 0.35em;
}
.wpu-form-wrap .wpu-form__desc {
	margin: 0 0 1.2em;
	color: var(--wpu-form-muted);
}
.wpu-form-wrap .wpu-form__desc p {
	margin: 0 0 0.6em;
}

/* Layout: a 6-column grid; fields span all, half or a third of it. */
.wpu-form-wrap .wpu-form__fields {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 18px 16px;
}
.wpu-form-wrap .wpu-field {
	grid-column: span 6;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.wpu-form-wrap .wpu-field--w-half {
	grid-column: span 3;
}
.wpu-form-wrap .wpu-field--w-third {
	grid-column: span 2;
}
@media (max-width: 600px) {
	.wpu-form-wrap .wpu-field--w-half,
	.wpu-form-wrap .wpu-field--w-third {
		grid-column: span 6;
	}
}
.wpu-form-wrap .wpu-field[hidden],
.wpu-form-wrap .wpu-field--hidden {
	display: none !important;
}
.wpu-form-wrap fieldset.wpu-field {
	min-inline-size: 0;
}

.wpu-form-wrap .wpu-field__label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}
.wpu-form-wrap legend.wpu-field__label {
	float: left;
	width: 100%;
}
.wpu-form-wrap .wpu-field__req {
	color: var(--wpu-form-error);
}
.wpu-form-wrap .wpu-field__help,
.wpu-form-wrap .wpu-field__hint {
	margin: 6px 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	color: var(--wpu-form-muted);
}
.wpu-form-wrap .wpu-field__error {
	margin: 6px 0 0;
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1.45;
	color: var(--wpu-form-error);
}
.wpu-form-wrap .wpu-field__error[hidden] {
	display: none;
}
.wpu-form-wrap .wpu-sr,
.wpu-form-wrap .wpu-form__hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.wpu-form-wrap .wpu-form__hp {
	left: -10000px;
}

/* Choices */
.wpu-form-wrap .wpu-field__choices {
	clear: both;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.wpu-form-wrap .wpu-field__choices.is-inline {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px 22px;
}
.wpu-form-wrap .wpu-choice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}
.wpu-form-wrap .wpu-choice input {
	flex: none;
	margin: 3px 0 0;
}
.wpu-form-wrap .wpu-choice a {
	color: var(--wpu-form-accent);
}

/* Layout blocks */
.wpu-form-wrap .wpu-field--html > :first-child {
	margin-top: 0;
}
.wpu-form-wrap .wpu-field--html > :last-child {
	margin-bottom: 0;
}
.wpu-form-wrap .wpu-field--divider {
	padding-top: 14px;
	border-top: 1px solid #e5e7eb;
}
.wpu-form-wrap .wpu-divider__title {
	margin: 0 0 4px;
	font-size: 1.1em;
}
.wpu-form-wrap .wpu-divider__text {
	margin: 0;
	color: var(--wpu-form-muted);
}

.wpu-form-wrap .wpu-form__captcha {
	margin-top: 18px;
}
.wpu-form-wrap .wpu-form__footer {
	margin-top: 22px;
}

/* Messages */
.wpu-form-wrap .wpu-form__message {
	margin: 0 0 16px;
	padding: 14px 16px;
	border: 1px solid;
	border-radius: var(--wpu-form-radius);
	line-height: 1.55;
	outline: none;
}
.wpu-form-wrap .wpu-form__message p {
	margin: 0 0 0.6em;
}
.wpu-form-wrap .wpu-form__message p:last-child {
	margin-bottom: 0;
}
.wpu-form-wrap .wpu-form__message.is-success {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #065f46;
}
.wpu-form-wrap .wpu-form__message.is-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}
.wpu-form-wrap .wpu-form__message.is-info {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #1e3a8a;
}
.wpu-form-wrap .wpu-form__status {
	margin-top: 14px;
	font-size: 0.95em;
}
.wpu-form-wrap .wpu-form__status:empty {
	display: none;
}
.wpu-form-wrap .wpu-form__status.is-error {
	color: var(--wpu-form-error);
	font-weight: 500;
}

/* Submit button: spinner shown while sending */
.wpu-form-wrap .wpu-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
.wpu-form-wrap .wpu-form__submit:disabled {
	cursor: progress;
	opacity: 0.75;
}
.wpu-form-wrap .wpu-form__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wpu-form-spin 0.7s linear infinite;
}
.wpu-form-wrap .wpu-form__submit.is-busy .wpu-form__spinner {
	display: inline-block;
}
@keyframes wpu-form-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Theme style: fields fill their column, the theme does the rest. */
.wpu-form-wrap.is-theme .wpu-input {
	width: 100%;
	max-width: 100%;
}

/* ── Modern style ─────────────────────────────────────────────────────── */

.wpu-form-wrap.is-modern {
	color: var(--wpu-form-text);
}
.wpu-form-wrap.is-modern .wpu-input {
	display: block;
	width: 100%;
	max-width: none;
	min-height: 46px;
	margin: 0;
	padding: 11px 13px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: var(--wpu-form-text);
	background: #fff;
	border: 1px solid var(--wpu-form-border);
	border-radius: var(--wpu-form-radius);
	box-shadow: none;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.wpu-form-wrap.is-modern .wpu-input::placeholder {
	color: #9ca3af;
	opacity: 1;
}
.wpu-form-wrap.is-modern .wpu-input:hover {
	border-color: #9ca3af;
}
.wpu-form-wrap.is-modern .wpu-input:focus {
	border-color: var(--wpu-form-accent);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpu-form-accent) 20%, transparent);
}
.wpu-form-wrap.is-modern .wpu-textarea {
	min-height: 120px;
	resize: vertical;
}
.wpu-form-wrap.is-modern .wpu-select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
	cursor: pointer;
}
.wpu-form-wrap.is-modern .wpu-file {
	padding: 10px;
	background: #f9fafb;
	border-style: dashed;
	cursor: pointer;
}
.wpu-form-wrap.is-modern .has-error .wpu-input {
	border-color: var(--wpu-form-error);
}
.wpu-form-wrap.is-modern .has-error .wpu-input:focus {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}
.wpu-form-wrap.is-modern .wpu-choice input {
	width: 18px;
	height: 18px;
	accent-color: var(--wpu-form-accent);
}
.wpu-form-wrap.is-modern .wpu-form__submit,
.wpu-form-wrap.is-modern .wpu-form__submit:hover,
.wpu-form-wrap.is-modern .wpu-form__submit:focus {
	min-height: 48px;
	margin: 0;
	padding: 12px 28px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	color: #fff;
	background: var(--wpu-form-accent);
	border: 0;
	border-radius: var(--wpu-form-radius);
	box-shadow: none;
	cursor: pointer;
	transition: filter 0.15s, transform 0.05s;
}
.wpu-form-wrap.is-modern .wpu-form__submit:hover:not(:disabled) {
	filter: brightness(0.92);
}
.wpu-form-wrap.is-modern .wpu-form__submit:active:not(:disabled) {
	transform: translateY(1px);
}
.wpu-form-wrap.is-modern .wpu-form__submit:focus-visible {
	outline: 3px solid rgba(79, 70, 229, 0.35);
	outline: 3px solid color-mix(in srgb, var(--wpu-form-accent) 40%, transparent);
	outline-offset: 2px;
}
.wpu-form-wrap.is-modern .wpu-form__submit:disabled {
	cursor: progress;
	opacity: 0.75;
}
