:root {
	--bg: #f5f7fb;
	--bg-accent: rgba(37, 99, 235, 0.08);
	--panel: rgba(255, 255, 255, 0.92);
	--panel-strong: #ffffff;
	--border: #e5e7eb;
	--border-strong: #dbe3f0;
	--text: #111827;
	--muted: #6b7280;
	--muted-strong: #4b5563;
	--brand: #2563eb;
	--brand-strong: #1d4ed8;
	--brand-soft: #eff6ff;
	--brand-soft-strong: #dbeafe;
	--success-bg: #ecfdf3;
	--success-text: #047857;
	--error-bg: #fff1f2;
	--error-text: #be123c;
	--shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
	box-sizing: border-box;
}

html,
body {
	min-height: 100%;
}

body {
	margin: 0;
	font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 28%),
		radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 20%),
		linear-gradient(180deg, #f8fafc 0%, #f3f4f6 100%);
}

.shell {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 28px;
}

.panel {
	width: min(100%, 620px);
	background: var(--panel);
	border: 1px solid var(--border-strong);
	border-radius: 32px;
	padding: 36px 34px 32px;
	box-shadow: var(--shadow);
	backdrop-filter: blur(12px);
}

.panel-header {
	margin-bottom: 24px;
}

.headline {
	margin: 0;
	font-size: clamp(36px, 5vw, 48px);
	line-height: 1;
	font-weight: 800;
	letter-spacing: -0.04em;
}

.headline-accent {
	color: var(--brand);
}

.subtitle {
	margin: 14px 0 0;
	max-width: 42ch;
	color: var(--muted);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
}

.stack {
	display: grid;
	gap: 18px;
}

.stack-inline {
	margin-top: 14px;
}

.section-label {
	color: var(--text);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.method-picker,
.email-panel,
.email-summary,
.continue-state {
	border-radius: 24px;
	background: var(--panel-strong);
	border: 1px solid var(--border);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.method-picker {
	padding: 22px;
}

.method-card {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	align-items: center;
	gap: 16px;
	margin-top: 16px;
	padding: 16px;
	border-radius: 22px;
	border: 1px solid var(--border);
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	text-decoration: none;
	color: inherit;
	transition:
		transform 140ms ease,
		border-color 140ms ease,
		box-shadow 140ms ease;
}

.method-card:hover {
	transform: translateY(-1px);
	border-color: var(--brand-soft-strong);
	box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.method-card-button {
	width: 100%;
	text-align: left;
	font: inherit;
	cursor: pointer;
}

.method-card-button:disabled {
	opacity: 0.72;
	cursor: progress;
	transform: none;
}

.method-card-icon {
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	border-radius: 18px;
	background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
	color: var(--brand);
	box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.method-card-icon svg {
	width: 28px;
	height: 28px;
	display: block;
}

.method-card-icon-telegram {
	background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
	color: #229ed9;
	box-shadow:
		inset 0 0 0 1px rgba(34, 158, 217, 0.14),
		0 8px 18px rgba(34, 158, 217, 0.12);
}

.method-card-icon-telegram svg {
	width: 30px;
	height: 30px;
}

.method-card-icon-email {
	background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
	color: #2563eb;
}

.method-card-copy {
	display: grid;
	gap: 4px;
}

.method-card-copy strong {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.method-card-copy p {
	margin: 0;
	color: var(--muted);
	font-size: 15px;
	line-height: 1.45;
}

.method-card-chevron {
	color: var(--brand);
	font-size: 22px;
	font-weight: 800;
}

.email-panel {
	padding: 22px;
}

.field {
	display: grid;
	gap: 10px;
}

.field span {
	color: var(--muted-strong);
	font-size: 14px;
	font-weight: 700;
}

.field input {
	width: 100%;
	min-height: 56px;
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid var(--border);
	background: #ffffff;
	color: var(--text);
	font-size: 16px;
	font-family: inherit;
	font-weight: 600;
	outline: none;
	transition:
		border-color 140ms ease,
		box-shadow 140ms ease,
		transform 140ms ease;
}

.field input:focus {
	border-color: rgba(37, 99, 235, 0.55);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
	transform: translateY(-1px);
}

.code-input {
	text-align: center;
	font-size: 30px;
	font-weight: 800;
	letter-spacing: 0.28em;
	padding-left: 26px;
}

.email-summary {
	padding: 18px;
}

.email-summary-label {
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.email-summary-value {
	margin-top: 8px;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.button {
	appearance: none;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 56px;
	padding: 14px 20px;
	border: 0;
	border-radius: 18px;
	background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
	color: #ffffff;
	font-size: 16px;
	font-weight: 800;
	font-family: inherit;
	letter-spacing: -0.02em;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 140ms ease,
		box-shadow 140ms ease,
		opacity 140ms ease;
	box-shadow: 0 8px 16px rgba(37, 99, 235, 0.16);
}

.button:hover {
	transform: translateY(-1px);
}

.button-secondary {
	background: #ffffff;
	color: var(--muted-strong);
	border: 1px solid var(--border);
	box-shadow: none;
}

.continue-link {
	text-align: center;
}

.actions-row {
	display: grid;
	gap: 12px;
}

.inline-form {
	display: contents;
}

.support-copy {
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
}

.method-picker-status {
	margin-top: 12px;
}

.telegram-bot-login-panel {
	display: grid;
	gap: 12px;
	margin-top: 16px;
	padding: 16px;
	border-radius: 22px;
	border: 1px solid rgba(34, 158, 217, 0.22);
	background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.telegram-bot-login-panel[hidden] {
	display: none;
}

.telegram-bot-login-copy {
	display: grid;
	gap: 6px;
}

.telegram-bot-login-copy strong {
	color: var(--ink);
	font-size: 16px;
	font-weight: 800;
}

.telegram-bot-login-copy p {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.5;
}

.flash {
	margin-bottom: 18px;
	padding: 14px 16px;
	border-radius: 18px;
	font-size: 14px;
	font-weight: 700;
}

.flash-error {
	background: var(--error-bg);
	color: var(--error-text);
}

.flash-success {
	background: var(--success-bg);
	color: var(--success-text);
}

.continue-state {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
}

.continue-copy {
	display: grid;
	gap: 6px;
}

.continue-copy strong {
	font-size: 18px;
	font-weight: 800;
}

.continue-copy p {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.5;
}

.continue-spinner {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 4px solid rgba(37, 99, 235, 0.14);
	border-top-color: var(--brand);
	animation: auth-spin 900ms linear infinite;
}

@keyframes auth-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

@media (min-width: 641px) {
	.actions-row {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 640px) {
	body {
		background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
	}

	.shell {
		padding: 0;
		place-items: stretch;
	}

	.panel {
		width: 100%;
		min-height: 100dvh;
		border-radius: 0;
		border: 0;
		box-shadow: none;
		padding: 28px 20px 32px;
		background:
			radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
			linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	}

	.headline {
		font-size: 44px;
	}

	.subtitle {
		max-width: none;
	}

	.method-card {
		grid-template-columns: 52px 1fr;
	}

	.method-card-chevron {
		display: none;
	}

	.continue-state {
		align-items: flex-start;
	}
}
