/**
 * ورود / عضویت — نِکست‌شاپ
 */

.nextshop-auth {
	--auth-accent: var(--ns-primary);
	--auth-accent-dark: var(--ns-primary-dark);
	--auth-surface: #ffffff;
	--auth-muted: #64748b;
	--auth-border: #e2e8f0;
	--auth-radius: 16px;
	--auth-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
	margin: clamp(1.5rem, 4vw, 3rem) auto;
	max-width: 960px;
	padding: 0 1rem;
}

.nextshop-auth__shell {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	background: var(--auth-surface);
	border-radius: var(--auth-radius);
	box-shadow: var(--auth-shadow);
	border: 1px solid var(--auth-border);
	overflow: hidden;
	min-height: 520px;
}

.nextshop-auth__aside {
	background: linear-gradient(145deg, #1e293b 0%, #0f172a 55%, #1e1b4b 100%);
	color: #f8fafc;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	position: relative;
}

.nextshop-auth__aside::after {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 20% 80%, rgba(239, 57, 78, 0.25), transparent 50%);
	pointer-events: none;
}

.nextshop-auth__aside-inner {
	position: relative;
	z-index: 1;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1.25rem;
}

.nextshop-auth__logo img {
	max-height: 48px;
	width: auto;
	filter: brightness(0) invert(1);
}

.nextshop-auth__site-name {
	font-size: 1.35rem;
	font-weight: 800;
}

.nextshop-auth__tagline {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.5;
}

.nextshop-auth__features {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.nextshop-auth__features li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	color: rgba(248, 250, 252, 0.88);
}

.nextshop-auth__features li::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--auth-accent);
	flex-shrink: 0;
}

.nextshop-auth__card {
	padding: clamp(1.25rem, 3vw, 2rem);
	display: flex;
	flex-direction: column;
}

.nextshop-auth__header {
	margin-bottom: 1.25rem;
	text-align: center;
}

.nextshop-auth__title {
	margin: 0 0 0.35rem;
	font-size: clamp(1.25rem, 2.5vw, 1.5rem);
	font-weight: 800;
	color: #0f172a;
}

.nextshop-auth__subtitle {
	margin: 0;
	font-size: 0.9rem;
	color: var(--auth-muted);
}

.nextshop-auth__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	padding: 0.35rem;
	background: #f1f5f9;
	border-radius: 12px;
	margin-bottom: 1.25rem;
}

.nextshop-auth__tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.7rem 0.75rem;
	border: none;
	border-radius: 10px;
	background: transparent;
	color: var(--auth-muted);
	font: inherit;
	font-weight: 700;
	font-size: 0.88rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nextshop-auth__tab:hover {
	color: #334155;
}

.nextshop-auth__tab.is-active {
	background: #fff;
	color: var(--auth-accent);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.nextshop-auth__panel-desc {
	margin: 0 0 1rem;
	font-size: 0.85rem;
	color: var(--auth-muted);
	line-height: 1.6;
}

.nextshop-auth-field {
	margin-bottom: 1rem;
}

.nextshop-auth-field label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.88rem;
	font-weight: 700;
	color: #334155;
}

.nextshop-auth-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.nextshop-auth-input-icon {
	position: absolute;
	right: 0.85rem;
	color: #94a3b8;
	pointer-events: none;
	display: flex;
}

.nextshop-auth-input-wrap--password .nextshop-auth-input {
	padding-left: 2.75rem;
}

.nextshop-auth-toggle-pw {
	position: absolute;
	left: 0.5rem;
	width: 2.25rem;
	height: 2.25rem;
	border: none;
	background: transparent;
	color: #94a3b8;
	cursor: pointer;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nextshop-auth-toggle-pw:hover {
	color: var(--auth-accent);
	background: #f8fafc;
}

.nextshop-auth-input {
	width: 100%;
	padding: 0.8rem 2.75rem 0.8rem 1rem;
	border: 1px solid var(--auth-border);
	border-radius: 10px;
	font: inherit;
	font-size: 0.95rem;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.nextshop-auth-input:focus {
	outline: none;
	border-color: var(--auth-accent);
	box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.12);
}

.nextshop-auth-input--otp {
	text-align: center;
	letter-spacing: 0.35em;
	font-size: 1.25rem;
	font-weight: 700;
	padding-left: 1rem;
	padding-right: 1rem;
}

.nextshop-auth-hint {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	color: var(--auth-muted);
}

.nextshop-auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.nextshop-auth-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	color: #475569;
	cursor: pointer;
}

.nextshop-auth-checkbox input {
	accent-color: var(--auth-accent);
}

.nextshop-auth-link {
	border: none;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--auth-accent);
	cursor: pointer;
	text-decoration: none;
}

.nextshop-auth-link:hover {
	text-decoration: underline;
	color: var(--auth-accent-dark);
}

.nextshop-auth-link--muted {
	color: var(--auth-muted);
}

.nextshop-auth-link:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	text-decoration: none;
}

.nextshop-auth-switch {
	margin: 1.25rem 0 0;
	text-align: center;
	font-size: 0.88rem;
	color: var(--auth-muted);
}

.nextshop-sms-login {
	max-width: none;
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
}

.nextshop-sms-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.nextshop-auth-message,
.nextshop-sms-message {
	margin: 0.75rem 0 0;
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	min-height: 1.25rem;
}

.nextshop-auth-message:not(:empty),
.nextshop-sms-message:not(:empty) {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.nextshop-auth-message.is-error,
.nextshop-sms-message.is-error {
	background: #fef2f2;
	color: #b91c1c;
	border-color: #fecaca;
}

.nextshop-btn-block {
	width: 100%;
}

.nextshop-auth .nextshop-btn-primary {
	background: var(--auth-accent);
	border-color: var(--auth-accent);
}

.nextshop-auth .nextshop-btn-primary:hover:not(:disabled) {
	background: var(--auth-accent-dark);
	border-color: var(--auth-accent-dark);
}

.nextshop-auth .nextshop-btn-primary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.nextshop-btn-spinner {
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: nextshop-auth-spin 0.7s linear infinite;
}

.nextshop-btn.is-loading .nextshop-btn-label {
	opacity: 0;
}

.nextshop-btn.is-loading .nextshop-btn-spinner {
	display: inline-block !important;
	position: absolute;
}

.nextshop-btn.is-loading {
	position: relative;
}

@keyframes nextshop-auth-spin {
	to {
		transform: rotate(360deg);
	}
}

.nextshop-auth-form {
	background: transparent !important;
	border-radius: 0 !important;
	gap: 0 !important;
}

.nextshop-auth-form .woocommerce-form-row {
	margin-bottom: 0 !important;
}

.nextshop-auth__footer {
	margin-top: auto;
	padding-top: 1.25rem;
	text-align: center;
}

.nextshop-auth-logged-in {
	text-align: center;
	padding: 2rem;
}

/* صفحه حساب کاربری — مهمان */
.woocommerce-account:not(.logged-in) .woocommerce {
	max-width: 100%;
}

.woocommerce-account:not(.logged-in) .entry-content,
.woocommerce-account:not(.logged-in) .site-main {
	max-width: none;
}

body.nextshop-auth-guest .nextshop-dashboard-wrap {
	display: block;
}

body.nextshop-auth-guest .nextshop-dashboard-sidebar {
	display: none;
}

/* اسکرول صحیح صفحه ورود در حالت fullscreen */
body.nextshop-my-account-fullscreen.nextshop-auth-guest {
	height: auto;
	min-height: 100dvh;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

body.nextshop-auth-guest.nextshop-my-account-fullscreen .nextshop-fullscreen-wrapper,
body.nextshop-auth-guest.nextshop-my-account-fullscreen .nextshop-page-content,
body.nextshop-auth-guest.nextshop-my-account-fullscreen .nextshop-single-page,
body.nextshop-auth-guest.nextshop-my-account-fullscreen .woocommerce {
	height: auto;
	min-height: 0;
	overflow: visible;
	flex: none;
}

body.nextshop-auth-guest.nextshop-my-account-fullscreen .nextshop-container {
	padding: 0;
}

/* نوار بالای موبایل */
.nextshop-auth__mobile-bar {
	display: none;
}

@media (max-width: 768px) {
	.nextshop-auth {
		margin: 0;
		padding: 0;
		max-width: none;
		min-height: 100dvh;
		display: flex;
		flex-direction: column;
		background: #f1f5f9;
	}

	.nextshop-auth--shortcode,
	.nextshop-auth--elementor,
	.nextshop-auth--page {
		margin: 0.75rem 0;
		padding: 0 0.75rem;
		min-height: auto;
		background: transparent;
	}

	.nextshop-auth--shortcode .nextshop-auth__mobile-bar,
	.nextshop-auth--elementor .nextshop-auth__mobile-bar,
	.nextshop-auth--page .nextshop-auth__mobile-bar {
		display: none;
	}

	.nextshop-auth--shortcode .nextshop-auth__shell,
	.nextshop-auth--elementor .nextshop-auth__shell,
	.nextshop-auth--page .nextshop-auth__shell {
		border: 1px solid var(--auth-border);
		border-radius: var(--auth-radius);
		box-shadow: var(--auth-shadow);
		background: var(--auth-surface);
	}

	.nextshop-auth--shortcode .nextshop-auth__card,
	.nextshop-auth--elementor .nextshop-auth__card,
	.nextshop-auth--page .nextshop-auth__card {
		margin-top: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.nextshop-auth__mobile-bar {
		display: grid;
		grid-template-columns: auto 1fr auto;
		align-items: center;
		gap: 0.75rem;
		padding: 0.65rem 1rem;
		padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
		background: #fff;
		border-bottom: 1px solid var(--auth-border);
		position: sticky;
		top: 0;
		z-index: 20;
		flex-shrink: 0;
	}

	.nextshop-auth__back-btn {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		padding: 0.4rem 0.5rem;
		margin: -0.4rem 0;
		border-radius: 8px;
		font-size: 0.82rem;
		font-weight: 700;
		color: #334155;
		text-decoration: none;
		min-height: 44px;
	}

	.nextshop-auth__back-btn:active {
		background: #f1f5f9;
	}

	.nextshop-auth__back-btn svg {
		transform: scaleX(-1);
		flex-shrink: 0;
	}

	.nextshop-auth__mobile-brand {
		text-align: center;
		min-width: 0;
	}

	.nextshop-auth__mobile-brand img {
		max-height: 32px;
		width: auto;
		max-width: 140px;
		object-fit: contain;
	}

	.nextshop-auth__mobile-brand span {
		font-size: 0.95rem;
		font-weight: 800;
		color: #0f172a;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		display: block;
	}

	.nextshop-auth__mobile-spacer {
		width: 44px;
	}

	.nextshop-auth__shell {
		grid-template-columns: 1fr;
		min-height: 0;
		flex: 1;
		border: none;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
		margin: 0;
	}

	.nextshop-auth__aside {
		display: none;
	}

	.nextshop-auth__card {
		padding: 1rem 1rem 1.5rem;
		padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-radius: 20px 20px 0 0;
		margin-top: 0.5rem;
		flex: 1;
		box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
	}

	.nextshop-auth__header {
		margin-bottom: 1rem;
		text-align: right;
	}

	.nextshop-auth__title {
		font-size: 1.2rem;
	}

	.nextshop-auth__subtitle {
		font-size: 0.82rem;
	}

	.nextshop-auth__tabs {
		grid-template-columns: 1fr 1fr;
		gap: 0.35rem;
		padding: 0.3rem;
		margin-bottom: 1rem;
	}

	.nextshop-auth__tab {
		min-height: 48px;
		padding: 0.65rem 0.5rem;
		font-size: 0.84rem;
	}

	.nextshop-auth__tab svg {
		width: 16px;
		height: 16px;
	}

	.nextshop-auth__panel-desc {
		font-size: 0.8rem;
		margin-bottom: 0.85rem;
		line-height: 1.55;
	}

	.nextshop-auth-input {
		min-height: 48px;
		padding-top: 0.85rem;
		padding-bottom: 0.85rem;
		font-size: 16px;
		border-radius: 12px;
	}

	.nextshop-auth-input-wrap--password .nextshop-auth-input {
		padding-left: 3rem;
	}

	.nextshop-auth-input--otp {
		letter-spacing: 0.2em;
		font-size: 1.15rem;
		min-height: 52px;
	}

	.nextshop-auth .nextshop-btn {
		min-height: 50px;
		padding: 0.85rem 1.25rem;
		font-size: 0.95rem;
		border-radius: 12px;
	}

	.nextshop-auth-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.65rem;
	}

	.nextshop-sms-meta {
		flex-direction: column;
		align-items: stretch;
		gap: 0.35rem;
	}

	.nextshop-sms-meta .nextshop-auth-link {
		text-align: center;
		padding: 0.5rem;
		min-height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.nextshop-auth__footer {
		padding-top: 1rem;
		margin-top: 0.5rem;
		border-top: 1px solid #f1f5f9;
	}

	.nextshop-auth--myaccount {
		min-height: 100dvh;
	}

	.nextshop-auth--myaccount .nextshop-auth__footer {
		display: none;
	}

	.nextshop-auth__tab,
	.nextshop-auth__back-btn,
	.nextshop-auth .nextshop-btn {
		-webkit-tap-highlight-color: transparent;
	}
}

@media (max-width: 380px) {
	.nextshop-auth__tab {
		flex-direction: column;
		gap: 0.2rem;
		font-size: 0.78rem;
	}

	.nextshop-auth__back-btn span {
		display: none;
	}

	.nextshop-auth__mobile-spacer {
		width: 36px;
	}
}
