/* Эталон MEKA front: auth + auth-modal-shell + feedback (auth-api.css) */
:root {
	--nav-text: #1f1f1f;
	--nav-muted: #6d6d6d;
	--nav-border: #e6e6e6;
	--page-bg: #ffffff;
	--meka-accent: #3368c6;
	--meka-accent-hover: #2d5db3;
}

.auth {
	position: relative;
	min-height: calc(100vh - 80px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 24px 120px;
}

/* Полноэкранная страница /login/: без кнопки «×» как в модалке */
.auth-page .auth-modal-close {
	display: none;
}

.auth__overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 1;
}

.auth__modal {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 520px;
	width: min(520px, 100%);
	background: #ffffff;
	border: 1px solid var(--nav-border);
	border-radius: 0;
	padding: 32px 36px 34px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.auth__tabs {
	display: flex;
	gap: 16px;
	justify-content: center;
	margin-bottom: 18px;
}

.auth__modal--no-tabs .auth__tabs {
	display: none;
}

.auth__tab {
	border: none;
	background: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	color: var(--nav-muted);
	padding: 6px 0;
	cursor: pointer;
	border-bottom: 2px solid transparent;
}

.auth__tab--active {
	color: var(--nav-text);
	border-color: var(--nav-text);
}

.auth__form {
	display: none;
	flex-direction: column;
	gap: 12px;
}

.auth__form--active {
	display: flex;
}

.auth__confirm {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	text-align: center;
}

.auth__confirm .auth__button {
	width: 100%;
}

.auth__confirm--active {
	display: flex;
}

.auth__confirm-text {
	margin: 0;
	font-size: 13px;
	color: var(--nav-muted);
	text-align: center;
}

.auth__code {
	display: grid;
	grid-template-columns: repeat(4, 56px);
	gap: 10px;
	justify-content: center;
}

.auth__code-input {
	height: 44px;
	text-align: center;
	font-size: 16px;
	border: 1px solid #e3e3e3;
	border-radius: 0;
}

.auth__confirm-note {
	margin: 0;
	font-size: 12px;
	color: var(--nav-muted);
}

.auth__confirm-note a {
	color: var(--nav-text);
	text-decoration: none;
}

.auth__steps {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 12px;
	font-size: 12px;
	color: var(--nav-muted);
}

.auth__step {
	padding: 4px 10px;
	border: 1px solid var(--nav-border);
}

.auth__step--active {
	color: var(--nav-text);
	border-color: var(--nav-text);
}

.auth__step-panel {
	display: none;
	flex-direction: column;
	gap: 12px;
}

.auth__step-panel--active {
	display: flex;
}

.auth__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.auth__label {
	font-size: 12px;
	color: var(--nav-muted);
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
	width: 100%;
	box-sizing: border-box;
}

.auth__label .starrequired {
	flex-shrink: 0;
}

.auth__input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 2px solid #e3e3e3;
	border-radius: 0;
	font-size: 14px;
	font-family: inherit;
	background-color: #ffffff;
	color: #1f1f1f;
}

.auth__input:focus {
	outline: none;
	border-color: var(--meka-accent);
}

.auth__select {
	appearance: none;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236d6d6d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	padding-right: 36px;
}

.auth__password {
	position: relative;
	display: flex;
	align-items: center;
}

.auth__password .auth__input {
	padding-right: 44px;
}

.auth__toggle {
	position: absolute;
	right: 10px;
	border: none;
	background: none;
	color: var(--nav-muted);
	cursor: pointer;
	padding: 4px;
}

.auth__eye {
	width: 18px;
	height: 18px;
	display: block;
}

.auth__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 11px;
	color: var(--nav-muted);
	line-height: 1.35;
	margin-top: 4px;
}

.auth__checkbox input {
	margin-top: 3px;
	flex-shrink: 0;
}

.auth__submit {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 4px;
	padding: 12px 16px;
	border: none;
	background: var(--meka-accent) !important;
	color: #ffffff !important;
	font-size: 14px;
	font-weight: 600;
	border-radius: 0;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.35;
	min-height: 48px;
	text-align: center;
	-webkit-appearance: none;
	appearance: none;
}

.auth__submit:hover,
.auth__submit:focus-visible {
	background: var(--meka-accent-hover) !important;
}

.auth__submit:focus-visible {
	outline: 2px solid var(--meka-accent);
	outline-offset: 2px;
}

.auth__actions-row {
	display: flex;
	gap: 10px;
	margin-top: 6px;
}

.auth__button {
	padding: 12px 16px;
	border: 1px solid var(--meka-accent);
	background: var(--meka-accent);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	text-align: center;
	min-height: 48px;
	box-sizing: border-box;
	line-height: 1.35;
}

.auth__button:hover:not(.auth__button--ghost),
.auth__button:focus-visible:not(.auth__button--ghost) {
	background: var(--meka-accent-hover);
	border-color: var(--meka-accent-hover);
}

.auth__button:focus-visible:not(.auth__button--ghost) {
	outline: 2px solid var(--meka-accent);
	outline-offset: 2px;
}

.auth__actions-row .auth__button {
	flex: 1;
}

.auth__actions-row button.auth__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.auth__button--ghost {
	background: transparent;
	color: var(--meka-accent);
	border-color: var(--meka-accent);
}

.auth__button--ghost:hover,
.auth__button--ghost:focus-visible {
	background: rgba(51, 104, 198, 0.1);
	color: var(--meka-accent-hover);
	border-color: var(--meka-accent-hover);
}

.auth__link {
	display: block;
	text-align: center;
	font-size: 12px;
	color: var(--nav-muted);
	text-decoration: none;
	border: none;
	background: none;
	cursor: pointer;
	font-family: inherit;
	width: 100%;
}

.auth__link:hover {
	color: var(--nav-text);
}

.auth__title {
	margin: 0;
	text-align: center;
	font-size: 16px;
}

.auth__feedback {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.4;
	min-height: 20px;
}

.auth__feedback--error {
	color: #d32f2f;
}

.auth__feedback--success {
	color: #2e7d32;
}

.auth__password-rules {
	margin-bottom: 14px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #f4f6fb;
	border: 1px solid #e2e8f5;
	font-size: 13px;
	line-height: 1.45;
	color: #3d4a6b;
}

.auth__password-rules-title {
	margin: 0 0 8px;
	font-weight: 600;
	font-size: 13px;
	color: #243264;
}

.auth__password-rules-list {
	margin: 0;
	padding-left: 1.15em;
}

.auth__password-rules-list li {
	margin: 4px 0;
}

.auth-modal-shell {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	z-index: 3000;
}

.auth-modal-shell--open {
	display: block;
}

.auth-modal-backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(10, 18, 45, 0.45);
}

.auth-modal-window {
	position: relative;
	margin: 60px auto;
	max-width: 520px;
	z-index: 1;
}

.auth-modal-close {
	position: absolute;
	right: 10px;
	top: 10px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: #eef2ff;
	color: #243264;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	z-index: 2;
}

.meka-auth-reset-hint {
	display: none;
	flex-direction: column;
	gap: 12px;
	text-align: center;
}

.meka-auth-form-wrap .meka-auth-socserv {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #eee;
}

.meka-auth-socserv .bx-auth-lbl {
	font-size: 12px;
	color: var(--nav-muted);
	margin: 0 0 10px;
	text-align: center;
}

.meka-auth-socserv .bx-auth-serv-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.meka-auth-socserv .bx-auth-serv-icons a {
	display: inline-flex;
}

.meka-reg-email-hint {
	font-size: 12px;
	color: var(--nav-muted);
	line-height: 1.4;
	margin: 0 0 12px;
}

@media (max-width: 520px) {
	.auth {
		padding: 24px 16px 100px;
	}

	.auth__modal {
		padding: 24px 20px 24px;
	}

	.auth__actions-row {
		flex-direction: column;
	}
}

html.meka-auth-modal-open {
	overflow: hidden;
}
