/* ===== Setanta Sports Platform — страница входа ===== */
:root {
	--yellow: #FFD106;
	--yellow-hover: #F2C300;
	--yellow-soft: rgba(255, 209, 6, 0.28);
	--ink: #000000;
	--muted: #8b8b8b;
	--line: #E4E4E4;
	--error: #E0402F;
	--warm-bg: #F4F4F4;
	--dark-bg: #0A0D14;
	/* Единица масштаба: 1px на эталонном экране 1440×900. Растёт и сжимается
		вместе с окном (по меньшей из сторон), в пределах 0.85px–1.4px.
		Все размеры карточки входа и заголовка промо умножаются на неё. */
	--u: clamp(0.85px, min(100vw / 1440, 100vh / 900), 1.4px);
	--radius: calc(14 * var(--u));
	/* Шрифты подключаются в fonts.css. Запасные значения ниже нужны,
		чтобы без fonts.css браузер не откатывался к Times New Roman. */
	--font: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-display: "Setantica", "Arial Narrow", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }
html { overflow-x: hidden; }

body {
	font-family: var(--font);
	color: var(--ink);
	background: var(--warm-bg);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* ===== Сетка: 42% / 58% на всю высоту (от 1024px) ===== */
.layout {
	display: grid;
	grid-template-columns: 42% 58%;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
}

/* ===== Левая колонка ===== */
.auth {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 40px 32px;
	background: var(--warm-bg);
	overflow: hidden;            /* круги обрезаются внутри колонки */
	isolation: isolate;
}

.auth__decor {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: -1;
}

.auth__glow {
	position: absolute;
	top: 18%;
	left: 14%;
	width: 560px;
	height: 560px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 214, 60, 0.30) 0%, rgba(255, 214, 60, 0.10) 42%, rgba(255, 214, 60, 0) 70%);
}

.circle {
	position: absolute;
	border-radius: 50%;
	border: 1px solid rgba(214, 170, 40, 0.16);
}
.circle--1 { width: 460px; height: 460px; top: -170px; left: -190px; }
.circle--2 { width: 320px; height: 320px; bottom: -130px; right: -110px; }
.circle--3 { width: 180px; height: 180px; bottom: 16%; left: 6%; border-color: rgba(214, 170, 40, 0.12); }

/* margin:auto центрирует карточку и не обрезает её, если не хватает высоты */
.card {
	width: 100%;
	max-width: calc(420 * var(--u));
	margin: auto;
	padding: calc(36 * var(--u)) calc(32 * var(--u)) calc(34 * var(--u));
	background: #FAFAFA;
	border-radius: calc(24 * var(--u));
	box-shadow: 0 30px 70px rgba(40, 32, 10, 0.10), 0 6px 18px rgba(40, 32, 10, 0.05);
}

/* Логотип */
.logo {
	display: inline-flex;
	align-items: center;
	gap: calc(10 * var(--u));
	max-width: 100%;
	text-decoration: none;
	color: var(--ink);
}
.logo__mark { flex: 0 0 auto; display: block; width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.logo__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.logo__name { font-family: var(--font-display); font-weight: 400; font-size: calc(17 * var(--u)); letter-spacing: 0; }
.logo__sub { font-family: var(--font-display); font-size: calc(11 * var(--u)); letter-spacing: 0.24em; color: var(--muted); margin-top: calc(2 * var(--u)); }

.title {
	margin: calc(34 * var(--u)) 0 calc(26 * var(--u));
	font-family: var(--font-display);
	font-weight: 400;
	font-size: calc(26 * var(--u));
	line-height: 1.1;
	letter-spacing: -0.01em;
}

/* Форма */
.form { display: flex; flex-direction: column; gap: calc(16 * var(--u)); width: 100%; }

.field { display: flex; flex-direction: column; gap: calc(8 * var(--u)); width: 100%; min-width: 0; }
.field__label { font-size: calc(13 * var(--u)); font-weight: 400; color: #3a3a3a; }
.field__control { position: relative; width: 100%; }

.field__input {
	display: block;
	width: 100%;
	height: calc(48 * var(--u));
	padding: 0 calc(16 * var(--u));
	font: inherit;
	font-size: max(16px, calc(16 * var(--u)));  /* не меньше 16px: иначе iOS приближает страницу при фокусе */
	color: var(--ink);
	background: #fff;
	border: 1.5px solid var(--line);
	border-radius: var(--radius);
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.field__input::placeholder { color: #A8A8A8; }
.field__input--with-btn { padding-right: calc(52 * var(--u)); }

.field__input:focus {
	border-color: var(--yellow);
	box-shadow: 0 0 0 calc(4 * var(--u)) var(--yellow-soft);
}

.field.is-invalid .field__input { border-color: var(--error); }
.field.is-invalid .field__input:focus { box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.15); }

.field__toggle {
	position: absolute;
	top: 50%;
	right: calc(6 * var(--u));
	transform: translateY(-50%);
	width: calc(38 * var(--u));
	height: calc(38 * var(--u));
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: calc(10 * var(--u));
	background: transparent;
	color: #868686;
	cursor: pointer;
}
.field__toggle:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.field__toggle:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
.field__toggle svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.field__toggle .icon-eye-off { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye-off { display: block; }

.field__error,
.form__error {
	margin: 0;
	font-size: calc(13 * var(--u));
	line-height: 1.4;
	color: var(--error);
}
.field__error:empty,
.form__error:empty { display: none; }
/* На время замера карточки (script.js): её размер без текстов ошибок */
.card.is-measuring .field__error,
.card.is-measuring .form__error { display: none; }

/* Кнопка */
.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: calc(8 * var(--u));
	width: 100%;
	height: calc(50 * var(--u));
	margin-top: calc(6 * var(--u));
	padding: 0 calc(20 * var(--u));
	font: inherit;
	font-size: calc(15 * var(--u));
	font-weight: 700;
	color: var(--ink);
	background: var(--yellow);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .15s, transform .1s;
}
.btn:hover { background: var(--yellow-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn__arrow { flex: 0 0 auto; width: calc(18 * var(--u)); height: calc(18 * var(--u)); transition: transform .15s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ===== Правая колонка: комната с телевизором ===== */
.promo {
	/* Размер сцены (квадратное фото, прижато к низу). По умолчанию как cover, но:
		1) не шире, чем нужно, чтобы плашки стояли по бокам экрана, а не на нём
		(экран — 58.13% ширины фото);
		2) не выше, чем нужно, чтобы верх экрана (71.1% от низа сцены) был
		ниже заголовка и подзаголовка (~210 единиц --u сверху);
		3) не меньше 70% высоты колонки.
		cq-единицы считаются от .promo (container-type: size). */
	--stats-w: clamp(128px, 12vw, 180px);
	--scene: max(
		min(
			max(100cqw, 100cqh),
			(100cqw - 2 * (var(--stats-w) + 32px)) / 0.5813,
			(100cqh - 210 * var(--u)) / 0.711),
		70cqh);
	position: relative;
	min-width: 0;
	container-type: size;
	background: #07070a;          /* цвет стены на фото: шов не виден */
	color: #fff;
	overflow: hidden;
	isolation: isolate;
}

.promo__scene {
	position: absolute;
	left: 50%;
	bottom: 0;
	z-index: 0;
	width: 100%;                  /* запасной вариант без cq-единиц */
	width: var(--scene);
	aspect-ratio: 1;
	transform: translateX(-50%);
	/* Края фото плавно уходят в темноту: по бокам, если сцена уже колонки,
		и снизу, если под диваном остаётся свободное место */
	-webkit-mask-image:
		linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%),
		linear-gradient(180deg, #000 0, #000 90%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-image:
		linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%),
		linear-gradient(180deg, #000 0, #000 90%, transparent 100%);
	mask-composite: intersect;
}

/* Экран телевизора в координатах фото 1254×1254 (264–992 × 358–764 px).
	Окно чуть больше вырезанной области: края прячутся под рамкой ТВ. */
.promo__screen {
	position: absolute;
	left: 21.053%;
	top: 28.549%;
	width: 58.134%;
	height: 32.456%;
	overflow: hidden;
	background: #000;
}

.promo__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Фото с прозрачным экраном поверх ролика: люди остаются на переднем плане.
	Фон через CSS: на телефоне блок скрыт, и картинка не скачивается. */
.promo__room {
	position: absolute;
	inset: 0;
	background: url("assets/promo/promo-background-tv.png?v=1") center / 100% 100% no-repeat;
	background-image: image-set(
		url("assets/promo/promo-background-tv.webp?v=1") type("image/webp"),
		url("assets/promo/promo-background-tv.png?v=1") type("image/png"));
	pointer-events: none;
}

/* Лёгкий свет от экрана на комнату */
.promo__glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(42% 30% at 50% 45%, rgba(150, 175, 255, 0.10), rgba(150, 175, 255, 0) 70%);
	mix-blend-mode: screen;
	pointer-events: none;
}

.promo__placeholder {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: #050608;
}
.promo__placeholder span {
	font-size: 12px;
	line-height: 1.6;
	text-align: center;
	color: #6f7480;
	padding: 10px 16px;
	border: 1px dashed rgba(255, 209, 6, 0.3);
	border-radius: 12px;
}
.promo__scene.is-empty .promo__video { display: none; }
.promo__scene.is-empty .promo__placeholder { display: flex; }

/* Затемнение сверху для читаемости заголовка */
.promo__shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(7, 7, 10, 0.85) 0%, rgba(7, 7, 10, 0.4) 16%, rgba(7, 7, 10, 0) 30%);
}

/* Тонкие дуги вокруг телевизора */
.promo__decor { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.arc {
	position: absolute;
	left: 50%;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.07);
	transform: translateX(-50%);
}
.arc--1 { width: 64%; aspect-ratio: 1; top: 21%; }
.arc--2 { width: 92%; aspect-ratio: 1; top: 30%; border-color: rgba(255, 209, 6, 0.08); }
.arc--3 { width: 128%; aspect-ratio: 1; top: 12%; border-color: rgba(255, 255, 255, 0.04); }

.promo__head {
	position: relative;
	z-index: 3;
	padding: calc(56 * var(--u)) calc(56 * var(--u)) 0;
}
.promo__title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: calc(50 * var(--u));
	white-space: nowrap;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--yellow);
}
.promo__subtitle {
	max-width: calc(360 * var(--u));
	margin: calc(18 * var(--u)) 0 0;
	font-size: calc(15 * var(--u));
	font-weight: 400;
	line-height: 1.6;
	color: #c9ccd3;
}

/* Плашки по бокам телевизора: по высоте ровно от верха до низа экрана.
	Экран на фото занимает 28.9%–60.6% высоты сцены, а сцена прижата к низу. */
.stats {
	position: absolute;
	z-index: 3;
	top: 28%;                     /* запасной вариант без cq-единиц */
	top: calc(100cqh - var(--scene) * 0.711);
	height: calc(var(--scene) * 0.317);
	min-height: 210px;
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: var(--stats-w);
}
.stats--left { left: 16px; }
.stats--right { right: 16px; }

/* ===== Выравнивание промо по карточке входа (включает script.js) =====
	Верх «STAY IN THE GAME.» = верх карточки, низ нижних плашек = низ карточки.
	Если плашкам не хватает места, заголовок поднимается вверх.
	Значения в пикселях считает скрипт по реальным размерам карточки:
	--head-top, --stats-bottom, --scene-top. Без скрипта остаётся раскладка выше. */
.promo.is-aligned .promo__head {
	position: absolute;
	top: var(--head-top);
	left: 0;
	right: 0;
	padding-top: 0;
}
.promo.is-aligned .stats {
	top: auto;
	bottom: var(--stats-bottom);
}
.promo.is-aligned .promo__scene {
	top: var(--scene-top);
	bottom: auto;
}
/* Плавный сдвиг, когда карточка меняет высоту (например, появились подсказки) */
.promo.is-ready .promo__head,
.promo.is-ready .stats,
.promo.is-ready .promo__scene {
	transition: top .2s ease, bottom .2s ease;
}

.stat {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 26px 10px 12px;
	background: rgba(13, 16, 24, 0.82);
	/* Прозрачная рамка + padding-box: фон заканчивается внутри градиентной
		рамки и не выглядывает тёмной кромкой на скруглённых углах */
	border: 1px solid transparent;
	background-clip: padding-box;
	border-radius: 12px;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
/* Градиентная рамка: чёрный → жёлтый. Псевдоэлемент с маской сохраняет
	скругление углов и полупрозрачный фон (border-image их не поддерживает).
	Чёрный держится первые 12%, а середина перехода сдвинута к 62%: яркий жёлтый
	иначе визуально «съедает» чёрную половину. */
.stat::before {
	content: "";
	position: absolute;
	inset: -1px;                  /* поверх прозрачной рамки */
	padding: 2px;                 /* толщина рамки */
	border-radius: inherit;
	background: linear-gradient(-45deg, #000 0%, #000 12%, 62%, var(--yellow) 100%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	pointer-events: none;
}
.stat__index {
	position: absolute;
	top: 7px;
	right: 10px;
	font-size: 9px;
	font-weight: 700;
	color: #5c616d;
}
.stat__value {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(15px, 1.25vw, 19px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--yellow);
	white-space: nowrap;
}
.stat__label {
	font-size: 9.5px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
}

/* ===== Меньше 1024px: только форма, по центру экрана ===== */
/* Только форма: узкий экран (до 1024px) ИЛИ портретный/почти квадратный
	(соотношение сторон до 6:5), например iPad вертикально.
	То же условие стоит в script.js (FORM_ONLY_QUERY) — меняйте оба места. */
@media (max-width: 1023.98px), (max-aspect-ratio: 6/5) {
	/* На телефоне и планшете эталон — ширина 390px, пределы 0.9px–1.2px */
	:root { --u: clamp(0.9px, 100vw / 390, 1.2px); }

	.layout {
		display: block;
		width: 100%;
		min-width: 0;
	}

	.promo { display: none; }

	.auth {
		width: 100%;
		max-width: 100%;
		min-height: 100vh;
		min-height: 100dvh;
		padding: 32px 20px;
		padding-top: max(32px, env(safe-area-inset-top));
		padding-bottom: max(32px, env(safe-area-inset-bottom));
	}

	.auth__glow { width: 440px; height: 440px; top: 22%; left: 10%; }
	.circle--1 { width: 300px; height: 300px; top: -120px; left: -150px; }
	.circle--2 { width: 240px; height: 240px; bottom: -100px; right: -110px; }
	.circle--3 { display: none; }

	/* Без белой карточки и тени; блок по центру, содержимое по левому краю */
	.card {
		width: 100%;
		max-width: calc(420 * var(--u));
		min-width: 0;
		margin: auto;
		padding: 0;
		background: transparent;
		border-radius: 0;
		box-shadow: none;
		text-align: left;
	}

	.logo__mark { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
	.logo__name { font-size: calc(20 * var(--u)); }
	.logo__sub { font-size: calc(12 * var(--u)); }
	.title { font-size: calc(30 * var(--u)); margin: calc(32 * var(--u)) 0 calc(26 * var(--u)); }
	.field__input { height: calc(52 * var(--u)); }
	.btn { height: calc(54 * var(--u)); font-size: calc(16 * var(--u)); }
}

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

/* Выделение текста — фирменный жёлтый Setanta (Samba Yellow #FFD106), текст чёрный */
::selection { background: #FFD106; color: #000; text-shadow: none; }
::-moz-selection { background: #FFD106; color: #000; text-shadow: none; }

/* ===== Тёмная тема страницы входа: та же, что на основном сайте (выбор кнопкой или тема устройства), без переключателя ===== */
html[data-theme="dark"] {
	color-scheme: dark;
	--ink: #F4F4F4;
	--muted: #8F8F8F;
	--line: #3A3A3A;
	--error: #FF6B5E;
	--warm-bg: #0C0C0C;
}
html[data-theme="dark"] .auth__glow { background: radial-gradient(circle, rgba(255, 209, 6, 0.14) 0%, rgba(255, 209, 6, 0.05) 42%, rgba(255, 209, 6, 0) 70%); }
html[data-theme="dark"] .circle { border-color: rgba(255, 209, 6, 0.13); }
html[data-theme="dark"] .circle--3 { border-color: rgba(255, 209, 6, 0.09); }
html[data-theme="dark"] .card { background: #1E1E1E; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35); }
html[data-theme="dark"] .field__label { color: #CDCDCD; }
html[data-theme="dark"] .field__input { background: #141414; color: var(--ink); }
html[data-theme="dark"] .field__input::placeholder { color: #6E6E6E; }
html[data-theme="dark"] .field__input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px #141414 inset; }
html[data-theme="dark"] .field.is-invalid .field__input:focus { box-shadow: 0 0 0 4px rgba(254, 95, 85, 0.22); }
html[data-theme="dark"] .field__toggle { color: #9A9A9A; }
html[data-theme="dark"] .field__toggle:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .btn { color: #000; }

