/* ==========================================================================
   صفحات ورود / ثبت‌نام / بازیابی رمز - طراحی مدرن
   ========================================================================== */

:root {
	--ca-auth-bg: #0A0D18;
	--ca-auth-card: rgba(23, 27, 46, .72);
	--ca-auth-border: rgba(255, 255, 255, .08);
	--ca-auth-input-bg: rgba(255, 255, 255, .04);
	--ca-auth-text: #F2F2F7;
	--ca-auth-muted: #8A8DA0;
	--ca-auth-accent-1: #6E56F8;
	--ca-auth-accent-2: #FF6A3D;
	--ca-auth-danger: #FF6A5C;
	--ca-auth-success: #4CD98A;
}

* { box-sizing: border-box; }

body.ca-auth-body {
	margin: 0;
	min-height: 100vh;
	background: var(--ca-auth-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "Vazirmatn", "IRANSans", Tahoma, sans-serif;
	padding: 24px;
	position: relative;
	overflow-x: hidden;
}

/* هاله‌های رنگی پس‌زمینه - عمق بصری بدون سنگین‌کردن صفحه */
body.ca-auth-body::before,
body.ca-auth-body::after {
	content: "";
	position: fixed;
	border-radius: 50%;
	filter: blur(90px);
	opacity: .28;
	pointer-events: none;
	z-index: 0;
}
body.ca-auth-body::before {
	width: 420px;
	height: 420px;
	background: var(--ca-auth-accent-1);
	top: -140px;
	inset-inline-end: -120px;
}
body.ca-auth-body::after {
	width: 360px;
	height: 360px;
	background: var(--ca-auth-accent-2);
	bottom: -140px;
	inset-inline-start: -110px;
	opacity: .2;
}

/* --- کارت اصلی --- */
.ca-auth-card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 430px;
	background: var(--ca-auth-card);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--ca-auth-border);
	border-radius: 24px;
	padding: 36px 32px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
	animation: ca-card-in .45s cubic-bezier(.2, .8, .3, 1);
}

@keyframes ca-card-in {
	from { opacity: 0; transform: translateY(18px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ca-auth-title {
	color: var(--ca-auth-text);
	font-size: 23px;
	font-weight: 700;
	text-align: center;
	margin: 0 0 26px;
	letter-spacing: -.3px;
}

/* --- تب‌های ورود/ثبت‌نام --- */
.ca-auth-tabs {
	position: relative;
	display: flex;
	background: rgba(0, 0, 0, .25);
	border: 1px solid var(--ca-auth-border);
	border-radius: 14px;
	padding: 5px;
	margin-bottom: 26px;
}
.ca-auth-tab {
	flex: 1;
	text-align: center;
	padding: 11px 0;
	border-radius: 10px;
	color: var(--ca-auth-muted);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ca-auth-tab:hover {
	color: var(--ca-auth-text);
}
.ca-auth-tab.is-active {
	background: linear-gradient(135deg, var(--ca-auth-accent-1), var(--ca-auth-accent-2));
	color: #fff;
	font-weight: 700;
	box-shadow: 0 6px 18px rgba(110, 86, 248, .38);
}

/* --- فیلدها --- */
.ca-auth-field {
	margin-bottom: 18px;
	animation: ca-field-in .35s ease both;
}
@keyframes ca-field-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ca-auth-field label {
	display: block;
	color: var(--ca-auth-text);
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 7px;
}

.ca-auth-field input,
.ca-auth-field select {
	width: 100%;
	box-sizing: border-box;
	background: var(--ca-auth-input-bg);
	border: 1px solid var(--ca-auth-border);
	border-radius: 12px;
	padding: 13px 15px;
	color: var(--ca-auth-text);
	font-size: 14px;
	font-family: inherit;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.ca-auth-field input:hover,
.ca-auth-field select:hover {
	border-color: rgba(255, 255, 255, .16);
}
.ca-auth-field input:focus,
.ca-auth-field select:focus {
	outline: none;
	background: rgba(255, 255, 255, .07);
	border-color: var(--ca-auth-accent-1);
	box-shadow: 0 0 0 4px rgba(110, 86, 248, .16);
}
.ca-auth-field input::placeholder {
	color: rgba(138, 141, 160, .7);
}

.ca-auth-field select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238A8DA0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 15px center;
	background-size: 11px;
	padding-inline-start: 40px;
	cursor: pointer;
}

.ca-auth-field input[type="number"]::-webkit-outer-spin-button,
.ca-auth-field input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* فیلد کد یکبار مصرف - ارقام جدا و درشت‌تر برای خوانایی بهتر */
.ca-auth-otp-code-row input {
	text-align: center;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 10px;
	padding-inline-start: 10px;
	direction: ltr;
}

/* --- نمایش/مخفی کردن رمز --- */
.ca-auth-password-wrap {
	position: relative;
}
.ca-auth-toggle-pass {
	appearance: none;
	position: absolute;
	inset-inline-start: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	padding: 6px;
	border: 0;
	background: transparent;
	color: var(--ca-auth-muted);
	cursor: pointer;
	transition: color .15s ease;
}
.ca-auth-toggle-pass:hover {
	color: var(--ca-auth-text);
}
.ca-auth-toggle-pass:focus-visible {
	outline: 2px solid var(--ca-auth-accent-1);
	outline-offset: 2px;
	border-radius: 6px;
}

/* --- لینک تغییر روش ورود --- */
.ca-auth-switch-method {
	text-align: left;
	margin: -6px 0 18px;
}
.ca-auth-switch-method a {
	color: var(--ca-auth-accent-1);
	font-size: 13px;
	text-decoration: none;
	transition: opacity .15s ease;
}
.ca-auth-switch-method a:hover {
	opacity: .78;
}

/* --- دکمه‌ها --- */
.ca-auth-btn-secondary {
	width: 100%;
	background: var(--ca-auth-input-bg);
	border: 1px solid var(--ca-auth-border);
	color: var(--ca-auth-text);
	padding: 12px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 13px;
	font-family: inherit;
	transition: background .15s ease, border-color .15s ease;
}
.ca-auth-btn-secondary:hover:not(:disabled) {
	background: rgba(255, 255, 255, .08);
	border-color: rgba(255, 255, 255, .18);
}
.ca-auth-btn-secondary:disabled {
	opacity: .55;
	cursor: default;
}

.ca-auth-submit {
	position: relative;
	width: 100%;
	background: linear-gradient(135deg, var(--ca-auth-accent-1), var(--ca-auth-accent-2));
	background-size: 160% 160%;
	border: none;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	padding: 15px;
	border-radius: 12px;
	cursor: pointer;
	margin-top: 10px;
	box-shadow: 0 10px 26px rgba(110, 86, 248, .34);
	transition: transform .12s ease, box-shadow .2s ease, background-position .4s ease;
}
.ca-auth-submit:hover:not(:disabled) {
	background-position: 100% 0;
	box-shadow: 0 14px 32px rgba(110, 86, 248, .45);
}
.ca-auth-submit:active:not(:disabled) {
	transform: translateY(1px);
}
.ca-auth-submit:disabled {
	opacity: .6;
	cursor: default;
	box-shadow: none;
}

/* --- تیک قوانین و مرا به خاطر بسپار --- */
.ca-auth-terms-field input[type="checkbox"],
.ca-auth-remember-field input[type="checkbox"] {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	flex-shrink: 0;
	border-radius: 5px !important;
	padding: 0 !important;
	accent-color: var(--ca-auth-accent-1);
	cursor: pointer;
	margin-inline-end: 9px;
	vertical-align: middle;
}
.ca-auth-checkbox-label {
	display: flex !important;
	align-items: center !important;
	gap: 9px;
	font-size: 13px !important;
	font-weight: 400 !important;
	color: var(--ca-auth-muted);
	cursor: pointer;
	margin-bottom: 0 !important;
	user-select: none;
}
.ca-auth-terms-field a {
	color: var(--ca-auth-accent-1);
	text-decoration: none;
	margin-inline-start: 4px;
}
.ca-auth-terms-field a:hover {
	text-decoration: underline;
}

/* --- لینک‌های پایین کارت --- */
.ca-auth-link {
	display: block;
	text-align: center;
	margin-top: 16px;
	font-size: 13px;
	text-decoration: none;
	transition: opacity .15s ease;
}
.ca-auth-link:hover {
	opacity: .78;
}
.ca-auth-link-danger {
	color: var(--ca-auth-danger);
}

/* --- پیام‌ها --- */
#ca-auth-message {
	margin-top: 16px;
	text-align: center;
	font-size: 13px;
	color: var(--ca-auth-danger);
	min-height: 18px;
	line-height: 1.7;
}
#ca-auth-message.is-success {
	color: var(--ca-auth-success);
}

/* --- موبایل --- */
@media (max-width: 480px) {
	body.ca-auth-body {
		padding: 16px;
		align-items: flex-start;
		padding-top: 40px;
	}
	.ca-auth-card {
		padding: 28px 22px;
		border-radius: 20px;
	}
	.ca-auth-title {
		font-size: 20px;
	}
}

/* حالت در حال بارگذاری دکمه اصلی */
.ca-auth-submit.is-loading {
	color: rgba(255, 255, 255, .85);
	cursor: wait;
}
.ca-auth-submit.is-loading::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-inline-start: 9px;
	vertical-align: -2px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ca-spin .6s linear infinite;
}
@keyframes ca-spin {
	to { transform: rotate(360deg); }
}

/* --- Toast اعلان: بالای کارت، مجزا از فرم --- */
.ca-auth-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 13px 16px;
	border-radius: 12px;
	margin-bottom: 20px;
	font-size: 13px;
	line-height: 1.6;
	animation: ca-toast-in .25s ease;
}
@keyframes ca-toast-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.ca-auth-toast.is-error {
	background: rgba(255, 106, 92, .14);
	border: 1px solid rgba(255, 106, 92, .28);
	color: #FF9A94;
}
.ca-auth-toast.is-success {
	background: rgba(76, 217, 138, .12);
	border: 1px solid rgba(76, 217, 138, .28);
	color: #4CD98A;
}
.ca-auth-toast-icon {
	font-size: 18px;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 1px;
}
.ca-link-button{appearance:none;border:0;padding:0;background:transparent;color:inherit;font:inherit;text-decoration:underline;cursor:pointer}.ca-link-button:focus-visible{outline:2px solid currentColor;outline-offset:3px;border-radius:2px}
