@import url(base.css);
@import url(select.css);

html {
	overflow-x: hidden;
	scrollbar-width: none;
}

body.auth {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.auth-layout {
	max-width: 390px;
	margin: 20px auto;
	padding-left: max(15px, env(safe-area-inset-left));
	padding-right: max(15px, env(safe-area-inset-right));
	width: 100%;
}

.auth-logo {
	width: 80px;
	margin: 0 auto 20px;
}

h1 {
	font-size: 30px;
	line-height: 1;
	margin-bottom: 10px;
	text-align: center;
}

.auth-block {
	display: grid;
	grid-template-columns: 100% 100%;
	gap: 50px;
	align-items: start;
}

.auth-block > div {
	transition: all 0.25s ease-in-out;
}

.auth-block.auth-form-hidden .auth-form,
.auth-block.auth-form-hidden .auth-form .auth-form-button.visible,
.auth-block .code-form {
	visibility: hidden;
	opacity: 0;
}

.auth-block.auth-form-hidden .code-form {
	visibility: visible;
	opacity: 1;
}

.auth-block.auth-form-hidden > div {
	transform: translateX(calc(-100% - 50px));
}

.auth-descr {
	font-weight: 500;
	color: var(--gray);
	margin-bottom: 30px;
	line-height: 1.5;
	text-align: center;
}

.auth-form-input {
	display: block;
	width: 100%;
	height: 50px;
	background: var(--light);
	border: 1px solid var(--light-gray);
	font-size: 20px;
	border-radius: 12px;
	padding: 0 20px;
	margin-bottom: 20px;
	outline: none;
	transition: all 0.25s ease-in-out;
}

.auth-form-input:focus {
	border-color: var(--gray);
}

.auth-form-input.error {
	border-color: var(--red);
	background: rgb(230 32 88 / 5%);
}

.auth-form-button {
	visibility: hidden;
	opacity: 0;
	width: 100%;
	height: 50px;
	font-size: 18px;
	font-weight: 500;
	color: var(--white);
	background: var(--accent);
	border: 0;
	border-radius: 12px;
	transition: all 0.25s ease-in-out;
	cursor: pointer;
}

.auth-form-button:hover {
	background: var(--accent-alternate);
}

.auth-form-button.visible {
	visibility: visible;
	opacity: 1;
}

.captcha-wrapper {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
}

.captcha-wrapper .captcha {
	width: 100%;
	height: 50px;
	background: var(--light);
	border-radius: 12px;
	border: 1px solid var(--light-gray);
	overflow: hidden;
}

.captcha-wrapper img {
	height: 100%;
}

.captcha-wrapper input {
	margin-bottom: 0;
}

.code-inputs {
	display: grid;
	grid-template-columns: repeat(4, 50px);
	gap: 10px;
	justify-content: center;
}

.code-inputs input {
	width: 100%;
	height: 50px;
	background: var(--light);
	border: 1px solid var(--light-gray);
	font-size: 20px;
	border-radius: 12px;
	outline: none;
	transition: all 0.25s ease-in-out;
	text-align: center;
}

.code-inputs input:focus {
	border-color: var(--gray);
}

.code-inputs.error {
	animation: codeError 0.5s ease-in-out;
}

@keyframes codeError {
	0% {
		transform: translateX(0);
	}
	10% {
		transform: translateX(-5px);
	}
	20% {
		transform: translateX(5px);
	}
	30% {
		transform: translateX(-4px);
	}
	40% {
		transform: translateX(4px);
	}
	50% {
		transform: translateX(-3px);
	}
	60% {
		transform: translateX(3px);
	}
	70% {
		transform: translateX(-2px);
	}
	80% {
		transform: translateX(2px);
	}
	90% {
		transform: translateX(-1px);
	}
	100% {
		transform: translateX(0);
	}
}

.code-inputs.error input {
	border-color: var(--red);
	background: rgb(230 32 88 / 5%);
}

.auth-layout.success {
	opacity: 0;
	transition: all 0.25s ease-in-out;
	transition-delay: 0.3s;
}

.auth-layout.success .code-inputs input {
	border-color: var(--green);
	background: rgb(13 213 0 / 5%);
}

.resend-code-button {
	font-size: 15px;
	font-weight: 400;
	background: 0;
	border: 0;
	margin: 40px auto 0;
	display: block;
	cursor: default;
	color: var(--gray);
}

.resend-code-button.active {
	font-weight: 500;
	color: var(--accent);
	cursor: pointer;
}

.popup {
	display: grid;
	align-items: center;
	position: fixed;
	inset: 0;
	visibility: hidden;
	opacity: 0;
	background: rgb(0 0 0 / 50%);
	padding: 0 15px;
	overflow-x: auto;
	scrollbar-width: none;
	transition: all 0.25s ease-in-out;
	z-index: 100;
}

.popup.active {
	visibility: visible;
	opacity: 1;
}

.popup-body {
	position: relative;
	background: var(--white);
	padding: 30px;
	margin: 15px auto;
	max-width: 420px;
	width: 100%;
	border-radius: 20px;
	transform: scale(0.5);
	will-change: transform;
	transition: all 0.25s ease-in-out;
}

.popup.active .popup-body {
	transform: scale(1);
}

.popup-title {
	font-size: 22px;
	line-height: 1;
	text-align: center;
	margin-bottom: 20px;
}

.role-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 40px;
	background: var(--light);
	border: 1px solid var(--light-gray);
	border-radius: 12px;
	margin-bottom: 20px;
}

.role-switch label {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 100%;
	height: 100%;
	font-size: 16px;
	cursor: pointer;
	z-index: 1;
}

.role-switch label input {
	display: none;
}

.role-switch label .radio-checkmark {
	position: absolute;
	inset: 3px;
	z-index: -1;
	border-radius: 9px;
}

.role-switch label input:checked + .radio-checkmark {
	background: var(--light-gray);
}

.role-fields {
	display: none;
}

.role-fields.active {
	display: block;
}

.registration-form .auth-form-button {
	visibility: visible;
	opacity: 1;
}
