* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: 'Asap', sans-serif;
}

/* ===== затемнение под окном ===== */

.auth-overlay {
	position: fixed;
	inset: 0;
	z-index: 300;

	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;

	background: rgba(20, 20, 25, 0.35);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);

	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease;
}

.auth-overlay.open {
	opacity: 1;
	visibility: visible;
}

/* ===== карточка окна ===== */

.auth-card {
	position: relative;
	width: 100%;
	max-width: 380px;
	padding: 60px 32px;
	border-radius: 24px;

	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);

	transform: scale(0.94) translateY(10px);
	transition: transform 0.3s ease;
}

.auth-overlay.open .auth-card {
	transform: scale(1) translateY(0);
}

.auth-close {
	position: absolute;
	top: 20px;
	right: 16px;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.05);
	color: #4a4a4a;
	line-height: 1;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-close:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #1a1a1a;
}

/* ===== переключатель Вход / Регистрация ===== */

.auth-switch {
	display: flex;
	padding: 4px;
	margin-bottom: 28px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.05);
}

.auth-switch-item {
	flex: 1;
	text-align: center;
	padding: 9px 0;
	border: none;
	border-radius: 9px;
	font-size: 13px;
	font-family: inherit;
	background: transparent;
	color: #6b6b6b;
	cursor: pointer;
	transition:
		background-color 0.3s ease,
		color 0.3s ease;
}

.auth-switch-item.active {
	background: #ffffff;
	color: #366ee6;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ===== панели форм ===== */

.auth-panel {
	display: none;
}

.auth-panel.active {
	display: block;
}

.auth-title {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 600;
	color: #1a1a1a;
}

.auth-subtitle {
	margin: 0 0 26px;
	font-size: 13px;
	color: #7a7a7a;
}

/* форма */

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.auth-field label {
	font-size: 12px;
	color: #4a4a4a;
}

.auth-field input {
	padding: 11px 14px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.7);
	outline: none;
	transition:
		border-color 0.3s ease,
		box-shadow 0.3s ease;
}

.auth-field input::placeholder {
	color: #b0b0b0;
}

.auth-field input:focus {
	border-color: #366ee6;
	box-shadow: 0 0 0 3px rgba(54, 110, 230, 0.15);
}

.auth-field input:invalid:not(:placeholder-shown) {
	border-color: #e05555;
}

/* строка "запомнить / забыли пароль" */

.auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: -2px;
}

.auth-checkbox {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	color: #4a4a4a;
	cursor: pointer;
}

.auth-checkbox input {
	width: 15px;
	height: 15px;
	accent-color: #366ee6;
	cursor: pointer;
}

.auth-checkbox-terms {
	margin-top: 2px;
}

.auth-link {
	font-size: 12px;
	color: #366ee6;
	text-decoration: none;
}

.auth-link:hover {
	text-decoration: underline;
}

/* ошибка */

.auth-error {
	margin: -6px 0 0;
	font-size: 12px;
	color: #e05555;
	min-height: 14px;
}

/* кнопка отправки */

.auth-submit {
	margin-top: 6px;
	padding: 12px 0;
	border: none;
	border-radius: 10px;
	background-color: #366ee6;
	color: white;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition:
		background-color 0.4s ease,
		transform 0.2s ease;
}

.auth-submit:hover {
	background-color: #074ce0;
	transform: translateY(-2px);
}

.auth-footer {
	margin: 22px 0 0;
	text-align: center;
	font-size: 12px;
	color: #7a7a7a;
}

.auth-footer-link {
	border: none;
	background: transparent;
	padding: 0;
	font-family: inherit;
	font-size: 12px;
	color: #366ee6;
	cursor: pointer;
}

.auth-footer-link:hover {
	text-decoration: underline;
}

@media (max-width: 480px) {
	.auth-card {
		padding: 28px 22px;
	}
}