@import url('../fonts/rubik.css');

:root {
	--auth-red: #e31e24;
	--auth-red-dark: #c4181e;
	--auth-charcoal: #1a1a1a;
	--auth-rail: #141414;
	--auth-bg: #f8f9fa;
	--auth-card: #ffffff;
	--auth-text: #1a1a1a;
	--auth-muted: #6b7280;
	--auth-line: #e5e7eb;
	--auth-radius: 18px;
	--auth-pill: 12px;
	--auth-gutter: 24px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body.auth-page,
body.auth-page input,
body.auth-page button,
body.auth-page select,
body.auth-page textarea,
body.auth-page label,
body.auth-page p,
body.auth-page h1,
body.auth-page .form-control {
	font-family: Rubik, "Segoe UI", Tahoma, Arial, sans-serif;
}

html,
body.auth-page {
	margin: 0;
	padding: 0;
	height: 100%;
	min-height: 0 !important;
	max-height: 100%;
	background: var(--auth-bg);
	color: var(--auth-text);
	font-size: 16px;
	direction: rtl;
}

html {
	height: 100%;
	overflow: hidden;
}

body.auth-page {
	overflow: hidden;
}

.auth-shell {
	display: flex;
	flex-direction: row;
	height: 100%;
	max-height: 100%;
	overflow: hidden;
}

.auth-rail {
	width: 280px;
	flex-shrink: 0;
	background: #000;
	color: #fff;
	padding: 32px var(--auth-gutter);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.auth-brand {
	display: flex;
	justify-content: center;
	align-items: center;
}

.auth-logo {
	display: block;
	width: 140px;
	max-width: 70%;
	height: auto;
	margin: 0 auto;
}

.auth-rail-copy {
	color: #c5c5c5;
	font-size: 14px;
	line-height: 1.6;
	margin: 28px 0 0;
	text-align: right;
}

.auth-help {
	background: #222;
	border-radius: 14px;
	padding: 16px;
}

.auth-help h2 {
	margin: 0 0 8px;
	font-size: 15px;
	color: var(--auth-red);
	font-weight: 700;
}

.auth-help p {
	margin: 0;
	font-size: 13px;
	color: #bdbdbd;
	line-height: 1.5;
}

.auth-main {
	flex: 1;
	min-width: 0;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px var(--auth-gutter);
	overflow: auto;
}

.auth-card {
	width: 100%;
	max-width: 440px;
	background: var(--auth-card);
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
	padding: 36px 32px 28px;
}

.auth-card-kicker {
	font-size: 13px;
	color: var(--auth-muted);
	margin: 0 0 6px;
}

.auth-card h1,
.auth-card .auth-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 700;
	color: var(--auth-text);
}

.auth-card .auth-lead,
.auth-card fieldset > p,
.auth-card .reset p,
.auth-card .remind p,
.auth-card .reset-confirm p,
.auth-card .reset-complete p {
	margin: 0 0 24px;
	color: var(--auth-muted);
	font-size: 14px;
	line-height: 1.6;
}

.auth-card fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.auth-card .control-group,
.auth-card .form-group,
#login-form .control-group {
	margin: 0 0 16px;
}

.auth-card label,
.auth-card .control-label,
.auth-card .control-label label {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input.form-control,
.auth-card input.input-small,
.auth-card input.inputbox:not([type="checkbox"]):not([type="hidden"]) {
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-pill);
	background: #fff;
	font-size: 15px;
	line-height: 48px;
	font-family: Rubik, "Segoe UI", Tahoma, Arial, sans-serif;
	color: var(--auth-text);
	outline: none;
	box-shadow: none;
}

.auth-card input:focus {
	border-color: var(--auth-red);
}

.auth-card input.auth-pin,
.auth-card input[type="password"] {
	text-align: center;
	letter-spacing: 0.42em;
	font-size: 18px;
}

.auth-card input.auth-pin::placeholder,
.auth-card input[type="password"]::placeholder {
	letter-spacing: 0.42em;
	color: #9ca3af;
	text-align: center;
}

.auth-card .btn,
.auth-card button[type="submit"],
.auth-card .login-button {
	display: block;
	width: 100%;
	height: 48px;
	margin-top: 8px;
	border: 0;
	border-radius: 999px;
	background: var(--auth-red);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}

.auth-card .btn:hover,
.auth-card button[type="submit"]:hover,
.auth-card .login-button:hover {
	background: var(--auth-red-dark);
}

.auth-card .btn.is-loading,
.auth-card button[type="submit"].is-loading,
.auth-card .btn:disabled,
.auth-card button[type="submit"]:disabled {
	background: #9aa1ab;
	color: #f3f4f6;
	cursor: wait;
	pointer-events: none;
	box-shadow: none;
}

.auth-card .btn.is-loading:hover,
.auth-card button[type="submit"].is-loading:hover,
.auth-card .btn:disabled:hover,
.auth-card button[type="submit"]:disabled:hover {
	background: #9aa1ab;
}

.auth-btn-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.auth-btn-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	flex: 0 0 18px;
	animation: authSpin 0.7s linear infinite;
}

.auth-card .btn.is-loading {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.auth-card .btn.is-loading .auth-btn-spinner {
	display: inline-block;
}

@keyframes authSpin {
	to {
		transform: rotate(360deg);
	}
}

.auth-links {
	list-style: none;
	margin: 20px 0 0;
	padding: 0;
	text-align: center;
}

.auth-links li {
	margin: 0 0 8px;
}

.auth-links a,
.auth-card a {
	color: var(--auth-red);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}

.auth-links a:hover,
.auth-card a:hover {
	text-decoration: underline;
}

.auth-card .nav {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
	text-align: center;
}

.auth-card .nav li {
	margin: 8px 0 0;
}

body.auth-page #system-message-container {
	position: fixed;
	width: 0;
	height: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

#auth-toasts {
	position: fixed;
	left: var(--auth-gutter);
	bottom: 5%;
	right: auto;
	top: auto;
	z-index: 10000;
	width: min(360px, calc(100vw - (var(--auth-gutter) * 2)));
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.auth-toast {
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	border: 0;
	font-family: Rubik, "Segoe UI", Tahoma, Arial, sans-serif;
	color: red;
	background: rgb(255, 228, 228);
	box-shadow: 0 0 10px 0 rgba(205, 30, 11, 0.5);
	animation: authToastIn 0.3s linear;
}

.auth-toast-text {
	flex: 1;
	min-width: 0;
}

.auth-toast-close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	line-height: 0;
}

.auth-toast-close svg {
	display: block;
}

.auth-toast-error .auth-toast-close,
.auth-toast-danger .auth-toast-close,
.auth-toast-warning .auth-toast-close,
.auth-toast-info .auth-toast-close,
.auth-toast-notice .auth-toast-close {
	color: red;
}

.auth-toast-success .auth-toast-close,
.auth-toast-message .auth-toast-close {
	color: green;
}

.auth-toast-error,
.auth-toast-danger,
.auth-toast-warning,
.auth-toast-info,
.auth-toast-notice {
	color: red;
	background: rgb(255, 228, 228);
	box-shadow: 0 0 10px 0 rgba(205, 30, 11, 0.5);
}

.auth-toast-success,
.auth-toast-message {
	color: green;
	background: rgb(218, 249, 223);
	box-shadow: 0 0 10px 0 rgba(11, 205, 61, 0.5);
}

@keyframes authToastIn {
	from {
		opacity: 0;
		transform: translateX(-24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.auth-card .control-group:has(input[required]) > label::after {
	content: "*";
	color: var(--auth-red);
	font-weight: 700;
	margin-inline-start: 0.35em;
}

.auth-field {
	position: relative;
}

.auth-card .control-group.has-error input {
	border-color: var(--auth-red);
}

.auth-tooltip {
	position: absolute;
	left: 12px;
	right: auto;
	top: auto;
	bottom: calc(100% + 4px);
	background: #1a1a1a;
	color: #fff;
	border: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	padding: 8px 12px;
	border-radius: 10px;
	white-space: nowrap;
	z-index: 6;
	pointer-events: none;
	filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.auth-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	bottom: auto;
	left: 16px;
	right: auto;
	border: 6px solid transparent;
	border-top-color: #1a1a1a;
}

.auth-card .hidden,
.auth-card .visually-hidden,
.auth-card .element-invisible {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.auth-card .control-group .controls {
	width: 100%;
}

.auth-card input[type="checkbox"] {
	width: auto;
	height: auto;
	margin-left: 8px;
}

@media (max-width: 860px) {
	.auth-shell {
		flex-direction: column;
		height: 100%;
		max-height: 100%;
	}

	.auth-rail {
		width: 100%;
		flex-shrink: 0;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 20px var(--auth-gutter);
		padding-left: calc(var(--auth-gutter) + env(safe-area-inset-left, 0px));
		padding-right: calc(var(--auth-gutter) + env(safe-area-inset-right, 0px));
	}

	.auth-logo {
		width: 120px;
		max-width: 100%;
	}

	.auth-rail-copy,
	.auth-help {
		display: none;
	}

	.auth-main {
		align-items: center;
		align-items: safe center;
		justify-content: center;
		width: 100%;
		padding: 24px var(--auth-gutter);
		padding-left: calc(var(--auth-gutter) + env(safe-area-inset-left, 0px));
		padding-right: calc(var(--auth-gutter) + env(safe-area-inset-right, 0px));
		padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	}

	.auth-card,
	.auth-card .login_block {
		width: 100%;
		max-width: 440px;
		margin: auto;
	}

	.auth-card {
		padding: 28px var(--auth-gutter);
		border: 1px solid var(--auth-line);
		border-radius: var(--auth-radius);
		background: var(--auth-card);
	}

	.auth-card h1,
	.auth-card .auth-title {
		font-size: 24px;
	}

	.auth-card input[type="text"],
	.auth-card input[type="email"],
	.auth-card input[type="password"],
	.auth-card input.form-control,
	.auth-card input.input-small,
	.auth-card input.inputbox:not([type="checkbox"]):not([type="hidden"]) {
		font-size: 16px;
	}

	.auth-card input.auth-pin,
	.auth-card input[type="password"] {
		letter-spacing: 0.28em;
	}

	.auth-tooltip {
		white-space: normal;
		max-width: calc(100vw - (var(--auth-gutter) * 2));
	}

	#auth-toasts {
		left: var(--auth-gutter);
		right: var(--auth-gutter);
		width: auto;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 860px) and (max-height: 560px) {
	.auth-rail {
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.auth-logo {
		width: 96px;
	}

	.auth-card {
		padding: 24px var(--auth-gutter);
	}
}
