:root {
	--primary-color: #4D4D4D;
	--primary-dark: #1B1B1B;
	--primary-light: #697369s;
	--accent-color: #4A90E2;
	--text-color: #FFFFFF;
	--text-muted: #B8C5D6;
	--input-bg: rgba(255, 255, 255, 0.08);
	--input-border: rgba(255, 255, 255, 0.18);
	--input-focus: rgba(255, 255, 255, 0.35);
	--dialog-bg: rgba(8, 18, 32, 0.78);
	--dialog-border: rgba(88, 139, 182, 0.28);
	--shadow-color: rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background-color: #0c1520;
	background-image: url('background.png');
	background-size: cover;
	background-position: center center;
	background-attachment: fixed;
	color: var(--text-color);
	font-size: 14px;
	margin: 0;
	padding: 0;
	min-height: 100vh;
}

/* === DIALOG - the semi-transparent login box === */

dialog {
	background: rgba(0, 5, 22, 0.1);
	backdrop-filter: blur(10px) saturate(1.3);
	-webkit-backdrop-filter: blur(20px) saturate(1.3);
	border: 0px solid var(--primary-dark);
	border-radius: 24px;
	box-shadow:
		0 12px 60px rgba(0, 0, 0, 0.7),
		inset 0 0 0 1px rgba(255, 255, 255, 0.05);
	color: var(--text-color);
	padding: 0;
	width: min(440px, 94vw);
	margin: auto;
	animation: dialogFadeIn 0.4s ease-out;
	height:fit-content;
}

@keyframes dialogFadeIn {
	from {
		opacity: 0;
		transform: translateY(-16px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Let the industrial background show through */
dialog::backdrop {
	background: transparent;
}

#login_box {
	padding-top: 0px;
	padding-bottom: 0px;
	padding-left: 40px;
	padding-right: 40px;
}

form {
	margin: 0;
	width: 100%;
}

/* === LOGO === */

#login_logo {
	height: 50px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 10px;
}

.logo {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	display: inline-block;
	font-size: 32px;
	font-weight: 700;
	cursor: default;
	letter-spacing: -2px;
	margin-top:16px;
	background:linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
	color: white;
}

.logo-left {
	color: white;
	padding: 8px 2px 8px 20px;
	border-top-left-radius: 16px;
	border-bottom-left-radius: 16px;
}

.logo-right {
	color: white;
	padding: 8px 20px 8px 2px;
	font-style: italic;
	border-top-right-radius: 16px;
	border-bottom-right-radius: 16px;
}

/* === FORM FIELDS === */

.form-group {
	margin-bottom: 24px;
	text-align: left;
}

label {
	display: block;
	float: none;
	font-weight: 600;
	font-size: 13px;
	line-height: normal;
	margin: 0 0 8px 0;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

input {
	background-color: var(--input-bg);
	border: 1px solid var(--input-border);
	border-radius: 12px;
	color: var(--text-color);
	font-size: 15px;
	padding: 14px 18px;
	width: 100%;
	transition: all 0.3s ease;
}

input::placeholder {
	color: var(--text-muted);
	opacity: 0.7;
}

input:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: var(--input-focus);
}

input:focus {
	background-color: rgba(255, 255, 255, 0.12);
	border-color: var(--primary-light);
	outline: none;
	box-shadow: 0 0 0 3px rgba(88, 139, 182, 0.15);
}

span {
	margin: 0;
}

/* Hidden select backing the custom company dropdown */
#CompanyNameField {
	display: none;
}

/* Custom company selector */
#CompanySelect {
	background-color: var(--input-bg);
	background-image: url(descending.png);
	background-repeat: no-repeat;
	background-position: right 18px center;
	background-size: 12px !important;
	cursor: pointer;
	padding-right: 42px;
}

.dropdownlist {
	background: rgba(12, 22, 38, 0.97);
	backdrop-filter: blur(10px);
	position: fixed !important;
	max-height: 0;
	list-style: none;
	display: none;
	margin: 0;
	padding: 0;
	border-radius: 12px;
	border: 1px solid var(--dialog-border);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	z-index: 10000;
}

.option {
	position: relative;
	left: -37px;
	background: transparent;
	padding: 12px 16px;
	cursor: pointer;
	border: none;
	margin-bottom: 0;
	width: 100%;
	transition: background 0.2s ease;
	text-align: left;
}

.option:hover {
	background: rgba(88, 139, 182, 0.25);
}

#optionlogo {
	height: 24px;
	width: 96px;
	margin-right: 12px;
	vertical-align: middle;
	display: inline-block;
}

#optionlabel {
	color: var(--text-color);
	vertical-align: middle;
	display: inline-block;
}

/* Password eye toggle */
#eye {
	background: url(eye.png) no-repeat center;
	background-size: 18px;
	display: inline-block;
	width: 40px;
	height: 40px;
	margin-left: -46px;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.2s;
	border: none;
	vertical-align: middle;
}

#eye:hover {
	opacity: 1;
}

#eye:focus {
	box-shadow: none;
	outline: none;
}

/* === DEMO TEXT === */

#demo_text {
	margin: 20px 0;
	padding: 14px 16px;
	background: rgba(74, 144, 226, 0.12);
	border-radius: 10px;
	border-left: 3px solid var(--accent-color);
	font-size: 13px;
	color: var(--text-color);
	text-align: left;
}

/* === LOGIN BUTTON === */

button {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
	border: none;
	border-radius: 12px;
	color: var(--text-color);
	font-size: 16px;
	font-weight: 600;
	margin: 28px 0 20px 0;
	padding: 14px 24px;
	width: 100%;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 16px rgba(88, 139, 182, 0.35);
	position: relative;
	overflow: hidden;
}

button:hover {
	background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
	box-shadow: 0 6px 24px rgba(88, 139, 182, 0.45);
	transform: translateY(-2px);
}

button:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(88, 139, 182, 0.3);
}

.waiting_show {
	position: absolute;
	left: 24px;
	width: 20px;
	height: 20px;
	display: none;
}

/* === RESPONSIVE - narrow screens === */

@media only screen and (max-width: 480px) {
	dialog {
		width: 100%;
		max-width: 100%;
		min-height: 100svh;
		border-left: none;
		border-right: none;
		border-radius: 0;
	}

	#login_box {
		padding: 28px 20px;
	}

	.dropdownlist {
		position: absolute !important;
		top: 100%;
		left: 0;
		right: 0;
	}

	.option {
		left: 0;
	}

	input[type="password"] {
		display: inline;
		width: calc(100% - 46px);
	}
}
