/**
 * Listing Form widget styles.
 *
 * @package ThemeREX\AutoDealer
 */

.trx-ad-form {
	margin: 24px 0;
}

.trx-ad-form__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.trx-ad-form__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.trx-ad-form__field--w100 { width: 100%; }
.trx-ad-form__field--w50 { width: calc(50% - 8px); }
.trx-ad-form__field--w33 { width: calc(33.333% - 11px); }
.trx-ad-form__field--w25 { width: calc(25% - 12px); }

.trx-ad-form__label {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}

.trx-ad-form__required {
	color: #dc2626;
}

.trx-ad-form__input,
.trx-ad-form__select,
.trx-ad-form__textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	color: #1f2937;
	background: #fff;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.trx-ad-form__input:focus,
.trx-ad-form__select:focus,
.trx-ad-form__textarea:focus {
	outline: none;
	border-color: var(--trx-ad-color-primary, #2563eb);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.trx-ad-form__input.trx-ad-form__input--error,
.trx-ad-form__select.trx-ad-form__input--error,
.trx-ad-form__textarea.trx-ad-form__input--error {
	border-color: #dc2626;
}

.trx-ad-form__textarea {
	resize: vertical;
	min-height: 100px;
}

.trx-ad-form__checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.trx-ad-form__footer {
	margin-top: 20px;
}

.trx-ad-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	background: var(--trx-ad-color-primary, #2563eb);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.trx-ad-form__submit:hover {
	background: var(--trx-ad-color-primary-hover, #1d4ed8);
}

.trx-ad-form__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.trx-ad-form__submit--loading::after {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: trx-ad-spin 0.6s linear infinite;
}

@keyframes trx-ad-spin {
	to { transform: rotate(360deg); }
}

/* Messages */
.trx-ad-form__message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
}

.trx-ad-form__message--success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.trx-ad-form__message--error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 600px) {
	.trx-ad-form__field--w50,
	.trx-ad-form__field--w33,
	.trx-ad-form__field--w25 {
		width: 100%;
	}
}
