/* =============================================================================
   Forms — inputs, textareas, selects, checkboxes, validation
   ========================================================================== */

.wt-form {
	display: block;
	width: 100%;
}

.wt-form-field {
	margin-bottom: var(--wt-stack-lg);
}

.wt-form-label {
	display: block;
	font-family: var(--wt-font-body);
	font-size: 14px;
	font-weight: var(--wt-fw-semibold);
	color: var(--wt-on-surface);
	margin-bottom: var(--wt-stack-sm);
}

.wt-form-required {
	color: var(--wt-error);
	margin-left: 4px;
}

.wt-form-input,
.wt-form-select,
.wt-form-textarea {
	display: block;
	width: 100%;
	padding: 14px 16px;
	font-family: var(--wt-font-body);
	font-size: var(--wt-fs-body-md);
	line-height: var(--wt-lh-body);
	color: var(--wt-on-surface);
	background: var(--wt-surface-container-lowest);
	border: 1.5px solid var(--wt-outline-variant);
	border-radius: var(--wt-radius-lg);
	transition: border-color var(--wt-transition-fast), box-shadow var(--wt-transition-fast);
	-webkit-appearance: none;
	appearance: none;
}

.wt-form-input::placeholder,
.wt-form-textarea::placeholder {
	color: var(--wt-outline);
}

.wt-form-input:focus,
.wt-form-select:focus,
.wt-form-textarea:focus {
	border-color: var(--wt-primary);
	outline: var(--wt-focus-ring-width) solid var(--wt-focus-ring-color);
	outline-offset: var(--wt-focus-ring-offset);
}

.wt-form-textarea {
	min-height: 140px;
	resize: vertical;
}

.wt-form-select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg viewBox='0 0 24 24' fill='%23444653' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 22px;
	padding-right: 44px;
}

/* Checkbox */
.wt-form-checkbox {
	display: inline-flex;
	align-items: flex-start;
	gap: var(--wt-stack-sm);
	cursor: pointer;
	font-size: 14px;
	color: var(--wt-on-surface-variant);
	line-height: var(--wt-lh-body);
}
.wt-form-checkbox input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	border: 1.5px solid var(--wt-outline);
	border-radius: 4px;
	background: var(--wt-surface-container-lowest);
	cursor: pointer;
	position: relative;
	margin-top: 2px;
	transition: all var(--wt-transition-fast);
}
.wt-form-checkbox input[type="checkbox"]:checked {
	background: var(--wt-primary);
	border-color: var(--wt-primary);
}
.wt-form-checkbox input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

/* Validation */
.wt-form-field.is-error .wt-form-input,
.wt-form-field.is-error .wt-form-select,
.wt-form-field.is-error .wt-form-textarea {
	border-color: var(--wt-error);
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg viewBox='0 0 24 24' fill='%23ba1a1a' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15h2v2h-2v-2zm0-8h2v6h-2V9z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 22px;
	padding-right: 44px;
}

.wt-form-error {
	display: block;
	font-size: 13px;
	color: var(--wt-error);
	margin-top: var(--wt-stack-xs);
	font-weight: var(--wt-fw-medium);
}

/* Success card (contact form submitted) */
.wt-form-success {
	background: var(--wt-surface-container-low);
	border: 1px solid var(--wt-primary-fixed);
	border-radius: var(--wt-radius-xl);
	padding: var(--wt-stack-xl);
	text-align: center;
}
.wt-form-success .wt-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	background: var(--wt-primary);
	color: #fff;
	border-radius: 50%;
	font-size: 40px;
	margin: 0 auto var(--wt-stack-md);
}
.wt-form-success h3 {
	color: var(--wt-primary);
	margin-bottom: var(--wt-stack-sm);
}
.wt-form-success .wt-reference {
	font-family: var(--wt-font-display);
	font-weight: var(--wt-fw-semibold);
	color: var(--wt-on-surface-variant);
	margin-bottom: var(--wt-stack-lg);
}

/* Global error banner */
.wt-form-banner-error {
	background: var(--wt-error-container);
	color: var(--wt-on-error-container);
	padding: var(--wt-stack-md);
	border-radius: var(--wt-radius-lg);
	margin-bottom: var(--wt-stack-lg);
	font-weight: var(--wt-fw-medium);
}

/* Grid rows for two-col fields */
.wt-form-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wt-stack-md);
}
@media (max-width: 640px) {
	.wt-form-row-2 { grid-template-columns: 1fr; }
}
