/**
 * Guest auth — full-screen modern login / register.
 */

.sfp-gate--auth {
	--sfp-gate-bg: #070816;
	--sfp-gate-surface: rgba(255, 255, 255, 0.94);
	--sfp-gate-card: #ffffff;
	--sfp-gate-ink: #0f172a;
	--sfp-gate-muted: #64748b;
	--sfp-gate-border: rgba(99, 102, 241, 0.2);
	--sfp-gate-accent: #6366f1;
	--sfp-gate-accent-2: #ec4899;
	--sfp-gate-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
	--sfp-gate-glow: rgba(99, 102, 241, 0.45);
	font-family: var(--sfp-font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	min-height: 100vh;
	min-height: 100dvh;
	color: var(--sfp-gate-ink);
	position: relative;
	overflow-x: clip;
	background: var(--sfp-gate-bg);
}

html[data-sfp-theme='dark'] .sfp-gate--auth {
	--sfp-gate-surface: rgba(19, 21, 39, 0.92);
	--sfp-gate-card: #131527;
	--sfp-gate-ink: #e2e8f0;
	--sfp-gate-muted: #94a3b8;
	--sfp-gate-border: rgba(129, 140, 248, 0.28);
}

/* Ambient background */
.sfp-gate__ambient {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	overflow: hidden;
}

.sfp-gate__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.55;
	animation: sfpGateOrb 14s ease-in-out infinite;
}

.sfp-gate__orb--1 {
	width: 420px;
	height: 420px;
	background: #6366f1;
	top: -120px;
	left: -80px;
}

.sfp-gate__orb--2 {
	width: 360px;
	height: 360px;
	background: #ec4899;
	top: 30%;
	right: -100px;
	animation-delay: -4s;
}

.sfp-gate__orb--3 {
	width: 280px;
	height: 280px;
	background: #38bdf8;
	bottom: -60px;
	left: 35%;
	animation-delay: -8s;
}

.sfp-gate__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

@keyframes sfpGateOrb {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(24px, -18px) scale(1.06); }
	66% { transform: translate(-16px, 12px) scale(0.94); }
}

/* Layout */
.sfp-gate__layout {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
	min-height: 100vh;
	min-height: 100dvh;
}

@media (max-width: 960px) {
	.sfp-gate__layout {
		grid-template-columns: 1fr;
	}
	.sfp-gate__showcase {
		display: none;
	}
}

/* Showcase (left) */
.sfp-gate__showcase {
	padding: 48px 40px 40px 56px;
	display: flex;
	align-items: center;
	color: #e2e8f0;
}

.sfp-gate__showcase-inner {
	max-width: 520px;
	animation: sfpGateFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sfpGateFadeUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

.sfp-gate__showcase-brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: #fff;
	margin-bottom: 28px;
}

.sfp-gate__showcase-logo {
	display: flex;
	width: 40px;
	height: 40px;
}

.sfp-gate__showcase-logo .sfp-brand-mark--inline {
	width: 40px;
	height: 40px;
}

.sfp-gate__showcase-name {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.sfp-gate__showcase-eyebrow {
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #a5b4fc;
}

.sfp-gate__showcase-title {
	margin: 0 0 14px;
	font-size: clamp(32px, 4vw, 44px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.03em;
	background: linear-gradient(135deg, #fff 0%, #c7d2fe 55%, #f9a8d4 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.sfp-gate__showcase-lede {
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 1.65;
	color: #94a3b8;
	max-width: 46ch;
}

.sfp-gate__features {
	list-style: none;
	margin: 0 0 36px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.sfp-gate__feature {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	font-weight: 600;
	color: #cbd5e1;
	animation: sfpGateFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sfp-gate__feature:nth-child(2) { animation-delay: 0.08s; }
.sfp-gate__feature:nth-child(3) { animation-delay: 0.16s; }

.sfp-gate__feature-icon {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(99, 102, 241, 0.2);
	color: #c7d2fe;
	flex-shrink: 0;
}

.sfp-gate__feature-icon svg {
	width: 18px;
	height: 18px;
}

/* Floating mock UI */
.sfp-gate__mock {
	position: relative;
	height: 200px;
	animation: sfpGateFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.sfp-gate__mock-card {
	position: absolute;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(12px);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sfp-gate__mock-card--1 {
	width: 200px;
	left: 0;
	top: 20px;
	animation: sfpGateFloat 5s ease-in-out infinite;
}

.sfp-gate__mock-card--2 {
	width: 120px;
	right: 20px;
	top: 0;
	flex-direction: row;
	gap: 6px;
	justify-content: center;
	animation: sfpGateFloat 6s ease-in-out infinite reverse;
}

.sfp-gate__mock-bar {
	display: block;
	height: 8px;
	border-radius: 999px;
	background: linear-gradient(90deg, #6366f1, #a855f7);
}

.sfp-gate__mock-bar--mid { width: 75%; opacity: 0.7; }
.sfp-gate__mock-bar--short { width: 50%; opacity: 0.45; }

.sfp-gate__mock-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ec4899;
	animation: sfpGateDot 1.6s ease-in-out infinite;
}

.sfp-gate__mock-dot:nth-child(2) { animation-delay: 0.2s; background: #6366f1; }
.sfp-gate__mock-dot:nth-child(3) { animation-delay: 0.4s; background: #38bdf8; }

.sfp-gate__mock-funnel {
	position: absolute;
	left: 38%;
	bottom: 8px;
	width: 100px;
	height: 90px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	animation: sfpGateFloat 4.5s ease-in-out infinite;
}

.sfp-gate__mock-funnel span {
	display: block;
	height: 18px;
	border-radius: 4px;
	background: linear-gradient(90deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.5));
}

.sfp-gate__mock-funnel span:nth-child(1) { width: 100%; }
.sfp-gate__mock-funnel span:nth-child(2) { width: 72%; }
.sfp-gate__mock-funnel span:nth-child(3) { width: 44%; border-radius: 999px; height: 14px; }

@keyframes sfpGateFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

@keyframes sfpGateDot {
	0%, 100% { opacity: 0.35; transform: scale(0.85); }
	50% { opacity: 1; transform: scale(1); }
}

/* Auth column (right) */
.sfp-gate__auth {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px 40px;
	background: var(--sfp-gate-surface);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-left: 1px solid rgba(255, 255, 255, 0.06);
	box-shadow: -24px 0 80px rgba(0, 0, 0, 0.25);
}

@media (max-width: 960px) {
	.sfp-gate__auth {
		border-left: 0;
		box-shadow: none;
		min-height: 100vh;
		min-height: 100dvh;
	}
}

.sfp-gate__auth-top {
	width: 100%;
	max-width: 440px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	animation: sfpGateFadeUp 0.5s ease both;
}

.sfp-gate__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sfp-gate-muted);
	text-decoration: none;
	transition: color 0.15s ease;
}

.sfp-gate__back:hover {
	color: var(--sfp-gate-accent);
}

/* Auth card */
.sfp-gate__card {
	width: 100%;
	max-width: 440px;
	background: var(--sfp-gate-card);
	border: 1px solid var(--sfp-gate-border);
	border-radius: 24px;
	padding: 28px 28px 24px;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 24px 48px rgba(99, 102, 241, 0.12);
	animation: sfpGateCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes sfpGateCardIn {
	from { opacity: 0; transform: translateY(20px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

.sfp-gate__chip {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

.sfp-gate__chip--ok {
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(34, 197, 94, 0.28);
	color: #15803d;
}

.sfp-gate__chip--err {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.28);
	color: #b91c1c;
}

.sfp-gate__chip--info {
	background: rgba(99, 102, 241, 0.08);
	border: 1px dashed var(--sfp-gate-border);
	color: var(--sfp-gate-muted);
}

html[data-sfp-theme='dark'] .sfp-gate__chip--ok { color: #86efac; }
html[data-sfp-theme='dark'] .sfp-gate__chip--err { color: #fca5a5; }

.sfp-gate__card-head {
	margin-bottom: 20px;
}

.sfp-gate__card-title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.15;
	color: var(--sfp-gate-ink);
}

.sfp-gate__card-title[hidden],
.sfp-gate__card-sub[hidden] {
	display: none;
}

.sfp-gate__card-sub {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sfp-gate-muted);
}

/* Tab switcher */
.sfp-gate__switcher {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin-bottom: 22px;
	padding: 4px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--sfp-gate-accent) 8%, transparent);
	border: 1px solid var(--sfp-gate-border);
}

.sfp-gate__switcher-btn {
	position: relative;
	z-index: 1;
	border: 0;
	background: transparent;
	padding: 10px 12px;
	border-radius: 11px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--sfp-gate-muted);
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.sfp-gate__switcher-btn:hover:not(.is-active) {
	background-color: var(--sfp-ui-btn-hover-bg, rgba(99, 102, 241, 0.1)) !important;
	color: var(--sfp-gate-ink);
}

.sfp-gate__switcher-btn.is-active {
	color: var(--sfp-gate-ink);
}

.sfp-gate__switcher-glider {
	position: absolute;
	top: 4px;
	left: 4px;
	width: calc(50% - 4px);
	height: calc(100% - 8px);
	border-radius: 11px;
	background: var(--sfp-gate-card);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

/* Glider position is set via JS (data-sfp-auth-glider transform). */

/* Panels */
.sfp-gate__panels {
	position: relative;
	min-height: 280px;
}

.sfp-gate__panel {
	animation: sfpGatePanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sfp-gate__panel[hidden] {
	display: none !important;
}

@keyframes sfpGatePanelIn {
	from { opacity: 0; transform: translateX(8px); }
	to { opacity: 1; transform: none; }
}

.sfp-gate__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sfp-gate__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sfp-gate__label {
	font-size: 13px;
	font-weight: 700;
	color: var(--sfp-gate-ink);
}

/* Input row: flex layout (avoids absolute icon overlap with theme input styles) */
.sfp-gate__input-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 48px;
	padding: 0 10px 0 14px;
	box-sizing: border-box;
	border: 1px solid var(--sfp-gate-border);
	border-radius: 12px;
	background: color-mix(in srgb, var(--sfp-gate-card) 90%, #6366f1 10%);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sfp-gate__input-wrap:focus-within {
	border-color: var(--sfp-gate-accent);
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
	background: var(--sfp-gate-card);
}

.sfp-gate__input-icon {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	color: var(--sfp-gate-muted);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.sfp-gate__input-icon svg {
	display: block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.sfp-gate--auth .sfp-gate__input,
.sfp-gate--auth input.sfp-gate__input {
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0;
	min-height: 46px;
	height: auto;
	margin: 0;
	padding: 12px 4px !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	font: inherit;
	font-size: 15px;
	line-height: 1.35;
	color: var(--sfp-gate-ink);
	appearance: none;
	-webkit-appearance: none;
}

.sfp-gate--auth .sfp-gate__input:focus,
.sfp-gate--auth input.sfp-gate__input:focus {
	outline: none !important;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

.sfp-gate__pw-toggle {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--sfp-gate-muted);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.sfp-gate__pw-toggle:hover {
	background-color: var(--sfp-ui-btn-hover-bg, rgba(99, 102, 241, 0.1)) !important;
	color: var(--sfp-gate-accent) !important;
}

.sfp-gate__pw-toggle svg {
	display: block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.sfp-gate__pw-toggle .sfp-gate__eye-shut {
	display: none;
}

.sfp-gate__pw-toggle .sfp-gate__eye-shut.is-visible {
	display: block;
}

.sfp-gate__pw-toggle .sfp-gate__eye-open.is-hidden {
	display: none;
}

.sfp-gate__pw-toggle svg[hidden] {
	display: none !important;
}

.sfp-gate__hint {
	margin: 0;
	font-size: 12px;
	color: var(--sfp-gate-muted);
}

.sfp-gate__form-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.sfp-gate__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sfp-gate-muted);
	cursor: pointer;
}

.sfp-gate__check input {
	width: 16px;
	height: 16px;
	accent-color: var(--sfp-gate-accent);
}

.sfp-gate__text-link {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--sfp-gate-accent);
	cursor: pointer;
	text-decoration: none;
}

.sfp-gate__text-link:hover {
	color: #4f46e5;
	text-decoration: underline;
}

.sfp-gate__status {
	font-size: 13px;
	line-height: 1.45;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(99, 102, 241, 0.08);
	border: 1px solid var(--sfp-gate-border);
	color: var(--sfp-gate-ink);
}

.sfp-gate__status[hidden] {
	display: none !important;
}

.sfp-gate__status.is-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

html[data-sfp-theme='dark'] .sfp-gate__status.is-error {
	background: rgba(127, 29, 29, 0.3);
	color: #fca5a5;
}

.sfp-gate__submit {
	position: relative;
	z-index: 1;
	overflow: hidden;
	width: 100%;
	border: 0;
	border-radius: 14px;
	padding: 14px 18px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: var(--sfp-gate-grad);
	box-shadow: 0 10px 28px var(--sfp-gate-glow);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.sfp-gate__submit:hover:not(:disabled) {
	background: var(--sfp-gate-grad) !important;
	color: #fff !important;
	transform: translateY(-2px);
	filter: brightness(1.05);
	box-shadow: 0 14px 32px rgba(99, 102, 241, 0.45);
}

.sfp-gate__submit:active:not(:disabled) {
	transform: translateY(0);
}

.sfp-gate__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.sfp-gate__submit-shine {
	position: absolute;
	inset: 0;
	background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
	transform: translateX(-120%);
	animation: sfpGateShine 3.5s ease-in-out infinite;
	pointer-events: none;
}

@keyframes sfpGateShine {
	0%, 70%, 100% { transform: translateX(-120%); }
	85% { transform: translateX(120%); }
}

.sfp-gate__foot {
	margin: 18px 0 0;
	text-align: center;
	font-size: 14px;
	color: var(--sfp-gate-muted);
}

.sfp-gate__foot [hidden] {
	display: none !important;
}

/* Legacy link class (locked screen) */
.sfp-gate__link {
	color: var(--sfp-gate-accent);
	text-decoration: none;
}

/* Loading state on card */
.sfp-gate__card.is-loading {
	pointer-events: none;
	opacity: 0.92;
}

.sfp-gate__card.is-loading .sfp-gate__submit-text::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: -2px;
	animation: sfpGateSpin 0.7s linear infinite;
}

@keyframes sfpGateSpin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.sfp-gate__orb,
	.sfp-gate__mock-card,
	.sfp-gate__mock-funnel,
	.sfp-gate__mock-dot,
	.sfp-gate__submit-shine,
	.sfp-gate__showcase-inner,
	.sfp-gate__feature,
	.sfp-gate__mock,
	.sfp-gate__card,
	.sfp-gate__panel {
		animation: none !important;
	}
}
