.auth-body {
	min-height: 100svh;
	color: var(--foreground);
	background: var(--background);
}

.auth-page {
	position: relative;
	overflow: hidden;
	min-height: 100svh;
	padding: calc(var(--spacing) * 6) calc(var(--spacing) * 4) calc(var(--spacing) * 8);
}

.auth-page__glow {
	position: absolute;
	top: -20%;
	right: -30%;
	width: 70vw;
	height: 70vw;
	background: radial-gradient(circle, color-mix(in oklch, var(--primary) 28%, transparent) 0%, transparent 68%);
	pointer-events: none;
}

.auth-page__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(color-mix(in oklch, var(--primary) 8%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in oklch, var(--primary) 8%, transparent) 1px, transparent 1px);
	background-size: 2.5rem 2.5rem;
	mask-image: radial-gradient(ellipse 80% 60% at 70% 40%, #000 20%, transparent 75%);
	pointer-events: none;
	opacity: 0.55;
}

.auth-page__stage {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: calc(var(--spacing) * 10);
	width: min(100%, 72rem);
	margin-inline: auto;
	min-height: calc(100svh - calc(var(--spacing) * 14));
	justify-content: center;
}

.auth-hero {
	max-width: 28rem;
	animation: auth-rise 0.7s ease both;
}

.auth-hero__brand {
	display: inline-flex;
	align-items: center;
	gap: calc(var(--spacing) * 3);
	margin-bottom: calc(var(--spacing) * 8);
	font-size: var(--text-xl);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.auth-hero__logo {
	display: block;
	flex-shrink: 0;
}

.auth-hero__title {
	margin-bottom: calc(var(--spacing) * 4);
	font-size: clamp(2rem, 7vw, 3.25rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.045em;
}

.auth-hero__text {
	margin-bottom: calc(var(--spacing) * 8);
	max-width: 26rem;
	color: var(--muted-foreground);
	font-size: var(--text-lg);
	line-height: 1.45;
}

.auth-hero__actions {
	display: flex;
	flex-direction: column;
	gap: calc(var(--spacing) * 3);
	width: min(100%, 22rem);
}

.auth-hero__button {
	display: inline-flex;
	width: 100%;
	justify-content: center;
	gap: calc(var(--spacing) * 3);
	padding: calc(var(--spacing) * 3.5) calc(var(--spacing) * 5);
	font-weight: 600;
}

.auth-hero__button--google,
.auth-hero__button--microsoft {
	color: var(--primary-foreground);
	background: var(--foreground);
	border-color: var(--foreground);
	box-shadow: 0 12px 28px color-mix(in oklch, var(--foreground) 22%, transparent);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-hero__button--google:hover,
.auth-hero__button--microsoft:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 32px color-mix(in oklch, var(--primary) 28%, transparent);
}

.auth-hero__button svg {
	width: 1.25rem;
	height: 1.25rem;
}

.auth-scene {
	width: 100%;
	max-width: 26rem;
	margin-inline: auto;
	animation: auth-rise 0.85s ease 0.12s both;
}

.auth-scene__stack {
	position: relative;
	min-height: 28rem;
}

.auth-team,
.auth-demo {
	position: absolute;
	inset: 0;
}

.auth-team {
	z-index: 2;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--card);
	border: 1px solid color-mix(in oklch, var(--primary) 18%, var(--border));
	border-radius: var(--radius-2xl);
	box-shadow:
		0 1px 0 color-mix(in oklch, var(--card) 70%, transparent) inset,
		0 24px 48px color-mix(in oklch, var(--foreground) 14%, transparent);
	animation: auth-team-exit 0.45s ease 2.55s forwards;
}

.auth-team__header {
	padding: calc(var(--spacing) * 5) calc(var(--spacing) * 5) calc(var(--spacing) * 3);
	background: linear-gradient(180deg, var(--card), var(--background));
	border-bottom: 1px solid var(--border);
}

.auth-team__kicker {
	margin: 0 0 calc(var(--spacing) * 1);
	color: var(--muted-foreground);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.auth-team__title {
	font-size: var(--text-lg);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.auth-team__list {
	display: flex;
	flex-direction: column;
	gap: calc(var(--spacing) * 2);
	margin: 0;
	padding: calc(var(--spacing) * 4);
	list-style: none;
}

.auth-team__member {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: calc(var(--spacing) * 3);
	padding: calc(var(--spacing) * 3);
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	opacity: 0;
	transform: translateY(0.6rem);
	animation: auth-bubble 0.45s ease forwards;
}

.auth-team__member--1 { animation-delay: 0.35s; }
.auth-team__member--2 { animation-delay: 0.55s; }
.auth-team__member--3 { animation-delay: 0.75s; }

.auth-team__member--target {
	animation:
		auth-bubble 0.45s ease 0.35s forwards,
		auth-member-press 0.28s ease 2.35s forwards;
}

.auth-team__avatar {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	color: var(--primary-foreground);
	font-size: var(--text-sm);
	font-weight: 700;
	border-radius: var(--radius-full);
}

.auth-team__avatar--mario { background: var(--primary); }
.auth-team__avatar--ada { background: color-mix(in oklch, var(--primary) 72%, var(--foreground)); }
.auth-team__avatar--noah { background: color-mix(in oklch, var(--primary) 45%, var(--foreground)); }

.auth-team__meta {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 0.15rem;
}

.auth-team__meta strong {
	font-size: var(--text-sm);
	letter-spacing: -0.01em;
}

.auth-team__meta small {
	overflow: hidden;
	color: var(--muted-foreground);
	font-size: var(--text-xs);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.auth-team__status {
	color: color-mix(in oklch, var(--accent) 55%, var(--foreground));
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.auth-demo {
	z-index: 1;
	opacity: 0;
	transform: translateY(0.75rem) scale(0.98);
	pointer-events: none;
	animation: auth-demo-enter 0.5s ease 2.65s forwards;
}

.auth-demo__window {
	--primary: oklch(0.25 0 0);
	position: relative;
	height: 100%;
	min-height: 28rem;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-2xl);
	box-shadow:
		0 1px 0 color-mix(in oklch, var(--card) 70%, transparent) inset,
		0 24px 48px color-mix(in oklch, var(--foreground) 14%, transparent);
}

.auth-demo .chat {
	min-height: 28rem;
}

.auth-demo .chat__transcript {
	padding: calc(var(--spacing) * 5) calc(var(--spacing) * 4) calc(var(--spacing) * 4);
}

.auth-demo .chat__thread {
	margin-bottom: 0;
}

.auth-demo .chat__thread > summary {
	list-style: none;
	cursor: default;
}

.auth-demo .chat__footer {
	padding-bottom: calc(var(--spacing) * 3);
}

/* Collapsed until their cue — no reserved height. */
.auth-demo__msg,
.auth-demo__replies,
.auth-demo__slot {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
}

.auth-demo__msg-body,
.auth-demo__replies-inner,
.auth-demo__slot-inner {
	min-height: 0;
	overflow: hidden;
}

.auth-demo__msg--user {
	animation: auth-message-reveal 0.4s ease 5.15s forwards;
}

.auth-demo__replies {
	margin-left: 0;
	padding-left: 0;
	border-left-width: 0;
	animation: auth-replies-reveal 0.35s ease 5.55s forwards;
}

.auth-demo__slot {
	position: relative;
}

.auth-demo__slot--reply {
	animation: auth-slot-open 0.25s ease 5.55s forwards;
}

.auth-demo__slot--done {
	animation: auth-slot-open 0.25s ease 7.2s forwards;
}

.auth-demo__slot-inner {
	position: relative;
	min-height: 0;
	overflow: hidden;
}

.auth-demo__msg--reply {
	animation: auth-message-reveal 0.4s ease 6.4s forwards;
}

.auth-demo__msg--done {
	animation: auth-message-reveal 0.4s ease 8.1s forwards;
}

.auth-demo__typing {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	opacity: 0;
}

.auth-demo__typing--1 {
	animation:
		auth-bubble 0.3s ease 5.6s forwards,
		auth-typing-hide 0.15s ease 6.3s forwards;
}

.auth-demo__typing--2 {
	animation:
		auth-bubble 0.3s ease 7.25s forwards,
		auth-typing-hide 0.15s ease 8.25s forwards;
}

.auth-demo__draft {
	position: relative;
	min-height: calc(var(--text-sm--line-height) * 1em + var(--spacing) * 4);
	color: var(--foreground);
	pointer-events: none;
}

.auth-demo__placeholder {
	color: var(--muted-foreground);
	animation: auth-placeholder-hide 0.01s linear 3.05s forwards;
}

.auth-demo__typed {
	position: absolute;
	top: calc(var(--spacing) * 2);
	left: calc(var(--spacing) * 2.5);
	right: calc(var(--spacing) * 2.5);
	display: inline-block;
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	vertical-align: top;
	border-right: 2px solid var(--foreground);
	animation:
		auth-type 1.7s steps(48, end) 3.1s forwards,
		auth-caret-blink 0.7s step-end 3.1s 3,
		auth-draft-clear 0.2s ease 5s forwards;
}

.auth-demo__send {
	color: var(--muted-foreground);
	background: var(--muted);
	animation:
		auth-send-ready 0.2s ease 4.8s forwards,
		auth-send-press 0.4s ease 4.95s forwards;
}

.auth-cursor {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 4;
	width: 1.75rem;
	height: 1.75rem;
	color: var(--foreground);
	opacity: 0;
	pointer-events: none;
	filter: drop-shadow(0 4px 8px color-mix(in oklch, var(--foreground) 25%, transparent));
	animation: auth-cursor-move 1.35s cubic-bezier(0.22, 0.61, 0.36, 1) 1.15s forwards;
}

.auth-cursor__pointer {
	display: block;
	width: 1.75rem;
	height: 1.75rem;
}

.auth-cursor__ripple {
	position: absolute;
	top: 0.15rem;
	left: 0.1rem;
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid var(--primary);
	border-radius: var(--radius-full);
	opacity: 0;
	transform: scale(0.4);
	animation: auth-cursor-click 0.45s ease 2.35s forwards;
}

.auth-page--denied .auth-page__stage {
	align-items: center;
	text-align: center;
}

.auth-page--denied .auth-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.auth-page--denied .auth-hero__text {
	max-width: 22rem;
}

@keyframes auth-rise {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes auth-bubble {
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes auth-cursor-move {
	0% {
		opacity: 0;
		transform: translate(12.5rem, 18rem);
	}
	12% {
		opacity: 1;
		transform: translate(12.5rem, 18rem);
	}
	78% {
		opacity: 1;
		transform: translate(2.4rem, 6.4rem);
	}
	88% {
		opacity: 1;
		transform: translate(2.4rem, 6.7rem) scale(0.92);
	}
	100% {
		opacity: 0;
		transform: translate(2.4rem, 6.4rem) scale(1);
	}
}

@keyframes auth-cursor-click {
	0% {
		opacity: 0.8;
		transform: scale(0.4);
	}
	100% {
		opacity: 0;
		transform: scale(1.8);
	}
}

@keyframes auth-member-press {
	0% {
		transform: none;
		border-color: var(--border);
		box-shadow: none;
	}
	40% {
		transform: scale(0.98);
		border-color: var(--primary);
		box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
	}
	100% {
		transform: none;
		border-color: var(--primary);
		box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
	}
}

@keyframes auth-team-exit {
	to {
		opacity: 0;
		transform: scale(0.97);
		visibility: hidden;
	}
}

@keyframes auth-demo-enter {
	to {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

@keyframes auth-typing-hide {
	to {
		opacity: 0;
		visibility: hidden;
	}
}

@keyframes auth-message-reveal {
	to {
		grid-template-rows: 1fr;
		opacity: 1;
		transform: none;
	}
}

@keyframes auth-replies-reveal {
	to {
		grid-template-rows: 1fr;
		opacity: 1;
		margin-left: calc(var(--spacing) * 4.5);
		padding-left: calc(var(--spacing) * 5.5);
		border-left-width: 2px;
		border-left-color: var(--border);
	}
}

@keyframes auth-slot-open {
	to {
		grid-template-rows: 1fr;
		opacity: 1;
		min-height: 2.5rem;
	}
}

@keyframes auth-placeholder-hide {
	to {
		opacity: 0;
		position: absolute;
		width: 0;
		height: 0;
		overflow: hidden;
	}
}

@keyframes auth-type {
	from {
		max-width: 0;
	}
	to {
		max-width: 100%;
	}
}

@keyframes auth-caret-blink {
	50% {
		border-right-color: transparent;
	}
}

@keyframes auth-draft-clear {
	to {
		max-width: 0;
		opacity: 0;
		border-right-color: transparent;
	}
}

@keyframes auth-send-ready {
	to {
		color: var(--primary-foreground);
		background: var(--primary);
	}
}

@keyframes auth-send-press {
	0% {
		transform: scale(1);
	}
	40% {
		transform: scale(0.88);
	}
	100% {
		transform: scale(1);
		color: var(--primary-foreground);
		background: var(--primary);
	}
}

@media (min-width: 48rem) {
	.auth-page {
		padding: calc(var(--spacing) * 10) calc(var(--spacing) * 8);
	}

	.auth-page__stage {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
		align-items: center;
		gap: calc(var(--spacing) * 14);
	}

	.auth-scene {
		margin-inline: 0;
		max-width: none;
	}

	.auth-hero__button {
		width: auto;
	}

	.auth-page--denied .auth-page__stage {
		display: flex;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auth-hero,
	.auth-scene,
	.auth-team,
	.auth-team__member,
	.auth-team__member--target,
	.auth-demo,
	.auth-demo__msg,
	.auth-demo__replies,
	.auth-demo__slot,
	.auth-demo__typing,
	.auth-demo__placeholder,
	.auth-demo__typed,
	.auth-demo__send,
	.auth-cursor,
	.auth-cursor__ripple,
	.auth-hero__button--google,
	.auth-hero__button--microsoft {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}

	.auth-demo__msg,
	.auth-demo__replies,
	.auth-demo__slot {
		grid-template-rows: 1fr !important;
	}

	.auth-demo__replies {
		margin-left: calc(var(--spacing) * 4.5) !important;
		padding-left: calc(var(--spacing) * 5.5) !important;
		border-left-width: 2px !important;
		border-left-color: var(--border) !important;
	}

	.auth-demo__placeholder,
	.auth-demo__typed,
	.auth-team,
	.auth-cursor,
	.auth-demo__typing {
		display: none;
	}

	.auth-demo__send {
		color: var(--primary-foreground) !important;
		background: var(--primary) !important;
	}
}
