/* =====================================================
   MohammadAli Nari Theme — Auth (Login / Register)
   ===================================================== */

.n-auth-page .n-main {
	display: grid;
	align-content: center;
	min-height: calc(100dvh - var(--header-h));
	padding-block: clamp(24px, 4vw, 64px) clamp(40px, 6vw, 80px);
}

.n-auth {
	width: min(100% - 2 * clamp(20px, 4vw, 48px), 1180px);
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
	align-items: stretch;
	gap: clamp(24px, 4vw, 64px);
	position: relative;
}

/* ---------- Decorative ---------- */

.n-auth::before,
.n-auth::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	z-index: 0;
}

.n-auth::before {
	width: 460px;
	height: 460px;
	inset-block-start: -120px;
	inset-inline-start: -160px;
	background: radial-gradient(closest-side, rgba(139, 124, 246, .16), transparent 72%);
	filter: blur(6px);
}

.n-auth::after {
	width: 380px;
	height: 380px;
	inset-block-end: -140px;
	inset-inline-end: -120px;
	background: radial-gradient(closest-side, rgba(255, 109, 77, .13), transparent 72%);
	filter: blur(6px);
}

/* ---------- Aside ---------- */

.n-auth__aside {
	position: relative;
	z-index: 1;
	border-radius: var(--r-xl);
	overflow: hidden;
	background: linear-gradient(160deg, var(--indigo-deep) 0%, var(--indigo) 48%, var(--violet) 100%);
	color: var(--paper);
	box-shadow: var(--shadow-lg);
}

.n-auth__aside-inner {
	position: relative;
	z-index: 1;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 22px;
	padding: clamp(32px, 4vw, 56px);
}

.n-auth__aside-glow {
	position: absolute;
	width: 300px;
	height: 300px;
	border-radius: 50%;
	inset-block-end: -110px;
	inset-inline-start: -110px;
	background: radial-gradient(closest-side, rgba(255, 196, 155, .4), transparent 70%);
	pointer-events: none;
}

.n-auth__spark {
	width: 62px;
	height: 62px;
	display: grid;
	place-items: center;
	border-radius: 20px;
	background: rgba(250, 246, 238, .13);
	border: 1px solid rgba(250, 246, 238, .22);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.n-auth__spark .n-icon { width: 30px; height: 30px; color: var(--peach); }

.n-auth__aside-title {
	font-size: clamp(1.6rem, 2.6vw, 2.2rem);
	line-height: 1.45;
}

.n-auth__aside-text {
	color: rgba(250, 246, 238, .82);
	font-size: .95rem;
	max-width: 38ch;
}

.n-auth__perks {
	display: grid;
	gap: 14px;
	margin-top: 10px;
}

.n-auth__perks li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: .92rem;
	font-weight: 600;
	color: rgba(250, 246, 238, .92);
}

.n-auth__perks .n-icon {
	width: 19px;
	height: 19px;
	flex: none;
	color: var(--peach);
}

/* ---------- Card ---------- */

.n-auth__panel-wrap {
	position: relative;
	z-index: 1;
	min-width: 0;
}

.n-auth__panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
	box-shadow: var(--shadow-lg);
	padding: clamp(28px, 4vw, 46px);
}

.n-auth__mark {
	display: inline-grid;
	place-items: center;
	margin-bottom: 20px;
	filter: drop-shadow(0 12px 26px rgba(139, 124, 246, .45));
}

.n-auth__mark svg { border-radius: 12px; }

/* ---------- Tabs ---------- */

.n-auth__tabs {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 5px;
	margin-bottom: clamp(20px, 3vw, 30px);
}

.n-auth__thumb {
	position: absolute;
	z-index: 0;
	inset-block: 5px;
	inset-inline-start: 5px;
	width: calc(50% - 5px);
	border-radius: 999px;
	background: linear-gradient(120deg, var(--indigo), var(--violet));
	box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .6);
	transition: transform .45s var(--ease-out);
}

[dir="rtl"] .n-auth__tabs[data-mode="register"] .n-auth__thumb { transform: translateX(-100%); }

html:not([dir="rtl"]) .n-auth__tabs[data-mode="register"] .n-auth__thumb { transform: translateX(100%); }

.n-auth__tab {
	position: relative;
	z-index: 1;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 13px 12px;
	border-radius: 999px;
	font-family: inherit;
	font-size: .95rem;
	font-weight: 700;
	color: var(--ink-3);
	transition: color .3s var(--ease);
}

.n-auth__tab:hover { color: var(--ink); }
.n-auth__tab[aria-selected="true"] { color: #fff; }
.n-auth__tab:focus-visible { outline-offset: -3px; }

/* ---------- Notice ---------- */

.n-auth__notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border-radius: 14px;
	padding: 13px 16px;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.8;
	margin-bottom: 20px;
}

.n-auth__notice .n-icon,
.n-auth__notice svg {
	width: 19px;
	height: 19px;
	flex: none;
	margin-top: 3px;
}

.n-auth__notice--error {
	background: rgba(255, 109, 77, .09);
	border: 1px solid rgba(255, 109, 77, .28);
	color: #C43A1E;
}

.n-auth__notice--ok {
	background: rgba(14, 159, 110, .08);
	border: 1px solid rgba(14, 159, 110, .28);
	color: #0B7A55;
}

/* ---------- Panels ---------- */

.n-auth__body[data-active="false"] { display: none; }

.n-auth__body[data-active="true"] {
	animation: n-auth-in .5s var(--ease-out) both;
}

@keyframes n-auth-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.n-auth__body.is-shake {
	animation: n-auth-shake .5s var(--ease);
}

@keyframes n-auth-shake {
	10%, 90% { transform: translateX(-2px); }
	20%, 80% { transform: translateX(4px); }
	30%, 50%, 70% { transform: translateX(-7px); }
	40%, 60% { transform: translateX(7px); }
}

.n-auth__title {
	font-size: clamp(1.5rem, 2.4vw, 1.95rem);
	line-height: 1.4;
	margin-bottom: 8px;
}

.n-auth__subtitle {
	color: var(--ink-2);
	font-size: .95rem;
	margin-bottom: clamp(20px, 3vw, 28px);
}

.n-auth__form { margin: 0; }

.n-field__hint {
	font-size: .8rem;
	font-weight: 500;
	color: var(--ink-3);
}

/* ---------- Password field ---------- */

.n-pass { position: relative; display: block; }

.n-pass input { padding-inline-end: 52px; }

.n-pass__toggle {
	position: absolute;
	inset-inline-end: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--ink-3);
	cursor: pointer;
	transition: color .25s ease, background-color .25s ease;
}

.n-pass__toggle:hover { color: var(--ink); background: rgba(25, 21, 36, .06); }

.n-pass__slash { opacity: 0; transition: opacity .2s ease; }
.n-pass__toggle.is-shown .n-pass__slash { opacity: 1; }

/* ---------- Row: remember + forgot ---------- */

.n-auth__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	margin: -4px 0 22px;
}

.n-check {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: .9rem;
	font-weight: 600;
	color: var(--ink-2);
}

.n-check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.n-check__box {
	width: 21px;
	height: 21px;
	flex: none;
	display: grid;
	place-items: center;
	border-radius: 7px;
	border: 1.5px solid var(--line-strong);
	background: var(--paper);
	transition: background-color .25s var(--ease), border-color .25s var(--ease);
}

.n-check__box::after {
	content: "";
	width: 5px;
	height: 9px;
	border: 2px solid #fff;
	border-top: 0;
	border-inline-start: 0;
	transform: rotate(45deg) scale(0);
	margin-top: -3px;
	transition: transform .2s var(--ease);
}

.n-check input:checked + .n-check__box {
	background: linear-gradient(135deg, var(--indigo), var(--violet));
	border-color: transparent;
}

.n-check input:checked + .n-check__box::after { transform: rotate(45deg) scale(1); }

.n-check input:focus-visible + .n-check__box {
	outline: 2px solid var(--indigo);
	outline-offset: 2px;
}

.n-auth__forgot {
	font-size: .9rem;
	font-weight: 700;
	color: var(--indigo);
	transition: color .25s ease;
}

.n-auth__forgot:hover { color: var(--indigo-deep); text-decoration: underline; }

/* ---------- Submit & switch ---------- */

.n-auth__submit {
	width: 100%;
	justify-content: center;
	padding-block: 18px;
	font-size: 1rem;
}

.n-auth__switch {
	margin: 22px 0 0;
	text-align: center;
	font-size: .9rem;
	color: var(--ink-2);
}

.n-auth__switch-btn {
	border: 0;
	background: none;
	padding: 2px 4px;
	font-family: inherit;
	font-size: .9rem;
	font-weight: 800;
	color: var(--indigo);
	cursor: pointer;
	border-bottom: 1.5px dashed rgba(79, 70, 229, .45);
	transition: color .25s ease, border-color .25s ease;
}

.n-auth__switch-btn:hover {
	color: var(--indigo-deep);
	border-color: var(--indigo-deep);
}

/* ---------- Plugin extra fields ---------- */

.n-auth__extra {
	display: grid;
	gap: 14px;
	margin-bottom: 20px;
}

.n-auth__extra p { margin: 0; }

.n-auth__extra label {
	display: block;
	font-size: .9rem;
	font-weight: 700;
	color: var(--ink-2);
	margin-bottom: 8px;
}

.n-auth__extra input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.n-auth__extra select {
	width: 100%;
	background: var(--paper);
	border: 1px solid var(--line-strong);
	border-radius: 14px;
	padding: 13px 18px;
	transition: border-color .25s ease, box-shadow .25s ease;
}

.n-auth__extra input:focus,
.n-auth__extra select:focus {
	outline: none;
	border-color: var(--indigo);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

/* ---------- Logged-in state ---------- */

.n-auth__logged {
	text-align: center;
	padding-block: clamp(8px, 2vw, 20px);
	animation: n-auth-in .5s var(--ease-out) both;
}

.n-auth__avatar {
	width: 88px;
	height: 88px;
	margin: 0 auto 20px;
	border-radius: 50%;
	padding: 4px;
	background: var(--grad-main);
	box-shadow: 0 16px 38px -12px rgba(139, 124, 246, .55);
}

.n-auth__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 3px solid var(--surface);
	object-fit: cover;
	background: var(--paper-2);
}

.n-auth__logged-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 26px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.n-auth { grid-template-columns: 1fr; max-width: 560px; }
	.n-auth__aside { display: none; }
}

@media (max-width: 520px) {
	.n-auth__panel { padding: 26px 20px 30px; border-radius: var(--r-lg); }
	.n-auth__row { flex-direction: column; align-items: stretch; }
	.n-auth__row .n-check { justify-content: center; }
	.n-auth__forgot { text-align: center; }
	.n-form__grid { grid-template-columns: 1fr !important; gap: 0; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.n-auth__body[data-active="true"],
	.n-auth__logged,
	.n-auth__thumb { animation: none; transition: none; }
	.n-auth__body.is-shake { animation: none; }
}
