/* Базовые стили для светлой темы */
:root[data-theme='light'] {
	--login-bg-gradient-start: #f0f7ff;
	--login-bg-gradient-end: #e6e6fa;
	--form-bg-gradient-start: #ffffff;
	--form-bg-gradient-end: #f8f9fa;
	--form-text-color: #333333;
	--form-shadow: rgba(0, 0, 0, 0.1);
	--input-bg: rgba(255, 255, 255, 0.9);
	--input-text: #333333;
	--input-icon: #666666;
}

/* Обновляем стили для формы в светлой теме */
:root[data-theme='light'] form {
	background: linear-gradient(
		135deg,
		var(--form-bg-gradient-start) 0%,
		var(--form-bg-gradient-end) 100%
	);
}

/* Обновляем цвет текста для светлой темы */
:root[data-theme='light'] .form-header h2 {
	color: var(--form-text-color);
	text-shadow: none;
}

:root[data-theme='light'] .form-header p {
	color: var(--form-text-color);
}

:root[data-theme='light'] input[type='text'],
:root[data-theme='light'] input[type='password'] {
	background-color: var(--input-bg);
	color: var(--input-text);
}

:root[data-theme='light'] .input-group i {
	color: var(--input-icon);
}

/* Основные стили с использованием переменных */
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background: linear-gradient(
		135deg,
		var(--login-bg-gradient-start) 0%,
		var(--login-bg-gradient-end) 55%
	);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Контейнер страницы логина */
.login-page {
	width: 100%;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
	position: relative;
	z-index: 1;
	pointer-events: none;
}

/* Скрываем хедер и футер на странице логина */
.login-page header,
.login-page footer {
	display: none;
}

/* Атрибуты формы */
form {
	width: 100%;
	max-width: 450px;
	background: linear-gradient(
		135deg,
		var(--form-bg-gradient-start) 0%,
		var(--form-bg-gradient-end) 100%
	);
	border-radius: var(--border-radius);
	box-shadow: 0 8px 20px var(--form-shadow);
	padding: 40px;
	position: relative;
	overflow: hidden;
	pointer-events: auto;
}

/* Контент формы */
.con {
	position: relative;
	z-index: 2;
}

/* Обновляем цвета для лучшей видимости на фоне частиц */
.form-header h2,
.form-header p,
.frgt-pass {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Заголовок формы */
.form-header {
	text-align: center;
	margin-bottom: 40px;
}

.form-header h2 {
	font-size: clamp(1.8rem, 3vw, 2.2rem);
	background: linear-gradient(135deg, #0066cc 0%, #6633cc 100%);
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
	margin-bottom: 15px;
	font-weight: 600;
	letter-spacing: 0.5px;
	animation: glowTextLight 3s ease-in-out infinite alternate;
}

.form-header h2 span {
	display: block;
}

.form-header p {
	color: var(--form-text-color);
	font-size: 16px;
	margin: 0;
	opacity: 0.8;
}

/* Контейнер для полей ввода */
.field-set {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Группа ввода */
.input-group {
	position: relative;
	width: 100%;
}

/* Стили для иконок ввода */
.input-item,
.input-icon {
	position: absolute;
	left: 15px;
	top: 25px;
	transform: translateY(-50%);
	color: #0066cc;
	z-index: 1;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.input-item i,
.input-icon i {
	font-size: 16px;
	width: 16px;
	text-align: center;
}

/* Стили полей ввода */
.form-input {
	width: 100%;
	height: 50px;
	padding: 0 45px;
	font-family: var(--font-family-main);
	color: var(--input-text);
	background: #ffffff;
	border: 1px solid rgba(0, 102, 204, 0.2);
	box-shadow: 0 2px 6px rgba(0, 102, 204, 0.1);
	border-radius: var(--border-radius);
	transition: all 0.3s ease;
	letter-spacing: normal;
}

.form-input::placeholder {
	color: var(--input-icon);
	font-size: 16px;
	font-family: var(--font-family-main);
}

.form-input:focus {
	outline: none;
	border-color: #0066cc;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Иконка глаза */
.eye-icon {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	cursor: pointer;
	color: #0066cc;
	transition: color 0.3s ease;
}

.eye-icon:hover {
	color: var(--color-primary);
}

/* Стили для поля пароля */
input[type='password'] {
	color: #333333;
	letter-spacing: normal;
	font-family: var(--font-family-main);
}

input[type='password'] {
	/* Специальный шрифт для точек пароля */
	font-family: Verdana, var(--font-family-main);
}

/* Кнопка входа */
.log-in {
	width: 100%;
	height: 50px;
	margin-top: 10px;
	background: linear-gradient(135deg, #0066cc 0%, #6633cc 90%);
	color: var(--color-text-light);
	border: none;
	border-radius: var(--border-radius);
	font-size: 16px;
	font-weight: var(--font-weight-medium);
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.log-in:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(102, 51, 204, 0.3);
}

/* Адаптивность */
@media (max-width: 480px) {
	form {
		padding: 30px 20px;
	}

	.form-header h2 {
		font-size: 24px;
	}

	.form-header p {
		font-size: 14px;
	}

	.form-input {
		font-size: 14px;
	}
}

/* Сообщения об ошибках */
.error-message {
	display: block;
	color: var(--color-error, #dc3545);
	font-size: 13px;
	margin-top: 5px;
	line-height: 1.2;
}

.input-group .error-message {
	display: block;
	color: var(--color-error, #dc3545);
	font-size: 12px;
	margin-top: 6px;
	line-height: 1.2;
}

.input-error,
.form-input.invalid,
.input-group.error .form-input {
	border-color: var(--color-error, #dc3545) !important;
	box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

.input-error:focus,
.form-input.invalid:focus,
.input-group.error .form-input:focus {
	border-color: var(--color-error, #dc3545) !important;
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
}

/* Добавляем эффект свечения */
@keyframes glowText {
	from {
		text-shadow:
			0 0 10px rgba(66, 153, 225, 0.3),
			0 0 20px rgba(66, 153, 225, 0.2);
	}
	to {
		text-shadow:
			0 0 15px rgba(66, 153, 225, 0.4),
			0 0 25px rgba(66, 153, 225, 0.3);
	}
}

/* Добавляем стили для тёмной темы */
@media (prefers-color-scheme: dark) {
	body {
		background: linear-gradient(135deg, #0066cc 0%, #6633cc 55%);
	}

	form {
		background: linear-gradient(135deg, #27272a 0%, #18181b 100%);
	}

	.form-header h2 {
		text-shadow:
			0 0 10px rgba(66, 153, 225, 0.3),
			0 0 20px rgba(66, 153, 225, 0.2);
	}

	.form-header p {
		color: var(--color-text-light);
	}

	input[type='text'],
	input[type='password'] {
		background-color: rgba(255, 255, 255, 0.1);
		color: var(--color-text-light);
	}

	.input-group i {
		color: var(--color-text-light);
	}

	@keyframes glowText {
		from {
			text-shadow:
				0 0 10px rgba(66, 153, 225, 0.3),
				0 0 20px rgba(66, 153, 225, 0.2);
		}
		to {
			text-shadow:
				0 0 15px rgba(66, 153, 225, 0.4),
				0 0 25px rgba(66, 153, 225, 0.3);
		}
	}
}

/* Анимация свечения для тёмной темы */
:root[data-theme='dark'] .form-header h2 {
	animation: glowText 3s ease-in-out infinite alternate;
}

/* Стили для кнопки переключения темы */
.theme-toggle {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--input-bg);
	color: var(--input-icon);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	z-index: 10;
	pointer-events: auto;
}

.theme-toggle:hover {
	background: var(--color-primary);
	color: var(--color-text-light);
}

.theme-toggle i {
	font-size: 1.2rem;
	transition: transform 0.3s ease;
}

.theme-toggle:hover i {
	transform: rotate(180deg);
}

/* Адаптив для мобильных устройств */
@media (max-width: 480px) {
	.theme-toggle {
		top: 10px;
		right: 10px;
		width: 35px;
		height: 35px;
	}
}

/* Добавляем анимацию свечения для светлой темы */
@keyframes glowTextLight {
	from {
		text-shadow:
			0 0 10px rgba(0, 102, 204, 0.3),
			0 0 20px rgba(102, 51, 204, 0.2);
	}
	to {
		text-shadow:
			0 0 15px rgba(0, 102, 204, 0.4),
			0 0 25px rgba(102, 51, 204, 0.3);
	}
}

/* Стили для кнопки возврата */
.back-button {
	position: absolute;
	top: 0;
	left: 0;
	width: 45px;
	height: 45px;
	border: none;
	border-radius: 0 0 var(--border-radius) 0;
	background: var(--input-bg);
	color: var(--input-icon);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	z-index: 10;
	text-decoration: none;
}

.back-button:hover {
	background: var(--color-primary);
	color: var(--color-text-light);
	transform: translateX(-3px);
}

.back-button i {
	font-size: 1.2rem;
	transition: transform 0.3s ease;
}

/* Адаптив для мобильных устройств */
@media (max-width: 480px) {
	.back-button {
		width: 40px;
		height: 40px;
	}
}

/* Стили для ссылок регистрации и входа */
.register-link,
.login-link {
	text-align: center;
	margin-top: 20px;
}

.register-link p,
.login-link p {
	color: var(--form-text-color);
	font-size: 14px;
}

.register-link a,
.login-link a {
	color: #0066cc;
	text-decoration: none;
	font-weight: var(--font-weight-medium);
	transition: color 0.3s ease;
}

.register-link a:hover,
.login-link a:hover {
	color: #6633cc;
	text-decoration: underline;
}

/* Стили для сообщений об ошибках */
.input-group small {
	display: block;
	color: #dc3545;
	font-size: 12px;
	margin-top: 5px;
	position: absolute;
	bottom: -20px;
	left: 0;
	width: 100%;
}
