/* =========================================
   TR Auth Panel - Full CSS (clean)
   ========================================= */

.tr-auth-page {
	--bg: #1a1628;
	--shell: #161222;
	--panel: #1c1729;
	--text: #f3f0ff;
	--muted: #a9a1c2;
	--line: rgba(255, 255, 255, 0.10);
	--input: #2a243a;
	--input-border: rgba(120, 110, 200, 0.45);
	--primary: #5b4fcf;
	--primary-hover: #6a5de0;
	--radius: 22px;
	--shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

	direction: ltr;
	min-height: 100vh;
	width: 100%;
	display: grid;
	place-items: center;
	padding: 24px;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	box-sizing: border-box;
}

.tr-auth-page *,
.tr-auth-page *::before,
.tr-auth-page *::after {
	box-sizing: border-box;
}

.tr-auth-shell {
	width: min(1100px, 100%);
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	grid-template-areas: "visual form";
	align-items: stretch;
	background: var(--shell);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Visual */
.tr-auth-visual {
	grid-area: visual;
	position: relative;
	min-height: 560px;
	padding: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: #fff;
	overflow: hidden;
	background:
		linear-gradient(180deg, rgba(10, 8, 20, 0.10) 0%, rgba(8, 6, 18, 0.55) 100%),
		var(--tr-auth-side-image) center/cover no-repeat,
		linear-gradient(160deg, #2a2148 0%, #141022 100%);
}

.tr-auth-visual__overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.30));
}

.tr-auth-visual__top {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 24px;
	direction: rtl;
}

.tr-auth-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: #fff;
	font-weight: 800;
	white-space: nowrap;
}

.tr-auth-logo__mark {
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.16);
	backdrop-filter: blur(8px);
	line-height: 1;
}

.tr-auth-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.10);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
	backdrop-filter: blur(8px);
}

.tr-auth-back:hover {
	background: rgba(255, 255, 255, 0.16);
}

.tr-auth-visual__bottom {
	position: relative;
	z-index: 2;
	margin-top: auto;
	padding: 28px 28px 32px;
	direction: rtl;
}

.tr-auth-visual__title {
	margin: 0 0 8px;
	font-size: clamp(28px, 3vw, 42px);
	line-height: 1.25;
	font-weight: 800;
	max-width: 12ch;
}

.tr-auth-visual__subtitle {
	margin: 0;
	color: rgba(255, 255, 255, 0.84);
	font-size: 14px;
}

.tr-auth-dots {
	display: none !important;
}

/* Panel */
.tr-auth-panel {
	grid-area: form;
	background: var(--panel);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 28px;
	direction: rtl;
	width: 100%;
	min-width: 0;
}

.tr-auth-panel__inner {
	width: min(400px, 100%);
}

.tr-auth-head {
	overflow: visible;
	margin-bottom: 8px;
}

.tr-auth-head h1,
.tr-auth-title {
	margin: 0 0 6px;
	font-size: 28px;
	line-height: 1.3;
	font-weight: 800;
	color: #fff;
}

.tr-auth-head p,
.tr-auth-desc {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.5;
}

.tr-auth-switch {
	border: 0;
	background: none;
	color: #b7a9ff;
	padding: 0;
	cursor: pointer;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Forms */
.tr-auth-form {
	display: none;
}

.tr-auth-form.is-active {
	display: flex;
	flex-direction: column;
}

.tr-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.tr-field {
	margin-bottom: 10px;
}

.tr-field label {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
	color: #d2cce6;
}

.tr-field input {
	width: 100%;
	height: 44px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: var(--input);
	color: #fff;
	padding: 0 12px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tr-field input::placeholder {
	color: #8f87a8;
}

.tr-field input:focus {
	border-color: var(--input-border);
	box-shadow: 0 0 0 3px rgba(91, 79, 207, 0.18);
	background: #322b45;
}

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

.tr-input-wrap input {
	padding-left: 42px;
}

.tr-input-wrap input::-ms-reveal,
.tr-input-wrap input::-ms-clear {
	display: none;
}

.tr-toggle-pass {
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: #cfc8e6;
	cursor: pointer;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	padding: 0;
}

.tr-toggle-pass:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.tr-toggle-pass.is-on {
	color: #b7a9ff;
}

.tr-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0 14px;
	font-size: 12.5px;
}

.tr-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	user-select: none;
	margin: 0;
	line-height: 1.3;
}

.tr-check input {
	width: 15px;
	height: 15px;
	accent-color: var(--primary);
	flex: 0 0 auto;
	margin: 0;
}

.tr-check--terms {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0 12px;
	font-size: 12.5px;
	line-height: 1.3;
	white-space: nowrap;
	color: var(--muted);
}

.tr-terms-text {
	display: inline;
	white-space: nowrap;
}

.tr-terms-text a,
.tr-link {
	color: #b7a9ff;
	text-decoration: none;
	white-space: nowrap;
}

.tr-link:hover,
.tr-terms-text a:hover {
	text-decoration: underline;
}

/* Buttons */
.tr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	min-height: 48px;
	padding: 0 16px;
	border-radius: 12px;
	border: 1px solid transparent;
	cursor: pointer;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	transition: 0.2s ease;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.tr-btn--primary {
	background: linear-gradient(135deg, #7c6cff 0%, #6a5af9 100%);
	color: #fff;
	box-shadow: 0 8px 24px rgba(106, 90, 249, 0.28);
}

.tr-btn--primary:hover {
	filter: brightness(1.05);
}

.tr-btn--primary:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.tr-btn--ghost,
.tr-btn--google {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.12);
	color: #efeaff;
}

.tr-btn--google {
	direction: rtl;
}

.tr-google-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	line-height: 0;
}

.tr-google-icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

.tr-google-label {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	white-space: nowrap;
}

.tr-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 14px 0 10px;
	color: #8f86a8;
	font-size: 12px;
}

.tr-divider::before,
.tr-divider::after {
	content: "";
	height: 1px;
	flex: 1;
	background: var(--line);
}

.tr-auth-social-shared,
.tr-social--single {
	display: block;
	margin-top: 0;
}

/* Alerts */
.tr-auth-alert {
	margin-bottom: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 12.5px;
	line-height: 1.5;
}

.tr-auth-alert.is-error {
	background: rgba(239, 68, 68, 0.12);
	border: 1px solid rgba(239, 68, 68, 0.35);
	color: #fecaca;
}

.tr-auth-alert.is-success {
	background: rgba(16, 185, 129, 0.12);
	border: 1px solid rgba(16, 185, 129, 0.35);
	color: #a7f3d0;
}

/* Fullpage theme cleanup */
body.tr-auth-fullpage,
body.tr-auth-fullpage .site,
body.tr-auth-fullpage #page,
body.tr-auth-fullpage #content,
body.tr-auth-fullpage .site-content,
body.tr-auth-fullpage .content-area,
body.tr-auth-fullpage .entry-content,
body.tr-auth-fullpage article,
body.tr-auth-fullpage .hentry {
	background: #1a1628 !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
	width: 100% !important;
	min-height: 100vh;
}

body.tr-auth-fullpage .site-header,
body.tr-auth-fullpage .site-footer,
body.tr-auth-fullpage header.site-header,
body.tr-auth-fullpage footer.site-footer,
body.tr-auth-fullpage .entry-header,
body.tr-auth-fullpage .entry-title,
body.tr-auth-fullpage .page-header {
	display: none !important;
}

/* Tablet */
@media (max-width: 920px) {
	.tr-auth-page {
		padding: 12px;
		align-items: start;
	}

	.tr-auth-shell {
		grid-template-columns: 1fr;
		grid-template-areas:
			"visual"
			"form";
		width: 100%;
	}

	.tr-auth-visual {
		min-height: 180px;
		justify-content: flex-start;
	}

	/* لوگو + بازگشت: بالاتر در تبلت */
	.tr-auth-visual__top {
		padding: 10px 16px 8px;
		margin: 0;
		align-items: center;
	}

	.tr-auth-logo,
	.tr-auth-back {
		margin-top: 0;
	}

	.tr-auth-visual__title {
		max-width: none;
		font-size: 26px;
	}

	.tr-auth-visual__bottom {
		padding: 12px 16px 16px;
	}

	.tr-auth-panel {
		padding: 20px 16px 24px;
		align-items: flex-start;
	}

	.tr-auth-panel__inner {
		width: 100%;
	}

	.tr-check--terms,
	.tr-terms-text {
		font-size: 12px;
		white-space: normal;
	}
}

/* Mobile */
@media (max-width: 560px) {
	.tr-auth-page {
		padding: 0;
		min-height: 100vh;
		display: block;
		background: var(--panel);
	}

	.tr-auth-shell {
		width: 100%;
		min-height: 100vh;
		border-radius: 0;
		border: 0;
		box-shadow: none;
		grid-template-columns: 1fr;
		grid-template-areas:
			"visual"
			"form";
	}

	.tr-auth-visual {
		min-height: 160px;
		justify-content: flex-start;
		padding-top: 0;
		padding-bottom: 0;
	}

	/* لوگو + بازگشت: بالاتر در موبایل */
	.tr-auth-visual__top {
		padding: 5px 14px 6px;
		margin: 0;
		gap: 10px;
		align-items: center;
	}

	.tr-auth-logo {
		margin: 0;
	}

	.tr-auth-logo__mark {
		min-width: 32px;
		height: 32px;
	}

	.tr-auth-back {
		margin: 0;
		height: 32px;
		padding: 0 1px;
		font-size: 12px;
	}

	.tr-auth-visual__bottom {
		margin-top: auto;
		padding: 10px 14px 14px;
	}

	.tr-auth-visual__title {
		font-size: 24px;
		max-width: 14ch;
	}

	.tr-auth-panel {
		padding: 18px 16px 28px;
	}

	.tr-auth-head h1,
	.tr-auth-title {
		font-size: 24px;
	}

	.tr-grid-2 {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.tr-check--terms {
		white-space: normal;
		align-items: flex-start;
	}

	.tr-terms-text {
		white-space: normal;
	}
}
