/*!
 * Login Page Styles - Tamirat Mashhad Platform
 * * Architect & Lead Developer: Naser Rahmani
 * Contact: naser0rahmani@gmail.com | +989127766242
 * * All rights reserved.
 */

:root {
	--spc-primary: #4f46e5;
	--spc-primary-strong: #171647;
	--spc-accent: #8b5cf6;
	--spc-surface: #ffffff;
	--spc-bg: #f5f6ff;
	--spc-border: #e5e7ef;
	--spc-text: #0f172a;
	--spc-muted: #64748b;
	--spc-radius: 18px;
	--spc-shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
	--spc-font-family: 'Vazirmatn', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.spc-login-page {
	min-height: 100vh;
	margin: 0;
	padding: 0;
	background:
		radial-gradient(200px 200px at 14% 16%, rgba(79, 70, 229, 0.12), transparent 60%),
		radial-gradient(220px 220px at 86% 12%, rgba(139, 92, 246, 0.16), transparent 60%),
		linear-gradient(135deg, #eef1ff 0%, #f8f9ff 35%, #f3f6ff 100%);
}

.spc-login-wrapper {
	position: relative;
	min-height: 100vh;
	padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 28px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--spc-text);
	font-family: var(--spc-font-family);
	--wp--style--global--content-size: 850px;
}
.spc-login-wrapper *,
.spc-login-wrapper *::before,
.spc-login-wrapper *::after {
	font-family: inherit;
	box-sizing: border-box;
}

.spc-login-desktop-hero {
	display: flex;
	width: 100%;
	text-align: center;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 8px;
	margin: 0 auto 18px;
	position: relative;
	z-index: 2;
}

.spc-login-hero__title {
	margin: 0;
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 900;
	letter-spacing: 0;
	text-transform: uppercase;
}

.spc-login-hero__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.spc-login-hero__logo {
	width: 38px;
	height: 38px;
	object-fit: contain;
	flex: 0 0 auto;
	border-radius: 6px;
}

.spc-login-hero__subtitle {
	margin: 0;
	font-size: 16px;
	color: var(--spc-muted);
	font-weight: 800;
}

.spc-login-form__title {
	margin: 24px 0 0;
	font-size: 18px;
	color: var(--spc-text);
	font-weight: 600;
	text-align: center;
	color: var(--spc-primary-strong);
}

.spc-login-form__subtitle {
	margin: 0;
	font-size: 13px;
	color: var(--spc-muted);
	font-weight: 600;
	text-align: center;
}

.rotating-gradient-text {
	background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 50%, rgba(102, 126, 234, 1) 100%);
	background-size: 200% 200%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	color: transparent;
	animation: gradientRotate 8s ease infinite;
	display: inline-block;
}

.spc-login-surface {
	position: relative;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
}

.spc-login-mobile-badge {
	display: none;
	justify-content: center;
	margin: 0 0 12px;
	padding: 0 16px;
	position: relative;
	z-index: 3;
}

.spc-login-surface::before,
.spc-login-surface::after {
	content: '';
	position: absolute;
	border-radius: 999px;
	background: radial-gradient(circle at 30% 40%, rgba(79, 70, 229, 0.12), transparent 60%),
		radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.12), transparent 60%);
	filter: blur(12px);
	z-index: 1;
	inset: -80px 32px auto 32px;
	height: 140px;
	animation: spcFloat 6s ease-in-out infinite alternate;
}

.spc-login-surface::after {
	inset: auto 70px -90px 70px;
	height: 160px;
	animation-delay: 1.8s;
}

.spc-login-glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(220px 200px at 20% 55%, rgba(79, 70, 229, 0.08), transparent 65%),
		radial-gradient(260px 220px at 80% 25%, rgba(139, 92, 246, 0.1), transparent 70%);
	filter: blur(18px);
	z-index: 1;
}

.spc-login-content {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 24px;
	align-items: stretch;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(12px);
	border-radius: 24px;
	border: 1px solid rgba(228, 231, 236, 0.8);
	padding: clamp(20px, 3vw, 30px);
	box-shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
}

.spc-login-aside {
	background: linear-gradient(160deg, rgba(79, 70, 229, 0.08), rgba(255, 255, 255, 0.85));
	border: 1px solid rgba(79, 70, 229, 0.12);
	border-radius: 20px;
	padding: 22px 20px;
	display: grid;
	gap: 0;
	box-shadow: 0 14px 38px rgba(79, 70, 229, 0.08);
	animation: spcFadeUp 520ms ease;
	align-self: stretch;
}

.spc-login-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 14px;
	background: rgba(79, 70, 229, 0.12);
	color: var(--spc-primary-strong);
	font-weight: 800;
	border-radius: 12px;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
	animation: none;
}

.spc-login-title {
	font-size: clamp(18px, 2vw, 18px);
	margin:16px 0;
	line-height: 1.45;
	text-align: center;
	color: var(--spc-primary-strong);
}

.spc-login-trust {
	margin: 18px 0 0;
	padding: 18px 16px;
	border-radius: 16px;
	border: 1px solid rgba(79, 70, 229, 0.16);
	background: rgba(255, 255, 255, 0.82);
	color: var(--spc-primary-strong);
	font-weight: 800;
	line-height: 1.7;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	box-shadow: 0 12px 32px rgba(79, 70, 229, 0.08);
	text-align: center;
}

.spc-login-trust__logos {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.spc-login-trust__logos a{
	height: 80px;
}

.spc-login-trust__logo {
	width: 84px;
	height: 84px;
	border-radius: 18px;
	object-fit: contain;
	border: 1px solid rgba(79, 70, 229, 0.18);
	background: rgba(79, 70, 229, 0.08);
	flex-shrink: 0;
	box-shadow: 0 10px 28px rgba(79, 70, 229, 0.12);
}

.spc-login-trust span {
	font-size: 16px;
}

.spc-login-subtitle {
	margin: 0;
	color: var(--spc-muted);
	font-size: 15px;
	line-height: 1.6;
}

.spc-login-highlights {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: grid;
	gap: 20px;
}

.spc-login-highlights li {
	position: relative;
	padding: 12px 14px 12px 16px;
	border: 1px solid rgba(79, 70, 229, 0.14);
	border-radius: 14px;
	color: var(--spc-text);
	background: rgba(255, 255, 255, 0.7);
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
	font-size: 12px;
}

.spc-login-highlights li::before {
	content: '';
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--spc-primary) 0%, var(--spc-accent) 100%);
	box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.14);
}

.spc-login-card {
	background: var(--spc-surface);
	border: 1px solid var(--spc-border);
	border-radius: var(--spc-radius);
	padding: 24px;
	box-shadow: var(--spc-shadow);
	display: grid;
	gap: 16px;
	animation: spcFadeUp 540ms ease;
	align-self: stretch;
}

.spc-login-card__head h2 {
	margin: 8px 0 4px;
	font-size: 18px;
	color: var(--spc-text);
}

.spc-login-card__head p {
	margin: 0;
	color: var(--spc-muted);
	font-size: 14px;
	line-height: 1.6;
}

.spc-login-card__head h2,
.spc-login-card__head p,
.spc-login-title,
.spc-login-subtitle {
	max-height: 240px;
	transition: max-height 220ms ease, opacity 200ms ease, margin 200ms ease;
	overflow: hidden;
}

.spc-login-head--collapsed {
	max-height: 0;
	margin: 0 !important;
	opacity: 0;
}

.spc-login-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: linear-gradient(120deg, rgba(79, 70, 229, 0.16), rgba(139, 92, 246, 0.16));
	color: var(--spc-primary-strong);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.04em;
}

.spc-login-form {
	display: grid;
	gap: 12px;
}

.spc-login-actions {
	display: grid;
	gap: 8px;
}

.spc-login-form.is-loading {
	opacity: 0.7;
}

.spc-field {
	display: grid;
	gap: 6px;
}

.spc-otp-field {
	display: none;
}

.spc-otp-field.is-visible,
[data-spc-login].is-otp-step .spc-otp-field {
	display: grid;
}

.spc-field span {
	font-weight: 800;
	color: var(--spc-text);
	font-size: 14px;
}

.spc-field input {
	width: 100%;
	border-radius: 14px;
	border: 1px solid var(--spc-border);
	background: #f9fafb;
	padding: 14px 16px;
	font-size: 15px;
	color: var(--spc-text);
	transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 160ms ease;
}

.spc-field input:focus {
	outline: none;
	border-color: rgba(79, 70, 229, 0.65);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.16);
	background: #ffffff;
	transform: translateY(-1px);
}

.spc-field input::placeholder {
	text-align: center;
}

.spc-login-secondary {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	border: 1px dashed var(--spc-border);
	background: #f8f9ff;
	border-radius: 12px;
	padding: 11px 12px;
	color: var(--spc-muted);
	font-weight: 700;
	cursor: pointer;
	transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

[data-spc-login].is-otp-step .spc-login-secondary {
	display: inline-flex;
}

.spc-login-secondary:hover {
	color: var(--spc-primary);
	border-color: rgba(79, 70, 229, 0.36);
	background: #ffffff;
}

.spc-login-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	border: none;
	border-radius: 14px;
	padding: 14px 16px;
	color: #fff;
	background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 50%, rgba(102, 126, 234, 1) 100%);
	background-size: 200% 200%;
	background-position: 0% 50%;
	animation: gradientRotate 8s ease infinite;
	font-weight: 800;
	font-size: 18px;
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.spc-login-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 30px rgba(79, 70, 229, 0.32);
}

.spc-login-button:disabled {
	cursor: not-allowed;
	opacity: 0.7;
	box-shadow: none;
	transform: none;
}

.spc-login-button svg {
	width: 18px;
	height: 18px;
}

.spc-login-button path {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.spc-login-message,
.spc-login-alert--success,
.spc-login-alert--error {
	display: none;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 700;
}

.spc-login-message.is-visible,
.spc-login-alert--success,
.spc-login-alert--error {
	display: block;
}

.spc-login-message.is-success,
.spc-login-alert--success {
	background: #ecfdf3;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.spc-login-message.is-error,
.spc-login-alert--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.spc-login-support-link {
	color: inherit;
	text-decoration: underline;
}

.spc-login-footnote {
	margin: 0;
	font-size: 13px;
	color: var(--spc-muted);
	text-align: center;
	display: none;
}

.spc-login-copyright {
	margin: 16px 0 0;
	padding: 0 8px;
	text-align: center;
	color: var(--spc-muted);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	display: block;
}

.spc-login-card__head {
	display: none;
}

.spc-login-aside .spc-login-badge {
	display: none;
}

@media (max-width: 1024px) {
	.spc-login-content {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 769px) {
	.spc-login-card {
		order: 1;
	}

	.spc-login-aside {
		order: 2;
	}
}

@media (max-width: 768px) {
	.spc-login-content {
		grid-template-columns: 1fr;
		padding: 18px;
	}

	.spc-login-aside {
		text-align: center;
	}

	.spc-login-highlights {
		justify-items: center;
	}

	.spc-login-highlights li {
		width: 100%;
		max-width: 520px;
		justify-content: center;
	}

	.spc-login-card {
		order: 1;
		padding: 20px;
	}

	.spc-login-aside {
		order: 2;
	}

	.spc-login-wrapper {
		padding: 0;
	}

	.spc-login-surface::before,
	.spc-login-surface::after {
		animation: none;
	}

	.spc-login-card,
	.spc-login-aside {
		animation: spcFadeUpSoft 260ms ease;
	}
}

@media (max-width: 520px) {
	.spc-login-title {
		font-size: 16px;
	}

	.spc-login-highlights li {
		font-size: 13px;
	}

	.spc-login-card__head p {
		font-size: 13px;
	}
}

@keyframes gradientRotate {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

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

@keyframes spcBadgeShadow {
	0% {
		box-shadow:
			0 8px 18px rgba(79, 70, 229, 0.12),
			0 0 0 0 rgba(79, 70, 229, 0.12);
	}
	100% {
		box-shadow:
			0 8px 18px rgba(79, 70, 229, 0.09),
			0 0 0 16px rgba(79, 70, 229, 0);
	}
}

@keyframes spcFloat {
	0% {
		transform: translateY(0);
		opacity: 0.9;
	}
	100% {
		transform: translateY(12px);
		opacity: 1;
	}
}

@keyframes spcPulse {
	0% {
		box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12), 0 0 0 0 rgba(79, 70, 229, 0.18);
	}
	100% {
		box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12), 0 0 0 16px rgba(79, 70, 229, 0);
	}
}

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

/* PWA install UI */
.spc-pwa-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	padding-top: calc(10px + env(safe-area-inset-top, 0px));
	background: #ffffff;
	border-bottom: 1px solid var(--spc-border);
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
	direction: rtl;
}
.spc-pwa-banner[hidden] {
	display: none !important;
}
.spc-pwa-banner__content {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.spc-pwa-banner__logo {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
}
.spc-pwa-banner__title {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--spc-text);
	line-height: 1.2;
	white-space: normal;
	word-break: break-word;
}
.spc-pwa-banner__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.spc-pwa-banner__install {
	background: #3a35f3;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 8px 16px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 200ms ease, box-shadow 200ms ease;
}
.spc-pwa-banner__install:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(58, 53, 243, 0.3);
}
.spc-pwa-banner__install:focus-visible {
	outline: 2px solid #3a35f3;
	outline-offset: 2px;
}
.spc-pwa-banner__close {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #f1f5f9;
	color: var(--spc-text);
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
}
.spc-pwa-banner__close:hover {
	background: #e2e8f0;
}
body.spc-pwa-banner-visible .spc-login-wrapper {
	padding-top: 15px;
}

.spc-pwa-modal {
	position: fixed;
	inset: 0;
	z-index: 140;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 23, 42, 0.6);
	direction: rtl;
}
.spc-pwa-modal.is-visible {
	display: flex;
}
.spc-pwa-modal__dialog {
	width: 100%;
	max-width: 440px;
	background: #ffffff;
	border-radius: 18px;
	padding: 20px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
	text-align: right;
}
.spc-pwa-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.spc-pwa-modal__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--spc-text);
}
.spc-pwa-modal__close {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #f1f5f9;
	color: var(--spc-text);
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
}
.spc-pwa-modal__close:hover {
	background: #e2e8f0;
}
.spc-pwa-modal__intro {
	margin: 12px 0 0;
	color: var(--spc-muted);
	font-size: 0.95rem;
}
.spc-pwa-modal__list {
	margin: 12px 0 0;
	padding: 0 20px 0 0;
	list-style: decimal;
	color: var(--spc-text);
}
.spc-pwa-modal__list li {
	margin-bottom: 6px;
	line-height: 1.5;
}
.spc-pwa-modal__footer {
	margin-top: 18px;
	display: flex;
	justify-content: flex-start;
}
.spc-pwa-modal__action {
	background: #3a35f3;
	color: #ffffff;
	border: none;
	border-radius: 12px;
	padding: 10px 18px;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 200ms ease, box-shadow 200ms ease;
}
.spc-pwa-modal__action:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(58, 53, 243, 0.3);
}

@media (max-width: 640px) {
	.spc-pwa-banner {
		flex-wrap: wrap;
		padding: 10px 12px;
		padding-top: calc(10px + env(safe-area-inset-top, 0px));
	}
	.spc-pwa-banner__actions {
		width: 100%;
		justify-content: space-between;
	}
	.spc-pwa-banner__install {
		flex: 1;
	}
}

@media (max-width: 480px) {
	.spc-pwa-modal__dialog {
		padding: 16px;
		border-radius: 16px;
	}
	.spc-pwa-modal__title {
		font-size: 1rem;
	}
	.spc-pwa-modal__intro,
	.spc-pwa-modal__list {
		font-size: 0.9rem;
	}
}
