/* =========================================================================
 * Toyana Custom Auth — styles
 * تمام رنگ‌ها و اندازه‌ها از طریق متغیرهای :root قابل تنظیم‌اند | all tunable via :root.
 * طراحی دو ستونه: فرم در چپ، تصویرِ گرد بزرگ در راست. زیر ~900px تک‌ستونه (تصویر مخفی).
 * ========================================================================= */

:root {
	/* navy از پیکسلِ دکمهٔ Figma نمونه‌برداری شد (RGB 8,66,106). همین مقدار در افزونهٔ سبد خرید نیز ست شد. */
	--ta-primary: #08426A;          /* navy — primary buttons (sampled from Figma; shared with cart plugin) */
	--ta-primary-hover: #06334F;    /* navy، حالت hover */
	--ta-primary-disabled: #C9CDD2; /* دکمهٔ غیرفعال (حالت خالیِ فرم لاگین در Figma) */
	--ta-accent: #2F6BFF;           /* «Forgot password?» link (blue) */

	--ta-text: #1A1A1A;             /* عنوان‌ها و متن اصلی */
	--ta-text-muted: #5B6470;       /* زیرعنوان‌ها */
	--ta-on-primary: #FFFFFF;       /* متنِ روی دکمهٔ navy */

	--ta-input-bg: #F4F5F6;         /* پس‌زمینهٔ ورودی‌ها (روشن) */
	--ta-input-border: #E6E8EB;     /* خط دور ورودی */
	--ta-input-text: #1A1A1A;
	--ta-placeholder: #9AA1AB;
	--ta-focus-ring: rgba(47, 107, 255, 0.25);

	--ta-divider: #E6E8EB;          /* خط جداکنندهٔ OR */

	--ta-input-radius: 999px;       /* ورودی‌های قرصی‌شکل | pill inputs */
	--ta-btn-radius: 999px;         /* دکمه‌های قرصی‌شکل | pill buttons */
	--ta-media-radius: 28px;        /* گردیِ پنل تصویر | image panel corner radius */

	--ta-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- ریشه و ریست | scope + reset ---------- */
.ta-auth,
.ta-auth * {
	box-sizing: border-box;
}

.ta-auth {
	color: var(--ta-text);
	font-family: var(--ta-font);
	line-height: 1.5;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

/* ---------- شبکهٔ دو ستونه | two-column grid ---------- */
.ta-auth__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: stretch;
	min-height: 560px;
}

/* ستون فرم | form column — فرم به‌صورت عمودی وسط‌چین */
.ta-auth__form-col {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ta-auth__form-wrap {
	width: 100%;
	max-width: 440px;
}

/* ---------- پنل‌های فلوی یکپارچه | unified-flow panels ----------
 * هر سه پنل (identify / login / register) رندر می‌شوند؛ فقط پنلِ هم‌نام با
 * data-view نمایش داده می‌شود. سرور مقدار اولیه را ست می‌کند و JS همان صفت را
 * برای سوییچِ بدون ریلود عوض می‌کند.
 * All panels are in the DOM; only the one matching the wrapper's data-view is
 * visible. The server sets the initial value, JS flips it for inline switching.
 */
.ta-auth .ta-panel {
	display: none;
}

.ta-auth[data-view="identify"] .ta-panel--identify,
.ta-auth[data-view="login"] .ta-panel--login,
.ta-auth[data-view="register"] .ta-panel--register {
	display: block;
}

/* ---------- سرتیتر | heading ---------- */
.ta-auth__head {
	margin-bottom: 36px;
}

.ta-auth__title {
	font-size: 2.5rem;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 8px;
	color: var(--ta-text);
}

.ta-auth__subtitle {
	margin: 0;
	color: var(--ta-text-muted);
	font-size: 1rem;
}

/* ---------- پیامِ زمینه‌ای (آمدن از تسویه) | contextual line (arrived from checkout) ---------- */
.ta-auth__context {
	margin: 0 0 24px;
	padding: 12px 18px;
	border-radius: 14px;
	background: #EAF1F7;            /* navy، خیلی روشن | very light navy tint */
	border: 1px solid #CBDDEC;
	color: var(--ta-primary);
	font-size: 0.95rem;
	font-weight: 500;
}

/* ---------- فرم و فیلدها | form + fields ---------- */
/*
 * حذفِ کاملِ border/پس‌زمینه/سایهٔ احتمالیِ قالب دورِ فرم تا ظاهر تمیز و مدرن بماند.
 * Strip any theme border / background / box-shadow around the form for a clean look.
 */
.ta-auth__form,
.ta-auth .woocommerce-form,
.ta-auth form {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.ta-field {
	margin: 0 0 20px;
}

.ta-field > label {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ta-text);
	margin-bottom: 8px;
}

.ta-input {
	width: 100%;
	height: 52px;
	padding: 0 22px;
	border: 1px solid var(--ta-input-border);
	border-radius: var(--ta-input-radius);
	background: var(--ta-input-bg);
	color: var(--ta-input-text);
	font-family: inherit;
	font-size: 1rem;
	line-height: 52px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ta-input::placeholder {
	color: var(--ta-placeholder);
}

.ta-input:hover {
	background: #EFF1F3;
}

.ta-input:focus {
	outline: none;
	background: #FFFFFF;
	border-color: var(--ta-accent);
	box-shadow: 0 0 0 4px var(--ta-focus-ring);
}

/* ---------- ردیف Remember me / Forgot ---------- */
.ta-row {
	display: flex;
	align-items: center;
	margin: 4px 0 28px;
}

.ta-row--between {
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.ta-check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 0.95rem;
	color: var(--ta-text);
	margin: 0;
}

.ta-check__box {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--ta-primary);
	cursor: pointer;
}

/* ---------- لینک‌ها | links ---------- */
.ta-link {
	text-decoration: none;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.ta-link:hover {
	text-decoration: underline;
}

.ta-link--accent {
	color: var(--ta-accent);
	font-weight: 600;
	font-size: 0.95rem;
}

.ta-link--strong {
	color: var(--ta-text);
	font-weight: 700;
}

/* ---------- دکمهٔ اصلی | primary button ---------- */
.ta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	padding: 0 24px;
	border: none;
	border-radius: var(--ta-btn-radius);
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.ta-btn--primary {
	background: var(--ta-primary);
	color: var(--ta-on-primary);
}

.ta-btn--primary:hover {
	background: var(--ta-primary-hover);
}

.ta-btn--primary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--ta-focus-ring);
}

.ta-btn--primary:active {
	transform: translateY(1px);
}

.ta-btn--primary:disabled,
.ta-btn--primary[aria-disabled="true"] {
	background: var(--ta-primary-disabled);
	color: #8A9099;
	cursor: not-allowed;
}

/* ---------- پیوند سوییچ بین ویوها | view switch line ---------- */
.ta-auth__switch {
	text-align: center;
	margin: 28px 0 0;
	color: var(--ta-text-muted);
	font-size: 0.95rem;
}

.ta-auth__switch .ta-link--strong {
	margin-left: 4px;
}

/* خطِ دومِ سوییچ («ایمیل دیگری وارد کنید») | secondary switch line (change email). */
.ta-auth__switch--alt {
	margin-top: 10px;
	font-size: 0.9rem;
}

/* حالتِ درحال‌بررسیِ دکمهٔ Continue | Continue button while the AJAX lookup runs. */
.ta-btn.is-loading {
	opacity: 0.7;
	cursor: progress;
}

/* ---------- یادداشت (حالت تولید رمز خودکار) | note ---------- */
.ta-note {
	margin: 0 0 20px;
	padding: 12px 16px;
	background: var(--ta-input-bg);
	border-radius: 14px;
	color: var(--ta-text-muted);
	font-size: 0.9rem;
}

/* ---------- پنل تصویر | image panel (باکس مربعی، ضدِ کشیدگی | square, bulletproof) ---------- */
.ta-auth__media {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;          /* باکس مربعی | square box */
	align-self: center;           /* وسط‌چین کنار فرم، تا با ستونِ فرم کشیده نشود | center, don't stretch */
	border-radius: var(--ta-media-radius);
	overflow: hidden;             /* بیرون‌زدگی را می‌بُرد | clip anything outside the box */
	/* fallback اگر تصویر موجود نباشد | soft gradient fallback if the image is missing */
	background: linear-gradient(160deg, #Bfe9e4 0%, #d8c9a8 100%);
}

/*
 * تصویر به‌صورت absolute روی کلِ باکس کشیده می‌شود و با object-fit: cover بدون کشیدگی
 * (حفظ نسبت) باکس را پُر می‌کند. این روش، قانونِ سراسریِ قالب (img{height:auto}) را خنثی می‌کند.
 * Absolutely fill the square and `cover` it — keeps aspect ratio (no stretch) and
 * overrides any theme `img { height:auto }` rule that could distort it.
 */
.ta-auth__media-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;              /* خنثی‌سازیِ max-width قالب | neutralize theme max-width */
	margin: 0;
	object-fit: cover;
	object-position: center;
}

/* =========================================================================
 * Notices — استایلِ پیام‌های ووکامرس هماهنگ با طراحی | WooCommerce notices, restyled.
 * ووکامرس کلاس‌های woocommerce-error / -message / -info را چاپ می‌کند.
 * ========================================================================= */
.ta-auth .woocommerce-error,
.ta-auth .woocommerce-message,
.ta-auth .woocommerce-info,
.ta-auth .woocommerce-notice {
	list-style: none;
	margin: 0 0 24px;
	padding: 14px 18px;
	border-radius: 14px;
	font-size: 0.95rem;
	border: 1px solid transparent;
}

.ta-auth .woocommerce-error {
	background: #FDECEC;
	border-color: #F5C2C2;
	color: #9B1C1C;
}

.ta-auth .woocommerce-message {
	background: #E9F7EF;
	border-color: #BCE6CE;
	color: #1E6B3F;
}

.ta-auth .woocommerce-info,
.ta-auth .woocommerce-notice {
	background: #EEF3FB;
	border-color: #C9D9F2;
	color: #1F4E8A;
}

.ta-auth .woocommerce-error li,
.ta-auth .woocommerce-message li,
.ta-auth .woocommerce-info li {
	list-style: none;
	margin: 0;
}

/* =========================================================================
 * Responsive — تک ستونه زیر ~900px، تصویر مخفی | single column under ~900px.
 * ========================================================================= */
@media (max-width: 900px) {
	.ta-auth {
		padding: 24px 16px 40px;
	}

	.ta-auth__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		min-height: 0;
	}

	/* تصویر روی موبایل مخفی می‌شود (طبق طراحی) | hide image panel on mobile. */
	.ta-auth__media {
		display: none;
	}

	.ta-auth__form-wrap {
		max-width: 480px;
		margin: 0 auto;
	}

	.ta-auth__title {
		font-size: 2rem;
	}
}

/* احترام به کاهش حرکت | respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ta-input,
	.ta-btn,
	.ta-link {
		transition: none;
	}
}
