/* ═══════════════════════════════════════════════════════════
   رکپچای اختصاصی سایت — نسخه‌ی مدرن
   ═══════════════════════════════════════════════════════════ */

.am-captcha {
	direction: rtl;
	margin: 6px 0 18px;
	opacity: 0;
	animation: amCaptchaIn .5s cubic-bezier(.2, .8, .2, 1) .05s both;
}

.am-captcha__label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	color: #64748b;
	margin-bottom: 10px;
	line-height: 1.7;
	text-align: right;
}

.am-captcha__label-icon {
	flex-shrink: 0;
	font-size: 13px;
	color: #e2ac2f;
}

.am-captcha__row {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

/* ── چیپ سوال (عدد + دکمه‌ی تازه‌سازی در کنار هم) ── */
.am-captcha__chip {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 52px;
	padding: 0 10px 0 14px;
	background: linear-gradient(135deg, #fdf6e3, #f8ecc8);
	border: 1px solid rgba(226, 172, 47, 0.45);
	border-radius: 16px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
	transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.am-captcha__row:focus-within .am-captcha__chip {
	border-color: #e2ac2f;
	box-shadow: 0 0 0 4px rgba(226, 172, 47, 0.14), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.am-captcha__question {
	font-weight: 800;
	font-size: 16px;
	color: #7a5a12;
	letter-spacing: .5px;
	user-select: none;
	white-space: nowrap;
	direction: ltr;
	unicode-bidi: embed;
}

.am-captcha__refresh {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, .65);
	color: #a3791a;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	transition: background .2s ease, color .2s ease, transform .2s ease;
}

.am-captcha__refresh:hover {
	background: #fff;
	color: #7a5a12;
	transform: rotate(35deg);
}

.am-captcha__refresh:active {
	transform: rotate(35deg) scale(.9);
}

.am-captcha__refresh svg {
	display: block;
}

.am-captcha__refresh.is-spinning svg {
	animation: amCaptchaSpin .5s linear;
}

@keyframes amCaptchaSpin {
	to { transform: rotate(360deg); }
}

/* ── فیلد پاسخ ── */
.am-captcha__answer {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 52px;
	box-sizing: border-box;
	border: 1px solid #dbe3ef;
	border-radius: 16px;
	background: #f8fafc;
	color: #0f172a;
	font-size: 15px;
	font-weight: 700;
	padding: 0 16px;
	outline: none;
	text-align: center;
	transition: border-color .25s ease, background .25s ease, box-shadow .25s ease, transform .25s ease;
}

.am-captcha__answer::placeholder {
	color: #b7c1cf;
	font-weight: 500;
}

.am-captcha__answer:focus {
	background: #fff;
	border-color: #e2ac2f;
	box-shadow: 0 0 0 4px rgba(226, 172, 47, 0.16);
	transform: translateY(-1px);
}

.am-captcha__answer.am-captcha--invalid {
	border-color: #dc2626;
	background: #fef2f2;
	animation: amCaptchaShake .4s ease;
}

.am-captcha__error {
	display: block;
	min-height: 18px;
	margin-top: 7px;
	font-size: 12.5px;
	color: #dc2626;
	text-align: right;
}

@keyframes amCaptchaIn {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes amCaptchaShake {
	10%, 90% { transform: translateX(-1px); }
	20%, 80% { transform: translateX(2px); }
	30%, 50%, 70% { transform: translateX(-4px); }
	40%, 60% { transform: translateX(4px); }
}

/* ── دکمه‌ی «ارسال کد» تمام‌عرض، وقتی زیر کپچا جا می‌گیرد ── */
.btn-send-otp--full {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 15px;
}

.btn-send-otp--full i {
	font-size: 13px;
}

@media (max-width: 480px) {
	.am-captcha__chip,
	.am-captcha__answer {
		height: 48px;
	}
	.am-captcha__question {
		font-size: 14px;
	}
	.am-captcha__chip {
		padding: 0 8px 0 12px;
	}
}

/* ═══════════════════════════════════════════════════════════
   اطمینان از برتری استایل‌های بالا نسبت به قواعد عمومی فرم‌ها
   داخل ساید‌بار درخواست بازدید (single-property.php)
   ═══════════════════════════════════════════════════════════ */
.rep-single-wrapper .visit-form-box .am-captcha { margin: 6px 0 18px; }

/* FIX: فقط در فرم درخواست بازدید، ترتیب چیدمان کپچا برعکس شود:
   فیلد پاسخ سمت راست و چیپ سؤال سمت چپ قرار بگیرد.
   به‌جای flex-direction: row-reverse (که در RTL به‌راحتی با تغییرات دیگر
   استایل قابل تداخل/بازگشت به حالت قبل است) از خاصیت صریح "order" استفاده
   می‌شود: عنصر با order کوچک‌تر همیشه اول در محور اصلی (سمت راست در RTL)
   و عنصر با order بزرگ‌تر بعد از آن (سمت چپ) قرار می‌گیرد؛ این روش صرف‌نظر
   از جهت سند (rtl/ltr) رفتار قابل‌پیش‌بینی و پایداری دارد. */
.rep-single-wrapper .visit-form-box .am-captcha__row {
	flex-direction: row;
}
.rep-single-wrapper .visit-form-box .am-captcha__answer {
	order: 1; /* راست */
}
.rep-single-wrapper .visit-form-box .am-captcha__chip {
	order: 2; /* چپ */
}

.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__answer {
	height: 52px;
	border-radius: 16px;
}
.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__answer:focus {
	background: #fff;
	border-color: #e2ac2f;
	box-shadow: 0 0 0 4px rgba(226, 172, 47, 0.16);
	transform: translateY(-1px);
}
.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__answer.am-captcha--invalid {
	border-color: #dc2626;
	background: #fef2f2;
}

.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__chip {
	height: 52px;
}

.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__refresh {
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 400;
	background: rgba(255, 255, 255, .65);
	color: #a3791a;
}
.rep-single-wrapper .visit-form-box .am-captcha .am-captcha__refresh:hover {
	background: #fff;
	color: #7a5a12;
	transform: rotate(35deg);
	box-shadow: none;
}

.rep-single-wrapper .visit-form-box .btn-send-otp--full {
	width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   نمایش پلکانی: کلیک روی «ارسال کد» ← نمایان‌شدن رکپچا
   تایید رکپچا ← نمایان‌شدن فیلد کد پیامکی
   ═══════════════════════════════════════════════════════════ */
.am-collapsible {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transform: translateY(-10px);
	pointer-events: none;
	margin-bottom: 0 !important;
	transition: max-height .5s cubic-bezier(.2, .8, .2, 1),
	            opacity .38s ease,
	            transform .4s cubic-bezier(.2, .8, .2, 1),
	            margin-bottom .4s ease;
}

.am-collapsible.is-open {
	max-height: 320px;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	margin-bottom: 15px !important;
}

.am-captcha-panel {
	padding: 16px 16px 4px;
	background: #f8fafc;
	border: 1px dashed rgba(226, 172, 47, 0.4);
	border-radius: 18px;
}

.am-captcha-panel .am-captcha {
	margin: 0 0 14px;
	animation: none;
	opacity: 1;
}

/* وقتی پنل باز می‌شود، محتوای داخلش هم با کمی تاخیر جان می‌گیرد */
.am-collapsible.is-open .am-captcha {
	animation: amCaptchaIn .45s cubic-bezier(.2, .8, .2, 1) .1s both;
}

.btn-captcha-confirm {
	width: 100%;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 14px;
	border: none;
	border-radius: 14px;
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	background: linear-gradient(135deg, #16a34a, #15803d);
	box-shadow: 0 10px 22px rgba(22, 163, 74, 0.25);
	transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.btn-captcha-confirm:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 30px rgba(22, 163, 74, 0.32);
}

.btn-captcha-confirm:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

.btn-captcha-confirm.is-loading i {
	animation: amCaptchaSpin .7s linear infinite;
}

.rep-single-wrapper .visit-form-box .btn-captcha-confirm {
	width: 100%;
	height: 48px;
	border-radius: 14px;
}
