/**
 * استایل صفحه ورود/ثبت‌نام viraving
 *
 * @package Viraving
 */

.auth-section {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
	position: relative;
	overflow: hidden;
}

.auth-container {
	max-width: 1180px;
}

.auth-layout {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: stretch;
	justify-content: center;
	width: 100%;
	max-width: 1000px;
	margin-inline: auto;
	border-radius: 5px;
	box-shadow: var(--shadow-2xl);
	overflow: hidden;
}

.auth-bg-orbs {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
}

.auth-orb {
	position: absolute;
	border-radius: 5px;
	filter: blur(100px);
	opacity: 0.25;
}

.auth-orb-1 {
	width: 400px;
	height: 400px;
	background: var(--color-primary);
	top: -100px;
	right: -100px;
}

.auth-orb-2 {
	width: 350px;
	height: 350px;
	background: var(--color-accent);
	bottom: -100px;
	left: -50px;
	opacity: 0.15;
}

.auth-card {
	position: relative;
	z-index: 1;
	flex: 1 1 440px;
	min-width: 0;
	max-width: 520px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: var(--bg-glass-strong);
	backdrop-filter: blur(24px) saturate(200%);
	-webkit-backdrop-filter: blur(24px) saturate(200%);
	border: 1px solid var(--border-glass);
	padding: 2.5rem 2rem;
}

/* ============================================================
   پنل اطلاعات و معرفی (سمت چپ)
   ============================================================ */
.auth-info-panel {
	position: relative;
	z-index: 1;
	flex: 1 1 460px;
	min-width: 0;
	max-width: 480px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: linear-gradient(150deg, var(--color-primary-dark) 0%, var(--color-primary) 55%, var(--color-primary-light) 100%);
	padding: 2.75rem 2.25rem;
	color: var(--text-inverse);
	overflow: hidden;
}

.auth-info-panel::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.16), transparent 45%),
		radial-gradient(circle at 90% 85%, rgba(var(--color-accent-rgb), 0.35), transparent 50%);
	pointer-events: none;
}

.auth-info-title {
	position: relative;
	font-size: 1.625rem;
	font-weight: 800;
	line-height: 1.45;
	margin: 0 0 1.25rem;
	color: var(--text-inverse);
}

/* ============================================================
   اسلایدر خدمات (حرکت روان و پیوسته)
   ============================================================ */
.auth-services-slider {
	position: relative;
	margin: 0 0 2rem;
	overflow: hidden;
	direction: ltr; /* چیدمان لنگر-چپ برای حلقه بی‌نهایت قابل‌پیش‌بینی */
}

.auth-services-track {
	display: flex;
	width: max-content;
	animation: auth-services-scroll 40s linear infinite;
}

.auth-service-chip {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	margin-inline-end: 0.625rem;
	padding: 0.5rem 1.1rem;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 5px;
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
	color: var(--text-inverse);
}

@keyframes auth-services-scroll {
	from { transform: translateX(-25%); }
	to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
	.auth-services-track {
		animation: none;
	}
}

.auth-feature-list {
	position: relative;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.125rem;
}

.auth-feature {
	display: flex;
	align-items: flex-start;
	gap: 0.875rem;
}

.auth-feature-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: var(--text-inverse);
}

.auth-feature-icon svg {
	width: 20px;
	height: 20px;
}

.auth-feature-text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.8125rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.78);
}

.auth-feature-text strong {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--text-inverse);
}

.auth-info-stats {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	text-align: center;
}

.auth-stat strong {
	font-size: 1.125rem;
	font-weight: 800;
	color: var(--text-inverse);
	direction: ltr;
}

.auth-stat span {
	font-size: 0.6875rem;
	color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1024px) {
	.auth-layout {
		max-width: 440px;
		box-shadow: none;
		border-radius: 0;
		overflow: visible;
	}

	.auth-info-panel {
		display: none;
	}

	.auth-card {
		border-radius: 5px;
		box-shadow: var(--shadow-2xl);
	}
}

.auth-step {
	animation: fadeInUp 0.4s ease;
}

.auth-step-hidden {
	display: none;
}

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

.auth-logo {
	text-align: center;
	margin-bottom: 1.5rem;
}

.auth-logo .logo-mark {
	display: block;
	margin: 0 auto;
	width: 64px;
	height: 64px;
}

.auth-logo .logo-mark .logo-mark-bg {
	fill: var(--color-primary, #3a3ae4);
}

.auth-title {
	font-size: 1.5rem;
	font-weight: 800;
	text-align: center;
	margin: 0 0 0.5rem;
	color: var(--text-primary);
}

.auth-subtitle {
	text-align: center;
	color: var(--text-secondary);
	font-size: 0.9375rem;
	margin: 0 0 1.75rem;
	line-height: 1.6;
}

.auth-form {
	text-align: right;
}

.auth-input-wrap {
	position: relative;
}

.auth-input-icon {
	position: absolute;
	top: 50%;
	right: 1rem;
	transform: translateY(-50%);
	color: var(--text-tertiary);
	display: flex;
	pointer-events: none;
}

.auth-input-icon svg {
	width: 20px;
	height: 20px;
}

.auth-mobile-input {
	width: 100%;
	padding: 1rem 3rem 1rem 1rem !important;
	font-size: 1.125rem !important;
	text-align: center;
	letter-spacing: 0.05em;
	font-weight: 600;
	border-width: 1.5px !important;
}

.auth-mobile-input:focus {
	border-color: var(--color-primary) !important;
	box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15) !important;
}

.auth-submit {
	margin-top: 1rem;
	font-size: 1rem;
	font-weight: 700;
}

.auth-footer-text {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.75rem;
	color: var(--text-tertiary);
}

.auth-terms-link {
	color: var(--color-primary, #3a3ae4);
	font-weight: 700;
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
	transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.auth-terms-link:hover,
.auth-terms-link:focus {
	color: var(--color-primary-light, #2f8f7e);
	border-bottom-style: solid;
}

.form-message {
	margin-top: 1rem;
	min-height: 0;
}

.form-message:not(:empty) {
	animation: fadeInUp 0.3s ease;
}

/* مرحله تایید */
.auth-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	background: none;
	border: none;
	color: var(--text-secondary);
	font-size: 0.875rem;
	cursor: pointer;
	padding: 0;
	margin-bottom: 1.5rem;
	transition: color 0.2s ease;
}

.auth-back-btn:hover {
	color: var(--color-primary);
}

.auth-verify-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 1rem;
	border-radius: 5px;
	background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.15), rgba(var(--color-primary-rgb), 0.05));
	color: var(--color-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border-primary);
}

.auth-verify-icon svg {
	width: 28px;
	height: 28px;
}

/* ورودی‌های OTP */
.otp-inputs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	direction: ltr;
	max-width: 100%;
}

.otp-input {
	width: 48px;
	height: 56px;
	text-align: center;
	font-size: 1.5rem;
	font-weight: 700;
	border: 1.5px solid var(--border-color-strong);
	border-radius: 5px;
	background: var(--bg-surface);
	color: var(--text-primary);
	transition: all 0.2s ease;
	padding: 0;
}

.otp-input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
	transform: scale(1.05);
}

.otp-input.filled {
	border-color: var(--color-primary);
	background: rgba(var(--color-primary-rgb), 0.04);
}

/* ارسال مجدد کد */
.auth-resend {
	text-align: center;
	margin-top: 1.5rem;
	min-height: 1.5rem;
}

.resend-text {
	font-size: 0.8125rem;
	color: var(--text-tertiary);
}

.resend-text #countdown {
	color: var(--color-primary);
	font-weight: 700;
	font-family: monospace;
}

.resend-btn {
	background: none;
	border: none;
	color: var(--color-primary);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	transition: opacity 0.2s ease;
}

.resend-btn:hover {
	opacity: 0.8;
	text-decoration: underline;
}

/* پیام‌های خطا و موفقیت */
.form-message .alert {
	padding: 0.75rem 1rem;
	border-radius: 5px;
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.form-message .alert-error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.25);
	color: #dc2626;
}

.form-message .alert-success {
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.25);
	color: #16a34a;
}

/* ریسپانسیو */
@media (max-width: 480px) {
	.auth-card {
		padding: 2rem 1.5rem;
	}

	.otp-input {
		width: 40px;
		height: 48px;
		font-size: 1.25rem;
	}

	.otp-inputs {
		gap: 0.375rem;
	}

	.auth-title {
		font-size: 1.25rem;
	}
}

/* ============================================================
   اندازه‌های پویا بر اساس تعداد ارقام OTP
   ============================================================ */

/* ۴ رقم - بزرگ‌تر و خواناتر */
.otp-inputs.otp-length-4 .otp-input {
	width: 60px;
	height: 68px;
	font-size: 1.875rem;
}

@media (max-width: 480px) {
	.otp-inputs.otp-length-4 .otp-input {
		width: 52px;
		height: 60px;
		font-size: 1.625rem;
	}
}

/* ۳ رقم */
.otp-inputs.otp-length-3 .otp-input {
	width: 66px;
	height: 72px;
	font-size: 2rem;
}

/* ۵ و ۶ رقم - متوسط */
.otp-inputs.otp-length-5 .otp-input,
.otp-inputs.otp-length-6 .otp-input {
	width: 48px;
	height: 56px;
	font-size: 1.5rem;
}

/* ۷ و ۸ رقم - کوچک‌تر */
.otp-inputs.otp-length-7 .otp-input,
.otp-inputs.otp-length-8 .otp-input {
	width: 38px;
	height: 48px;
	font-size: 1.25rem;
	gap: 0.25rem;
}

.otp-inputs.otp-length-7,
.otp-inputs.otp-length-8 {
	gap: 0.3rem;
}
