/**
 * Shared Form Engine Front-End Styles.
 */

/* ─── Form Container ─────────────────────────────────────────────────── */

.raqmyn-form {
}

/* ─── Submit Loading ──────────────────────────────────────────────────── */

.raqmyn-form__submit-loading {
	display: none;
}

/* ─── Messages ───────────────────────────────────────────────────────── */

.raqmyn-form__message {
	display: none;
}

/* ─── Field Grid ─────────────────────────────────────────────────────── */

.raqmyn-form__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	border: none;
	padding: 0;
	margin: 0;
}

.raqmyn-form__legend {
	border: none;
	padding: 0;
	margin: 0;
}

.raqmyn-form__field--full {
	grid-column: 1 / -1;
}

/* ─── reCAPTCHA ─────────────────────────────────────────────────────── */

.raqmyn-form__recaptcha {
	margin: 16px 0;
	display: flex;
	justify-content: flex-start;
}

.raqmyn-form__recaptcha-error {
	color: #dc2626;
	font-size: 14px;
	margin-top: 8px;
	display: none;
}

[dir="rtl"] .raqmyn-form__recaptcha {
	justify-content: flex-end;
}

@media (max-width: 640px) {
	.raqmyn-form__fields {
		grid-template-columns: 1fr;
	}
	.raqmyn-form__field--half {
		grid-column: 1 / -1;
	}
}

/* ─── Labels ─────────────────────────────────────────────────────────── */

.raqmyn-form__label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-text, #001f27);
	margin-bottom: 6px;
}

.raqmyn-form__required {
	color: #ef4444;
	margin-right: 4px;
}

/* ─── Inputs ─────────────────────────────────────────────────────────── */

.raqmyn-form__input,
.raqmyn-form__textarea,
.raqmyn-form__select {
	width: 100%;
	padding: 1rem 1.25rem;
	background-color: rgba(var(--color-surface-highest-rgb, 242, 251, 255), 0.4);
	border: none;
	border-radius: var(--radius-md, 12px);
	font-size: 1rem;
	color: var(--color-text, #001f27);
	font-family: inherit;
	direction: rtl;
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.raqmyn-form__input::placeholder,
.raqmyn-form__textarea::placeholder {
	color: var(--color-on-surface-variant, #475569);
	opacity: 0.7;
}

.raqmyn-form__input:focus,
.raqmyn-form__textarea:focus,
.raqmyn-form__select:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(var(--color-brand-rgb, 15, 111, 132), 0.2);
	background-color: #fff;
}

.raqmyn-form__input:focus-visible,
.raqmyn-form__textarea:focus-visible,
.raqmyn-form__select:focus-visible {
	outline: 2px solid var(--color-brand, #0f6f84);
	outline-offset: 2px;
}

/* Date/Time specific */
.raqmyn-form__input--date,
.raqmyn-form__input--time {
	cursor: pointer;
}

.raqmyn-form__select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8.5L1.5 4h9L6 8.5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	padding-left: 36px;
	cursor: pointer;
}

/* ─── Textarea ─────────────────────────────────────────────────────────── */

.raqmyn-form__textarea {
	resize: none;
	min-height: 130px;
}

/* ─── Error Messages ──────────────────────────────────────────────────── */

.raqmyn-form__error {
	display: none;
	font-size: 0.8rem;
	color: #ef4444;
	margin-top: 4px;
}

.raqmyn-form__error.is-visible {
	display: block;
}

/* ─── Submit Button ──────────────────────────────────────────────────── */

.raqmyn-form__footer {
	margin-top: 24px;
}

.raqmyn-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 1.25rem;
	background: linear-gradient(to left, var(--color-brand, #0f6f84) 0%, var(--color-primary-container, #bdeafa) 100%);
	color: #fff;
	border: none;
	border-radius: var(--radius-full, 999px);
	font-size: 1.125rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	width: 100%;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 20px rgba(var(--color-brand-rgb, 15, 111, 132), 0.25);
}

.raqmyn-form__submit:hover:not(:disabled) {
	transform: scale(1.02);
	box-shadow: 0 6px 25px rgba(var(--color-brand-rgb, 15, 111, 132), 0.35);
}

.raqmyn-form__submit:active:not(:disabled) {
	transform: scale(0.98);
}

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

.raqmyn-form__submit:focus-visible {
	outline: 2px solid var(--color-brand, #0f6f84);
	outline-offset: 3px;
}

/* ─── Messages ───────────────────────────────────────────────────────── */

.raqmyn-form__message {
	padding: 14px 20px;
	border-radius: var(--radius-md, 12px);
	font-size: 0.95rem;
	margin-top: 16px;
	direction: rtl;
}

.raqmyn-form__message--success {
	background-color: rgba(var(--color-success-rgb, 16, 185, 129), 0.15);
	color: var(--color-success, #059669);
	border: 1px solid rgba(var(--color-success-rgb, 16, 185, 129), 0.3);
}

.raqmyn-form__message--error {
	background-color: rgba(var(--color-error-rgb, 239, 68, 68), 0.15);
	color: var(--color-error, #dc2626);
	border: 1px solid rgba(var(--color-error-rgb, 239, 68, 68), 0.3);
}

/* ─── Honeypot (hidden via CSS) ─────────────────────────────────────────── */

input[name="raqmyn_website_url"] {
	position: absolute;
	left: -9999px;
	top: -9999px;
}
