/* Arco OTP Login – پاپ‌آپ و فرم ورود
 * رنگ اصلی و رنگ‌های فرعی آن از تنظیمات افزونه روی :root تعریف می‌شوند (--aol-primary*).
 * فونت از قالب سایت گرفته می‌شود. همه قوانین زیر .aol-form/.aol-dialog محدود شده‌اند
 * تا استایل قالب روی فرم اثر نگذارد و برعکس. */

:root {
	--aol-primary: #e20074;
	--aol-on-primary: #ffffff;
	--aol-primary-soft: #fce6f1;
	--aol-primary-tint: #fef5fa;
	--aol-primary-ring: rgba(226, 0, 116, .22);
	--aol-primary-shadow: rgba(226, 0, 116, .28);
	--aol-bg: #ffffff;
	--aol-field: #f5f6f7;
	--aol-line: #e3e6e8;
	--aol-line-strong: #cfd4d8;
	--aol-fg: #1c2024;
	--aol-muted: #6b737b;
	--aol-danger: #c62828;
	--aol-danger-soft: #fdeceb;
	--aol-ok: #1f8a4c;
	--aol-ok-soft: #e4f5ea;
	--aol-radius: 12px;
	--aol-control: 52px;
}

html.aol-lock, html.aol-lock body { overflow: hidden !important; }

/* ================= پاپ‌آپ ================= */
.aol-overlay {
	position: fixed; inset: 0; z-index: 999999;
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
	background: rgba(17, 20, 24, .5);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	animation: aol-fade .2s ease-out;
	direction: rtl;
}
.aol-overlay[hidden] { display: none !important; }

.aol-dialog {
	position: relative;
	width: 100%; max-width: 400px;
	max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
	padding: 28px 24px 24px;
	background: var(--aol-bg); color: var(--aol-fg);
	border-radius: 20px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 24px 64px rgba(0, 0, 0, .2);
	animation: aol-rise .26s cubic-bezier(.2, .8, .2, 1);
	text-align: right;
}

.aol-dialog .aol-close {
	position: absolute; top: 22px; left: 20px; z-index: 1;
	display: flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0;
	border: 0; border-radius: 50%;
	background: var(--aol-field); color: var(--aol-muted);
	font: 400 22px/1 Arial, sans-serif; cursor: pointer; box-shadow: none;
	transition: background .15s, color .15s;
}
.aol-dialog .aol-close:hover { background: var(--aol-line); color: var(--aol-fg); }
/* عنوان زیر دکمه بستن نرود */
.aol-dialog .aol-form .aol-title { padding-left: 44px; }

@keyframes aol-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes aol-rise { from { transform: translateY(16px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes aol-sheet { from { transform: translateY(100%) } to { transform: none } }

/* موبایل: پاپ‌آپ از پایین صفحه */
@media (max-width: 480px) {
	.aol-overlay { align-items: flex-end; padding: 0; }
	.aol-dialog {
		max-width: none; max-height: 92vh; max-height: 92dvh;
		padding: 30px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		border-radius: 22px 22px 0 0;
		animation: aol-sheet .28s cubic-bezier(.2, .8, .2, 1);
	}
	.aol-dialog::before {
		content: ""; position: absolute; top: 9px; left: 50%;
		width: 40px; height: 4px; margin-left: -20px; border-radius: 4px;
		background: var(--aol-line-strong);
	}
	.aol-dialog .aol-close { top: 24px; left: 16px; }
}

/* ================= فرم درون‌صفحه ================= */
.aol-inline {
	max-width: 420px; margin: 0 auto 32px;
	padding: 28px 24px 24px;
	background: var(--aol-bg); color: var(--aol-fg);
	border: 1px solid var(--aol-line); border-radius: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
	direction: rtl; text-align: right;
}
.aol-inline--done { text-align: center; color: var(--aol-muted); }

/* ================= اجزای فرم ================= */
.aol-form {
	position: relative;
	direction: rtl; text-align: right;
	font-family: inherit; font-size: 14px; line-height: 1.75; color: var(--aol-fg);
	letter-spacing: normal;
}
.aol-form *, .aol-form *::before, .aol-form *::after { box-sizing: border-box; }
.aol-form [hidden] { display: none !important; }
.aol-form p { margin: 0; }
.aol-form svg { display: inline-block; vertical-align: middle; }

.aol-form .aol-logo { display: block; max-height: 40px; width: auto; margin: 0 auto 18px; }
.aol-form .aol-title {
	margin: 0; padding: 0; border: 0;
	font-family: inherit; font-size: 19px; font-weight: 800; line-height: 34px; letter-spacing: normal;
	color: var(--aol-fg); text-transform: none;
}
.aol-form .aol-sub {
	margin: 2px 0 20px;
	font-size: 13px; line-height: 1.8; color: var(--aol-muted);
	text-wrap: pretty;
}

/* تب‌ها: سوییچ دوحالته */
.aol-form .aol-tabs {
	display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
	margin: 0 0 20px; padding: 4px;
	background: var(--aol-field); border-radius: 12px;
}
.aol-form .aol-tabs button {
	height: 38px; min-height: 0; margin: 0; padding: 0 8px;
	background: transparent; border: 0; border-radius: 9px; box-shadow: none;
	font: inherit; font-size: 13px; font-weight: 600; line-height: 38px; letter-spacing: normal; text-transform: none;
	color: var(--aol-muted); cursor: pointer;
	transition: background .15s, color .15s, box-shadow .15s;
}
.aol-form .aol-tabs button:hover { color: var(--aol-fg); }
.aol-form .aol-tabs button[aria-selected="true"] {
	background: var(--aol-bg); color: var(--aol-primary);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .04);
}

/* فیلدها */
.aol-form .aol-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.aol-form label { margin: 0; padding: 0; font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--aol-fg); }

.aol-form .aol-phone {
	display: flex; align-items: stretch; direction: ltr;
	height: var(--aol-control); overflow: hidden;
	background: var(--aol-field); border: 1.5px solid transparent; border-radius: var(--aol-radius);
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.aol-form .aol-phone span {
	display: flex; align-items: center; flex-shrink: 0;
	padding: 0 14px; margin: 8px 0;
	border-right: 1px solid var(--aol-line-strong);
	font-size: 15px; font-weight: 600; color: var(--aol-muted); direction: ltr;
}
.aol-form .aol-phone input,
.aol-form .aol-input {
	flex: 1; min-width: 0; width: 100%; max-width: none; height: 100%; min-height: 0;
	margin: 0; padding: 0 14px;
	background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: none;
	-webkit-appearance: none; appearance: none;
	font: inherit; font-size: 17px; font-weight: 600; line-height: normal; letter-spacing: .06em;
	color: var(--aol-fg); text-align: left; direction: ltr;
}
.aol-form .aol-input {
	flex: none;
	height: var(--aol-control);
	background: var(--aol-field); border: 1.5px solid transparent; border-radius: var(--aol-radius);
	font-size: 15px; font-weight: 500; letter-spacing: .02em;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.aol-form .aol-phone input::placeholder,
.aol-form .aol-input::placeholder { color: #a7adb3; opacity: 1; font-weight: 500; }
.aol-form .aol-phone:hover, .aol-form .aol-input:hover { border-color: var(--aol-line-strong); }
.aol-form .aol-phone:focus-within,
.aol-form .aol-input:focus {
	background: var(--aol-bg); border-color: var(--aol-primary);
	box-shadow: 0 0 0 4px var(--aol-primary-ring);
}

/* خانه‌های کد */
.aol-form .aol-otp { display: flex; justify-content: center; gap: 10px; direction: ltr; margin: 4px 0 20px; }
.aol-form .aol-otp input {
	flex: 0 1 52px; width: 52px; min-width: 0; height: 58px; min-height: 0; margin: 0; padding: 0;
	background: var(--aol-field); border: 1.5px solid transparent; border-radius: var(--aol-radius); box-shadow: none; outline: none;
	-webkit-appearance: none; appearance: none;
	font: inherit; font-size: 24px; font-weight: 700; line-height: 58px; text-align: center; color: var(--aol-fg);
	caret-color: var(--aol-primary);
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.aol-form .aol-otp input:not(:placeholder-shown) { background: var(--aol-bg); border-color: var(--aol-line-strong); }
.aol-form .aol-otp input:focus { background: var(--aol-bg); border-color: var(--aol-primary); box-shadow: 0 0 0 4px var(--aol-primary-ring); }
.aol-form.aol-bad .aol-otp { animation: aol-shake .35s; }
.aol-form.aol-bad .aol-otp input { border-color: var(--aol-danger); background: var(--aol-danger-soft); }
.aol-form.aol-bad .aol-otp input:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .15); }
@keyframes aol-shake { 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
@media (max-width: 360px) { .aol-form .aol-otp { gap: 6px; } .aol-form .aol-otp input { height: 52px; font-size: 21px; } }

/* شماره ارسال‌شده */
.aol-form .aol-sent {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	margin: -8px 0 18px; padding: 10px 14px;
	background: var(--aol-primary-tint); border: 1px solid var(--aol-primary-soft); border-radius: var(--aol-radius);
}
.aol-form .aol-sent-phone { font-size: 16px; font-weight: 700; letter-spacing: .05em; color: var(--aol-fg); }

/* دکمه اصلی */
.aol-form .aol-btn {
	position: relative; display: flex; align-items: center; justify-content: center;
	width: 100%; height: var(--aol-control); min-height: 0; margin: 0; padding: 0 16px;
	background: var(--aol-primary); color: var(--aol-on-primary);
	border: 0; border-radius: var(--aol-radius);
	box-shadow: 0 6px 16px -6px var(--aol-primary-shadow);
	font: inherit; font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: normal; text-transform: none; text-decoration: none;
	cursor: pointer; transition: filter .15s, transform .1s, box-shadow .15s;
}
.aol-form .aol-btn:hover { filter: brightness(1.06); color: var(--aol-on-primary); background: var(--aol-primary); }
.aol-form .aol-btn:active { transform: scale(.985); }
.aol-form .aol-btn:disabled { cursor: wait; filter: none; }
.aol-form .aol-btn.aol-loading { color: transparent !important; }
.aol-form .aol-btn.aol-loading::after {
	content: ""; position: absolute; top: 50%; left: 50%;
	width: 20px; height: 20px; margin: -10px 0 0 -10px;
	border: 2.5px solid var(--aol-on-primary); border-right-color: transparent; border-radius: 50%;
	animation: aol-spin .7s linear infinite;
}
@keyframes aol-spin { to { transform: rotate(360deg) } }

/* لینک‌ها و ردیف‌ها */
.aol-form .aol-link {
	display: inline-flex; align-items: center; gap: 4px;
	min-height: 0; height: auto; margin: 0; padding: 0;
	background: none; border: 0; border-radius: 0; box-shadow: none;
	font: inherit; font-size: 13px; font-weight: 600; line-height: 1.6; text-decoration: none; text-transform: none; letter-spacing: normal;
	color: var(--aol-primary); cursor: pointer;
}
.aol-form .aol-link:hover { text-decoration: underline; text-underline-offset: 3px; background: none; color: var(--aol-primary); }
.aol-form .aol-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 18px; font-size: 13px; }
.aol-form .aol-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.aol-form .aol-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--aol-primary); }
.aol-form .aol-resend { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--aol-muted); }
.aol-form .aol-timer { display: inline-block; direction: ltr; unicode-bidi: isolate; min-width: 3.2em; font-weight: 700; color: var(--aol-fg); font-variant-numeric: tabular-nums; }

/* پیام‌ها */
.aol-form .aol-error {
	display: flex; gap: 8px; align-items: flex-start;
	margin: 0 0 16px; padding: 10px 12px;
	background: var(--aol-danger-soft); color: var(--aol-danger);
	border-radius: 10px; font-size: 13px; font-weight: 500; line-height: 1.7;
}
.aol-form .aol-error::before {
	content: "!"; flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%; background: var(--aol-danger); color: #fff;
	font: 700 12px/1 Arial, sans-serif;
}
.aol-form .aol-error--info { background: var(--aol-primary-tint); color: var(--aol-fg); }
.aol-form .aol-error--info::before { content: "i"; background: var(--aol-primary); color: var(--aol-on-primary); font-family: Georgia, serif; }

.aol-form .aol-legal { margin: 14px 0 0; text-align: center; font-size: 12px; line-height: 1.8; color: var(--aol-muted); }
.aol-form .aol-legal a { color: var(--aol-primary); text-decoration: none; font-weight: 600; }
.aol-form .aol-legal a:hover { text-decoration: underline; }

/* فیلد ضدربات: بدون جابه‌جایی بیرون از کادر، تا در صفحه‌های راست‌به‌چپ اسکرول افقی نسازد */
.aol-form .aol-hp {
	position: absolute !important; top: 0 !important; right: 0 !important;
	width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important;
	overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important;
	white-space: nowrap !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important;
}

/* خرید بدون ورود */
.aol-form .aol-guest {
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	margin: 18px 0 0;
}
.aol-form .aol-guest-or {
	display: flex; align-items: center; gap: 12px; width: 100%;
	font-size: 12px; color: var(--aol-muted);
}
.aol-form .aol-guest-or::before, .aol-form .aol-guest-or::after { content: ""; flex: 1; height: 1px; background: var(--aol-line); }
.aol-form .aol-guest-link {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 46px; border-radius: var(--aol-radius);
	border: 1.5px solid var(--aol-line); background: transparent;
	font-size: 14px; font-weight: 700; color: var(--aol-fg); text-decoration: none;
	transition: border-color .15s, background .15s;
}
.aol-form .aol-guest-link:hover { border-color: var(--aol-line-strong); background: var(--aol-field); color: var(--aol-fg); }

/* پایان */
.aol-form .aol-done { text-align: center; padding: 16px 0 8px; }
.aol-form .aol-done .aol-title { padding-left: 0; }
.aol-form .aol-tick {
	display: flex; align-items: center; justify-content: center;
	width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
	background: var(--aol-ok-soft); color: var(--aol-ok); font-size: 30px; font-weight: 700;
	animation: aol-pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes aol-pop { from { transform: scale(.4); opacity: 0 } to { transform: none; opacity: 1 } }

.aol-form button:focus-visible, .aol-form a:focus-visible, .aol-dialog .aol-close:focus-visible {
	outline: 2px solid var(--aol-primary); outline-offset: 2px;
}

/* حساب کاربری ووکامرس */
.aol-account-phone {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	margin: 0 0 24px; padding: 14px 16px;
	border: 1px solid var(--aol-line); border-radius: 14px;
}
.aol-account-phone b { direction: ltr; unicode-bidi: isolate; letter-spacing: .04em; }
.aol-account-phone .button { margin-right: auto; }
.aol-checkout-login { margin-bottom: 1.5em; }

@media (prefers-reduced-motion: reduce) {
	.aol-overlay, .aol-dialog, .aol-form .aol-tick, .aol-form.aol-bad .aol-otp, .aol-form .aol-btn.aol-loading::after { animation: none !important; }
}
