html {
	overflow-x: hidden;
}

body {
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Login flow layout */
.login-flow {
	pointer-events: none;

	position: relative;
	width: 100%;
	max-width: 100%;
	min-height: clamp(22rem, 50vh, 36rem);
	margin: 0 auto;
	padding: clamp(1rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1.5rem) clamp(1.5rem, 5vw, 2.5rem);
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: visible;
}

.login-flow__title,
.login-flow__subtitle {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	max-width: 36rem;
	padding: 0 0.25rem;
	box-sizing: border-box;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

.login-flow__title {
	font-size: clamp(1.35rem, 4.5vw, 2rem);
	line-height: 1.25;
	margin-bottom: 0.5rem;
}

.login-flow__subtitle {
	font-size: clamp(1rem, 3vw, 1.25rem);
	line-height: 1.35;
	font-weight: normal;
	margin-top: 0;
	margin-bottom: 1rem;
}

.login-flow .login-box {
	width: 100%;
	max-width: 32rem;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.login-flow__card {
	margin-top: 10px;
	padding: clamp(1rem, 3vw, 1.25rem);
	border-radius: 5px;
	box-sizing: border-box;
}

.login-flow__card form input[type="text"],
.login-flow__card form input[type="email"],
.login-flow__card form input[type="password"],
.login-flow__card form input[type="submit"] {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.login-flow__card > form + .login-flow__actions,
.login-flow__card > form ~ .login-flow__actions {
	margin-top: 0.75rem;
}

.login-flow__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	align-items: stretch;
}

.login-flow__actions button,
.login-flow__actions input[type="submit"] {
	flex: 1 1 9rem;
	min-height: 44px;
	min-width: 0;
}

.login-flow__link {
	display: inline-block;
	padding: 0.25rem 0;
	color: #444;
}

#message {
	display: block;
	max-width: 36rem;
	margin: 0 auto;
	/* padding: 0 clamp(0.75rem, 3vw, 1.5rem); */
	text-align: center;
	box-sizing: border-box;
	word-wrap: break-word;
}

.auth_inputs {
	flex: 1 1 0;
	min-width: 0;
	width: auto !important;
	max-width: 3.125rem;
	height: clamp(2.75rem, 12vw, 3.75rem) !important;
	font-size: clamp(1.125rem, 5vw, 1.5rem);
	text-align: center;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

#code_login {
	width: 100%;
	max-width: 100%;
	margin-bottom: 0.75rem;
	gap: clamp(0.25rem, 2vw, 0.625rem);
	box-sizing: border-box;
}

/* Chrome, Edge, Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Firefox */
input[type=number] {
	-moz-appearance: textfield;
}

button {
	transition: opacity 0.3s ease;
}

button[disabled],
button:disabled {
	cursor: initial;

	opacity: .5;
}

a {
	cursor: pointer;
}

#password_login {
	margin-bottom: 0.75rem;
	position: relative;
}

#show_password {

	position: absolute;
	inset: auto 0 0 auto;

	height: 44px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.login-slide {
	position: absolute;
	left: 0;
	right: 0;
	width: 100%;
	max-width: 36rem;
	margin-left: auto;
	margin-right: auto;
	padding: 0 clamp(0.25rem, 2vw, 0.75rem);
	box-sizing: border-box;

	transform: translateX(100%);
	opacity: 0;

	transition:
		transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.18s ease;

	will-change: transform, opacity;
}

/* active/current panel */
.login-slide.active {
	pointer-events: initial;

	transform: translateX(0);
	opacity: 1;
	z-index: 2;
}

/* previous panel leaving */
.login-slide.prev-step {
	transform: translateX(-35%);
	opacity: 0;
	z-index: 1;
}

#code_login .auth_inputs {
	transform: translateY(12px);
	opacity: 0;

	transition:
		transform 0.18s ease-out,
		opacity 0.18s ease-out;
}

/* active state */
#enter_authcode.active #code_login .auth_inputs {
	transform: translateY(0);
	opacity: 1;
}

/* wait for parent slide, then rapid stagger */
#enter_authcode.active #auth_1 { transition-delay: 0.20s; }
#enter_authcode.active #auth_2 { transition-delay: 0.25s; }
#enter_authcode.active #auth_3 { transition-delay: 0.30s; }
#enter_authcode.active #auth_4 { transition-delay: 0.35s; }
#enter_authcode.active #auth_5 { transition-delay: 0.40s; }
#enter_authcode.active #auth_6 { transition-delay: 0.45s; }

#password_login input[type="password"],
#password_login input[type="text"] {
	width: 100%;
	padding-right: 2.75rem;
	box-sizing: border-box;
}

#show_password {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

/* Larger screens — scale up ~25% */
@media screen and (min-width: 769px) {
	.login-flow {
		min-height: clamp(22rem, 50vh, 45rem);
		padding: clamp(1rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1.875rem) clamp(1.5rem, 5vw, 3.125rem);
	}

	.login-flow__title,
	.login-flow__subtitle,
	#message {
		max-width: 50rem;
	}

	.login-flow__title {
		font-size: clamp(1.35rem, 4.5vw, 2.5rem);
		margin-bottom: 0.625rem;
	}

	.login-flow__subtitle {
		font-size: clamp(1rem, 3vw, 1.5625rem);
		margin-bottom: 1.25rem;
	}

	.login-flow .login-box,
	.login-slide {
		max-width: 50rem;
	}

	.login-flow__card {
		padding: clamp(1rem, 3vw, 1.5625rem);
	}

	.login-flow__card label,
	.login-flow__card form input[type="text"],
	.login-flow__card form input[type="email"],
	.login-flow__card form input[type="password"],
	.login-flow__card form input[type="submit"],
	.login-flow__actions button,
	.login-flow__actions input[type="submit"] {
		font-size: 1.40625rem;
		padding: 0.78125rem;
	}

	.login-flow__actions button,
	.login-flow__actions input[type="submit"] {
		flex: 1 1 11.25rem;
		min-height: 55px;
	}

	.login-flow__link {
		font-size: 1.09375rem;
	}

	.auth_inputs {
		max-width: 3.90625rem;
		height: clamp(2.75rem, 12vw, 4.6875rem) !important;
		font-size: clamp(1.125rem, 5vw, 1.875rem);
	}

	#code_login {
		gap: clamp(0.25rem, 2vw, 0.78125rem);
		margin-bottom: 0.9375rem;
	}

	#password_login input[type="password"],
	#password_login input[type="text"] {
		padding-right: 3.4375rem;
	}

	#show_password {
		height: 55px;
		width: 55px;
	}

	#message {
		font-size: 1.6rem;
	}
}

/* Tablet and below */
@media screen and (max-width: 768px) {
	.login-flow {
		/* min-height: auto; */
		align-items: flex-start;
		padding-top: 1rem;
		padding-bottom: 2rem;
	}

	.login-slide.prev-step {
		transform: translateX(-25%);
	}
}

/* Large phones */
@media screen and (max-width: 480px) {
	.login-flow__actions {
		flex-direction: column;
	}

	.login-flow__actions button,
	.login-flow__actions input[type="submit"] {
		flex: 1 1 auto;
		width: 100%;
	}

	.auth_inputs {
		max-width: 2.75rem;
	}
}

/* Small phones (e.g. iPhone SE) */
@media screen and (max-width: 360px) {
	.login-flow {
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}

	.auth_inputs {
		max-width: 2.5rem;
		height: 2.5rem !important;
		font-size: 1.125rem;
	}

	#code_login {
		gap: 0.2rem;
	}
}

/* Short viewports (landscape phones, small laptop windows) */
@media screen and (max-height: 500px) and (orientation: landscape) {
	.login-flow {
		min-height: auto;
		align-items: flex-start;
		padding-top: 0.75rem;
		padding-bottom: 1rem;
	}

	.login-flow__title {
		font-size: 1.25rem;
	}

	.login-flow__subtitle {
		font-size: 0.95rem;
		margin-bottom: 0.5rem;
	}
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
	.login-flow {
		padding-left: max(0.75rem, env(safe-area-inset-left));
		padding-right: max(0.75rem, env(safe-area-inset-right));
		padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
	}
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
	.login-slide,
	#code_login .auth_inputs,
	button {
		transition: none !important;
	}

	.login-slide,
	.login-slide.prev-step,
	#code_login .auth_inputs {
		transform: none !important;
	}

	#enter_authcode.active #auth_1,
	#enter_authcode.active #auth_2,
	#enter_authcode.active #auth_3,
	#enter_authcode.active #auth_4,
	#enter_authcode.active #auth_5,
	#enter_authcode.active #auth_6 {
		transition-delay: 0s !important;
	}
}
