/* ==========================================================================
   صفحه‌ی ورود/ثبت‌نام — کارت دایره‌ای نئومورفیک با چرخش سکه‌ای
   ========================================================================== */

.phx-root.phx-auth {
	--coin-w: min(560px, calc(100vw - 32px));
	--coin-h: var(--coin-w);
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 26px;
	padding: 96px 16px 48px;
	background: var(--phx-bg);
	overflow-x: hidden;
	transition: background-color .5s var(--phx-ease);
}
.phx-root.phx-auth[style*="--phx-auth-bg"]::before {
	content: "";
	position: fixed;
	inset: 0;
	background: var(--phx-auth-bg) center / cover no-repeat;
	opacity: .16;
	pointer-events: none;
}

/* ---------- نوار بالا ---------- */
.phx-auth__top {
	position: absolute;
	top: 22px;
	right: 24px;
	left: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 5;
}
.phx-auth__home { display: inline-flex; align-items: center; gap: 10px; }
.phx-auth__brand { font-size: 18px; font-weight: 900; color: var(--phx-ink); }
.phx-root .phx-logo { height: 42px; width: auto; }

.phx-root .phx-neo-btn {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--phx-surface);
	box-shadow: var(--phx-raise-sm);
	color: var(--phx-ink-2);
	transition: color .3s, box-shadow .3s var(--phx-ease), transform .3s var(--phx-spring);
}
.phx-root .phx-neo-btn:hover { color: var(--phx-a1); transform: translateY(-1px); }
.phx-root .phx-neo-btn:active { box-shadow: var(--phx-inset-sm); transform: none; }
.phx-root .phx-neo-btn .phx-i { width: 20px; height: 20px; }


/* ---------- سکه ---------- */
.phx-coin {
	position: relative;
	width: var(--coin-w);
	height: var(--coin-h);
	perspective: 1900px;
	flex-shrink: 0;
	transition: transform .55s var(--phx-ease);
	animation: phx-coin-in 1s var(--phx-ease) both;
}
@keyframes phx-coin-in {
	from { opacity: 0; transform: translateY(26px) scale(.94); }
}
.phx-coin.is-flipping { transform: scale(.93); }
.phx-coin__inner {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transition: transform 1.05s cubic-bezier(.45, .05, .2, 1);
}
.phx-coin.is-flipped .phx-coin__inner { transform: rotateY(180deg); }

.phx-face {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--phx-surface);
	box-shadow: 24px 24px 52px var(--phx-sh-d), -24px -24px 52px var(--phx-sh-l);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	visibility: visible;
	transition: visibility 0s linear .5s, background-color .5s;
}
.phx-face--back { transform: rotateY(180deg); }
.phx-coin:not(.is-flipped) .phx-face--back,
.phx-coin.is-flipped .phx-face--front {
	visibility: hidden;
	pointer-events: none;
}

/* بازتاب نور روی لبه (مثل ویدیو) */
.phx-face::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(circle at 24% 16%, var(--phx-glare), transparent 46%);
	pointer-events: none;
}
.phx-face__rim {
	position: absolute;
	inset: 13px;
	border-radius: 50%;
	box-shadow: inset 4px 4px 9px var(--phx-sh-d), inset -4px -4px 9px var(--phx-sh-l);
	opacity: .5;
	pointer-events: none;
}

.phx-face__body {
	position: relative;
	z-index: 1;
	width: 64%;
	display: flex;
	flex-direction: column;
	gap: 11px;
}
.phx-face__head { text-align: center; margin-bottom: 4px; }
.phx-root .phx-title {
	font-size: 36px;
	font-weight: 900;
	line-height: 1.3;
	color: var(--phx-ink);
	text-align: center;
}
.phx-root .phx-subtitle {
	margin-top: 2px;
	font-size: 13px;
	font-weight: 500;
	color: var(--phx-ink-2);
	text-align: center;
}
.phx-face--back[data-progress="2"] .phx-subtitle,
.phx-face--back[data-progress="3"] .phx-subtitle { display: none; }

.phx-auth .phx-input { height: 48px; line-height: 48px; }

/* ---------- گام‌ها (روی هم، با اسلاید) ---------- */
.phx-steps { display: grid; }
.phx-step {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	gap: 11px;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-30px);
	pointer-events: none;
	transition: opacity .3s, transform .45s var(--phx-ease), visibility 0s linear .45s;
}
.phx-step.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	transition: opacity .45s .1s, transform .6s .1s var(--phx-ease), visibility 0s;
}
.phx-step.is-back { transform: translateX(30px); }

/* گام فعالِ روی پنهان نباید قابل کلیک یا فوکوس باشد (visibility فرزند، والد را نادیده می‌گیرد). */
.phx-coin:not(.is-flipped) .phx-face--back .phx-step,
.phx-coin.is-flipped .phx-face--front .phx-step {
	visibility: hidden;
	pointer-events: none;
	transition: opacity .3s, transform .45s var(--phx-ease), visibility 0s linear .5s;
}

.phx-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 26px;
}
.phx-row--center { justify-content: center; gap: 20px; }
.phx-root .phx-lead {
	font-size: 13px;
	color: var(--phx-ink-2);
	text-align: center;
	line-height: 1.95;
}
.phx-root .phx-lead b { color: var(--phx-ink); font-weight: 800; unicode-bidi: plaintext; }
.phx-root .phx-hint { font-size: 11.5px; color: var(--phx-ink-3); }
.phx-root .phx-foot {
	text-align: center;
	font-size: 12.5px;
	color: var(--phx-ink-2);
	margin-top: 4px;
}
.phx-root .phx-resend {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--phx-a1);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.phx-root .phx-resend[disabled] { color: var(--phx-ink-3); cursor: default; }
.phx-root .phx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phx-root .phx-actions { display: grid; grid-template-columns: 50px 1fr; gap: 10px; }
.phx-root .phx-actions .phx-btn--ghost { padding: 0; }

/* نشانگر گام‌های ثبت‌نام */
.phx-root .phx-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.phx-root .phx-dots li {
	width: 7px;
	height: 7px;
	border-radius: 9px;
	background: var(--phx-line-2);
	transition: width .5s var(--phx-spring), background .4s;
}
.phx-root .phx-dots li.is-on { width: 24px; background: var(--phx-grad); }

/* کمان پیشرفت روی لبه‌ی دایره */
.phx-arc {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
}
.phx-arc__track { fill: none; stroke: var(--phx-line); stroke-width: .5; }
.phx-arc__bar {
	fill: none;
	stroke: var(--phx-a1);
	stroke-width: .75;
	stroke-linecap: round;
	stroke-dasharray: 0 100;
	transition: stroke-dasharray 1s var(--phx-ease);
	filter: drop-shadow(0 0 1.2px rgba(var(--phx-a-rgb), .7));
}

/* پایان ثبت‌نام */
.phx-step--done { align-items: center; text-align: center; }
.phx-done-badge {
	width: 78px;
	height: 78px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--phx-grad);
	color: #fff;
	box-shadow: 0 16px 34px -10px rgba(var(--phx-a-rgb), .7);
}
.phx-step--done.is-active .phx-done-badge { animation: phx-badge 0.8s var(--phx-spring) both; }
.phx-done-badge .phx-i { width: 38px; height: 38px; stroke-width: 2.6; }
@keyframes phx-badge { from { transform: scale(0) rotate(-45deg); } }

.phx-auth__copy { font-size: 12.5px; color: var(--phx-ink-3); }
.phx-auth__copy a { display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.phx-auth__copy a:hover { color: var(--phx-a1); }
.phx-auth__copy .phx-i { width: 15px; height: 15px; }

/* ---------- کارت ساده (بازیابی ایمیلی) ---------- */
.phx-plain-card {
	width: min(460px, 100%);
	padding: 38px 32px;
	border-radius: 34px;
	background: var(--phx-surface);
	box-shadow: var(--phx-raise);
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.phx-wc-form p { margin: 0 0 14px; font-size: 13.5px; color: var(--phx-ink-2); }
.phx-wc-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--phx-ink-2); }
.phx-wc-form .required { color: var(--phx-danger); border: 0; text-decoration: none; }
.phx-wc-form input.input-text,
.phx-wc-form input[type="text"],
.phx-wc-form input[type="email"],
.phx-wc-form input[type="password"] {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--phx-radius-sm);
	background: var(--phx-surface);
	box-shadow: var(--phx-inset);
	font: inherit;
	color: var(--phx-ink);
}
.phx-wc-form button,
.phx-wc-form .button {
	height: 48px;
	width: 100%;
	border: 0;
	border-radius: var(--phx-radius-sm);
	background: var(--phx-grad);
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 12px 26px -8px rgba(var(--phx-a-rgb), .55);
}
.phx-wc-form .woocommerce-error,
.phx-wc-form .woocommerce-message,
.phx-wc-form .woocommerce-info {
	list-style: none;
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 13px;
	background: var(--phx-a-soft);
	color: var(--phx-ink);
}
.phx-wc-form .woocommerce-error { background: var(--phx-danger-soft); color: var(--phx-danger); }
.phx-wc-form .clear { clear: both; }
.phx-wc-form .woocommerce-form-row { margin-bottom: 14px; }

/* ==========================================================================
   دایره‌ی سیال — در همه‌ی اندازه‌ها (حتی موبایل) کارت دقیقاً دایره می‌ماند، مثل ویدیو.
   همه‌ی اندازه‌های داخلی با واحد cqw نسبت به قطر دایره مقیاس می‌گیرند و
   با clamp هیچ‌وقت از حداقل خوانا کوچک‌تر نمی‌شوند. (مرورگرهای بدون cqw
   همان اندازه‌های ثابت بالا را می‌گیرند.)
   ========================================================================== */
.phx-root.phx-auth { --coin-w: min(560px, calc(100vw - 16px)); }
.phx-coin { container-type: size; container-name: coin; }

.phx-face {
	box-shadow: clamp(12px, 4.3cqw, 24px) clamp(12px, 4.3cqw, 24px) clamp(28px, 9.3cqw, 52px) var(--phx-sh-d), calc(-1 * clamp(12px, 4.3cqw, 24px)) calc(-1 * clamp(12px, 4.3cqw, 24px)) clamp(28px, 9.3cqw, 52px) var(--phx-sh-l);
}
.phx-face__rim { inset: clamp(7px, 2.32cqw, 13px); }
.phx-face__body { gap: clamp(6px, 1.95cqw, 11px); }
.phx-step { gap: clamp(6px, 1.95cqw, 11px); }
.phx-face__head { margin-bottom: clamp(0px, .7cqw, 4px); }
.phx-coin .phx-title { font-size: clamp(23px, 6.43cqw, 36px); }
.phx-coin .phx-subtitle { font-size: clamp(11px, 2.32cqw, 13px); line-height: 1.6; }
.phx-coin .phx-lead { font-size: clamp(11px, 2.32cqw, 13px); line-height: 1.8; }
.phx-coin .phx-hint { font-size: clamp(10px, 2.05cqw, 11.5px); }
.phx-coin .phx-foot { font-size: clamp(11px, 2.23cqw, 12.5px); margin-top: clamp(0px, .7cqw, 4px); }
.phx-coin .phx-msg { font-size: clamp(10.5px, 2.23cqw, 12.5px); line-height: 1.6; }

.phx-coin .phx-input {
	height: clamp(38px, 8.57cqw, 48px);
	line-height: clamp(38px, 8.57cqw, 48px);
	font-size: clamp(12.5px, 2.6cqw, 14.5px);
	padding-right: clamp(34px, 8.2cqw, 46px);
	padding-left: clamp(10px, 2.86cqw, 16px);
	border-radius: clamp(10px, 2.15cqw, 12px);
}
.phx-coin .phx-field__icon {
	right: clamp(11px, 2.86cqw, 16px);
	width: clamp(15px, 3.4cqw, 19px);
	height: clamp(15px, 3.4cqw, 19px);
}
.phx-coin .phx-field__eye { left: clamp(4px, 1.8cqw, 10px); width: clamp(28px, 6cqw, 34px); height: clamp(28px, 6cqw, 34px); }

.phx-coin .phx-seg { padding: clamp(3px, .9cqw, 5px); border-radius: clamp(11px, 2.5cqw, 14px); }
.phx-coin .phx-seg__btn { height: clamp(30px, 6.43cqw, 36px); font-size: clamp(11px, 2.23cqw, 12.5px); gap: clamp(4px, 1.07cqw, 6px); }
.phx-coin .phx-seg__btn .phx-i { width: clamp(13px, 2.86cqw, 16px); height: clamp(13px, 2.86cqw, 16px); }
.phx-coin .phx-seg__pill { top: clamp(3px, .9cqw, 5px); bottom: clamp(3px, .9cqw, 5px); right: clamp(3px, .9cqw, 5px); width: calc((100% - 2 * clamp(3px, .9cqw, 5px)) / var(--n, 2)); }

.phx-coin .phx-btn { height: clamp(38px, 8.93cqw, 50px); font-size: clamp(12.5px, 2.6cqw, 14.5px); border-radius: clamp(10px, 2.15cqw, 12px); }
.phx-coin .phx-row { min-height: clamp(20px, 4.64cqw, 26px); gap: clamp(6px, 1.8cqw, 10px); }
.phx-coin .phx-row--center { gap: clamp(12px, 3.6cqw, 20px); }
.phx-coin .phx-switch,
.phx-coin .phx-link-muted,
.phx-coin .phx-resend,
.phx-coin .phx-check { font-size: clamp(10.5px, 2.23cqw, 12.5px); }
.phx-coin .phx-switch { gap: clamp(6px, 1.8cqw, 10px); }
.phx-coin .phx-switch__track { width: clamp(34px, 7.5cqw, 42px); height: clamp(19px, 3.93cqw, 22px); }
.phx-coin .phx-switch__knob { width: clamp(13px, 2.86cqw, 16px); height: clamp(13px, 2.86cqw, 16px); }
.phx-coin .phx-switch input:checked + .phx-switch__track .phx-switch__knob { transform: translateX(calc(-1 * (clamp(34px, 7.5cqw, 42px) - clamp(13px, 2.86cqw, 16px) - 6px))); }

.phx-coin .phx-otp { gap: clamp(5px, 1.79cqw, 10px); }
.phx-coin .phx-otp__box {
	width: clamp(32px, 8.57cqw, 48px);
	height: clamp(40px, 10cqw, 56px);
	font-size: clamp(17px, 4.1cqw, 23px);
	border-radius: clamp(9px, 2.5cqw, 14px);
}
.phx-coin .phx-otp.is-focus .phx-otp__box.is-current::after { height: clamp(16px, 4.3cqw, 24px); }

.phx-coin .phx-date__legend { font-size: clamp(11px, 2.23cqw, 12.5px); margin-bottom: clamp(4px, 1.43cqw, 8px); }
.phx-coin .phx-date__fields { gap: clamp(5px, 1.43cqw, 8px); }
.phx-coin .phx-date .phx-select {
	height: clamp(36px, 8.2cqw, 46px);
	line-height: clamp(36px, 8.2cqw, 46px);
	font-size: clamp(12px, 2.4cqw, 13.5px);
	padding: 0 clamp(8px, 2.15cqw, 12px) 0 clamp(20px, 5.4cqw, 30px);
	background-position: clamp(6px, 2.32cqw, 13px) 50%;
	background-size: clamp(11px, 2.5cqw, 14px);
}
.phx-coin .phx-grid-2 { gap: clamp(6px, 1.8cqw, 10px); }
.phx-coin .phx-actions { grid-template-columns: clamp(38px, 8.93cqw, 50px) 1fr; gap: clamp(6px, 1.8cqw, 10px); }
.phx-coin .phx-dots { margin-top: clamp(4px, 1.8cqw, 10px); }
.phx-coin .phx-meter { height: clamp(5px, 1.07cqw, 6px); }
.phx-coin .phx-check__box { width: clamp(17px, 3.57cqw, 20px); height: clamp(17px, 3.57cqw, 20px); }
.phx-coin .phx-done-badge { width: clamp(56px, 13.9cqw, 78px); height: clamp(56px, 13.9cqw, 78px); }
.phx-coin .phx-done-badge .phx-i { width: clamp(28px, 6.8cqw, 38px); height: clamp(28px, 6.8cqw, 38px); }

/* دایره‌ی کوچک (گوشی): جا باز کردن برای ردیف‌های عریض در مرکز دایره */
@container coin (max-width: 440px) {
	/* بدنه‌ی کمی باریک‌تر = ارتفاع بیشتر در وسط دایره برای ردیف‌های عریض */
	.phx-face__body { width: 63%; }
	.phx-coin .phx-seg__btn .phx-i { display: none; }
	.phx-face--back[data-progress="1"] .phx-subtitle { display: none; }
	.phx-coin [data-step="forgot-mobile"] .phx-lead,
	.phx-coin [data-step="reg-mobile"] .phx-lead { line-height: 1.7; }
	/* عنوان «بازیابی رمز» خودش توضیح می‌دهد */
	.phx-coin [data-step="forgot-new"] .phx-lead { display: none; }
	/* نوار قدرت رمز در فاصله‌ی بین دو فیلد می‌نشیند و ارتفاع اضافه نمی‌گیرد */
	.phx-coin .phx-meter { height: 4px; margin: calc(-1 * clamp(6px, 1.95cqw, 11px) + 2px) 8px; }
	.phx-coin .phx-msg { line-height: 1.5; }
	/* گام رمز ثبت‌نام بیشترین ردیف را دارد (ایمیل، دو رمز، قوانین، خطا، دکمه‌ها) */
	.phx-coin [data-step="reg-password"] { gap: clamp(5px, 1.5cqw, 11px); }
	.phx-coin [data-step="reg-password"] .phx-meter { margin-block: calc(-1 * clamp(5px, 1.5cqw, 11px) + 1px); }
}
@container coin (max-width: 360px) {
	.phx-face__body { width: 65%; }
	.phx-coin .phx-subtitle { display: none; }
	.phx-coin .phx-hint { display: none; }
	.phx-coin [data-step="reg-password"] { gap: 4px; }
	.phx-coin [data-step="reg-password"] .phx-meter { margin-block: -3px; }
}
/* گوشی‌های خیلی کوچک (۳۲۰px): حداقل اندازه‌ها کمی پایین‌تر، هنوز خوانا و قابل لمس */
@container coin (max-width: 330px) {
	.phx-face__body { width: 66%; gap: 5px; }
	.phx-step { gap: 5px; }
	.phx-coin .phx-title { font-size: 20px; }
	.phx-coin .phx-input { height: 34px; line-height: 34px; font-size: 12px; padding-right: 30px; }
	.phx-coin .phx-field__icon { right: 10px; width: 14px; height: 14px; }
	.phx-coin .phx-field__eye { width: 26px; height: 26px; }
	.phx-coin .phx-btn { height: 35px; font-size: 12px; }
	.phx-coin .phx-seg { padding: 3px; }
	.phx-coin .phx-seg__btn { height: 27px; font-size: 10.5px; }
	.phx-coin .phx-seg__pill { top: 3px; bottom: 3px; right: 3px; width: calc((100% - 6px) / var(--n, 2)); }
	.phx-coin .phx-row { min-height: 18px; }
	.phx-coin .phx-switch,
	.phx-coin .phx-link-muted,
	.phx-coin .phx-resend,
	.phx-coin .phx-check,
	.phx-coin .phx-foot,
	.phx-coin .phx-lead { font-size: 10.5px; }
	.phx-coin .phx-msg { font-size: 10px; }
	.phx-coin .phx-otp__box { width: 30px; height: 37px; font-size: 16px; }
	.phx-coin .phx-date .phx-select { height: 33px; line-height: 33px; font-size: 11px; }
	.phx-coin .phx-actions { grid-template-columns: 35px 1fr; }
	.phx-coin .phx-foot { margin-top: 0; }
	.phx-coin [data-step="reg-password"] { gap: 4px; }
}

/* ---------- صفحه در موبایل ---------- */
@media (max-width: 600px) {
	.phx-root.phx-auth {
		padding: 76px 8px 28px;
		gap: 18px;
	}
	.phx-auth__top { top: 14px; right: 14px; left: 14px; }
	.phx-root .phx-neo-btn { width: 42px; height: 42px; }
	.phx-auth__brand { font-size: 16px; }
	.phx-root .phx-logo { height: 34px; }
}
@media (max-width: 340px) {
	.phx-root.phx-auth { --coin-w: calc(100vw - 8px); padding-inline: 4px; }
}
/* صفحه‌ی کوتاه (گوشی افقی/لپ‌تاپ کوچک): دایره از بالا شروع و صفحه اسکرول می‌شود. */
@media (max-height: 640px) {
	.phx-root.phx-auth { justify-content: flex-start; }
}
@media (max-height: 520px) and (orientation: landscape) {
	.phx-root.phx-auth { --coin-w: min(560px, calc(100vw - 16px), calc(100svh + 120px)); padding-top: 68px; }
}
