/*
	Окно входа и регистрации (auth/auth.js) — для любой страницы сайта.
	Цвета берутся из переменных страницы (студия: --surface, --text, --accent …), а без них — свои
	светлые. Все классы с префиксом auth_ — не пересекаются со стилями страниц.
*/

.auth_layer{
	--auth-bg: var(--surface, #ffffff);
	--auth-text: var(--text, #1c1f24);
	--auth-muted: var(--text-2, #5b616b);
	--auth-line: var(--line-strong, #cfd4da);
	--auth-field: var(--surface-2, #f5f6f8);
	--auth-accent: var(--accent, #1a73e8);
	--auth-accent-text: #ffffff;
	--auth-danger: var(--danger, #d93025);
	--auth-radius: var(--r-lg, 12px);
	position: fixed;
	inset: 0;
	z-index: 100100;
	display: grid;
	place-items: center;
	padding: 16px;
	font-family: inherit;
	font-size: 14px;
	color: var(--auth-text);
}
.auth_layer[hidden]{
	display: none;
}
html.auth_open{
	overflow: hidden;
}
.auth_backdrop{
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 16, .55);
}
.auth_dialog{
	position: relative;
	width: min(400px, 100%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 22px 22px 18px;
	border-radius: var(--auth-radius);
	background: var(--auth-bg);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.auth_x{
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--auth-muted);
	cursor: pointer;
}
.auth_title{
	margin: 0 32px 6px 0;
	font-size: 18px;
	font-weight: 600;
}
.auth_reason{
	margin: 0 0 14px;
	color: var(--auth-muted);
	line-height: 1.45;
}
.auth_tabs{
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin: 12px 0 16px;
	padding: 3px;
	border-radius: 10px;
	background: var(--auth-field);
}
.auth_tab{
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--auth-muted);
	font: inherit;
	cursor: pointer;
}
.auth_tab[aria-selected="true"]{
	background: var(--auth-bg);
	color: var(--auth-text);
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
/* вход через Google (auth.js): кнопка во всю ширину, под ней — черта «or with email» */
.auth_google{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 42px;
	border: 1px solid var(--auth-line);
	border-radius: 8px;
	background: var(--auth-bg);
	color: var(--auth-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.auth_google svg{
	flex: none;
}
.auth_google:disabled{
	opacity: .65;
	cursor: default;
}
.auth_or{
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 0;
	color: var(--auth-muted);
	font-size: 12.5px;
}
.auth_or::before,
.auth_or::after{
	content: "";
	flex: 1;
	height: 1px;
	background: var(--auth-line);
}
.auth_form{
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.auth_field{
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--auth-muted);
	font-size: 13px;
}
.auth_input{
	box-sizing: border-box;
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--auth-line);
	border-radius: 8px;
	background: var(--auth-field);
	color: var(--auth-text);
	font: inherit;
	font-size: 15px;
}
.auth_input:focus{
	outline: 2px solid var(--auth-accent);
	outline-offset: -1px;
	border-color: transparent;
}
.auth_pass{
	position: relative;
	display: block;
}
.auth_pass .auth_input{
	padding-right: 64px;
}
.auth_eye{
	position: absolute;
	top: 4px;
	right: 4px;
	height: 32px;
	padding: 0 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--auth-muted);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}
.auth_hint,
.auth_note{
	margin: 0;
	color: var(--auth-muted);
	font-size: 12.5px;
}
.auth_note{
	margin-top: 10px;
}
/* согласие с условиями при регистрации (auth.js) */
.auth_terms{
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--auth-muted);
	font-size: 12.5px;
	cursor: pointer;
}
.auth_terms input{
	flex: none;
	margin: 2px 0 0;
}
.auth_terms a{
	color: inherit;
}
.auth_social[hidden],
.auth_tabs[hidden],
.auth_field[hidden],
.auth_switch[hidden],
.auth_hint[hidden],
.auth_note[hidden],
.auth_terms[hidden],
.auth_error[hidden],
.auth_reason[hidden]{
	display: none;
}
.auth_error{
	margin: 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: rgba(217, 48, 37, .12);
	color: var(--auth-danger);
	line-height: 1.4;
}
.auth_submit{
	height: 42px;
	margin-top: 4px;
	border: 0;
	border-radius: 8px;
	background: var(--auth-accent);
	color: var(--auth-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.auth_submit:disabled{
	opacity: .65;
	cursor: default;
}
.auth_switch{
	margin: 14px 0 0;
	color: var(--auth-muted);
	text-align: center;
}
.auth_link{
	padding: 0;
	border: 0;
	background: none;
	color: var(--auth-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
@media (pointer: fine){
	.auth_x:hover,
	.auth_eye:hover{ background: var(--auth-field); color: var(--auth-text); }
	.auth_google:hover:not(:disabled){ background: var(--auth-field); }
	.auth_link:hover{ text-decoration: underline; }
}
@media (max-width: 480px){
	/* 16px — чтобы iOS не увеличивал страницу при фокусе */
	.auth_input{ font-size: 16px; }
	.auth_dialog{ padding: 20px 16px 16px; }
}
