/* YooMoney Client — страницы входа и возврата. Без внешних шрифтов и скриптов. */
:root {
	--bg: #f3f0fa;
	--bg-deep: #e9e3f7;
	--card: #ffffff;
	--text: #1c1726;
	--muted: #6b6480;
	--line: #e4def0;
	--accent: #7a35e6;
	--accent-strong: #5f22c4;
	--accent-soft: #efe6ff;
	--ok: #2e9a3a;
	--warn: #c26a00;
	--danger: #c8322c;
	--hero-top: #9a5cf2;
	--hero-bottom: #5a1fb8;
	--shadow: 0 1px 2px rgba(40, 20, 80, 0.06), 0 12px 32px rgba(60, 25, 130, 0.12);
	--radius: 22px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #120d1c;
		--bg-deep: #0c0814;
		--card: #1d1629;
		--text: #f2eefa;
		--muted: #a79fbd;
		--line: #2e2540;
		--accent: #a274ff;
		--accent-strong: #c2a2ff;
		--accent-soft: #2b2042;
		--ok: #5bd16a;
		--warn: #ffb44d;
		--danger: #ff7a72;
		--hero-top: #6a2fd0;
		--hero-bottom: #2d0f66;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
	}
}

:root[data-theme="dark"] {
	--bg: #120d1c;
	--bg-deep: #0c0814;
	--card: #1d1629;
	--text: #f2eefa;
	--muted: #a79fbd;
	--line: #2e2540;
	--accent: #a274ff;
	--accent-strong: #c2a2ff;
	--accent-soft: #2b2042;
	--ok: #5bd16a;
	--warn: #ffb44d;
	--danger: #ff7a72;
	--hero-top: #6a2fd0;
	--hero-bottom: #2d0f66;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* Шапка: фиолетовый градиент с мягким бликом, как навбар приложения */
.hero {
	position: relative;
	padding: 40px 16px 92px;
	text-align: center;
	color: #fff;
	background:
		radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%),
		linear-gradient(180deg, var(--hero-top), var(--hero-bottom));
	overflow: hidden;
}
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 6px);
	pointer-events: none;
}
.app-icon {
	display: block;
	width: 76px;
	height: 76px;
	margin: 0 auto 14px;
	border-radius: 18px;
	box-shadow: 0 6px 18px rgba(20, 0, 60, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
.brand-sub { margin-top: 2px; font-size: 14px; opacity: 0.8; }

/* Карточка */
main {
	position: relative;
	z-index: 1;
	width: min(440px, calc(100% - 32px));
	margin: -64px auto 0;
	padding: 28px 24px 24px;
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
main section[hidden] { display: none; }

h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; text-align: center; }
.lead { margin: 0 0 20px; color: var(--muted); text-align: center; }
.lead b { color: var(--text); font-weight: 600; }

/* QR */
.qr-frame {
	position: relative;
	width: min(300px, 100%);
	margin: 0 auto;
	padding: 14px;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(60, 25, 130, 0.12);
}
.qr svg { display: block; width: 100%; height: auto; }
.qr-frame.expired .qr { opacity: 0.18; filter: grayscale(1); transition: opacity 0.4s, filter 0.4s; }
.qr-expired {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.9);
	text-align: center;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	color: #3a2a5c;
}
.qr-frame.expired .qr-expired { display: flex; }

/* Таймер */
.timer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 18px 0 6px;
	font-size: 15px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.timer strong { color: var(--text); }
.ring { width: 26px; height: 26px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer.late .ring .value { stroke: var(--warn); }
.timer.over .ring .value { stroke: var(--danger); }

/* Шаги */
.steps { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 12px 40px; counter-increment: step; color: var(--muted); }
.steps li b { color: var(--text); font-weight: 600; }
.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: linear-gradient(180deg, #a874f7, #6e2dd6);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(60, 20, 130, 0.35);
}

/* Ручной ввод */
details.manual { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
details.manual summary { cursor: pointer; color: var(--accent); font-weight: 600; text-align: center; list-style: none; }
details.manual summary::-webkit-details-marker { display: none; }
details.manual summary::after { content: " ›"; }
details.manual[open] summary::after { content: " ⌄"; }
.code-box {
	margin: 12px 0 10px;
	padding: 12px 14px;
	background: var(--accent-soft);
	border-radius: 12px;
	font: 13px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	word-break: break-all;
	user-select: all;
}

.button {
	display: block;
	width: 100%;
	padding: 13px 16px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(180deg, #9a5cf2, #6a2bd3);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 6px rgba(90, 30, 190, 0.35);
}
.button:active { transform: translateY(1px); }
.button.secondary { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }

/* Состояния ошибки и пустой страницы */
.status-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	font-weight: 700;
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.18);
}
.status-icon.danger { background: linear-gradient(180deg, #f57a72, #c92a23); }
.status-icon.info { background: linear-gradient(180deg, #a874f7, #6e2dd6); }
.status-icon.ok { background: linear-gradient(180deg, #7bdb7f, #2c9a3b); }
.detail { margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--muted); font-size: 14px; text-align: center; word-break: break-word; }

.tips { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 14px; color: var(--muted); }
.tips li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.tips li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); }

footer {
	width: min(440px, calc(100% - 32px));
	margin: 22px auto 40px;
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
	color: var(--muted);
}
footer p { margin: 0 0 6px; }

.toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translate(-50%, 20px);
	padding: 10px 16px;
	border-radius: 12px;
	background: rgba(28, 23, 38, 0.92);
	color: #fff;
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
