@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
	/* Standard color palette variables */
	--primary: rgb(0, 81, 255); /* Replaced dynamically in ASP, but this is the fallback */
	--primary-hover: rgb(206, 3, 3); /* Red accent from Frigo Point */
	--primary-color: #ffffff; /* White text fallback */
	
	/* Brand Colors (Frigo Point & Gesto) */
	--brand-blue: #0f62fe;     /* Modern brand blue */
	--brand-red: #da1e28;      /* Modern brand red */
	--brand-black: #0f172a;    /* Slate-900 / Deep black */
	--brand-white: #ffffff;    /* Absolute white */
	
	/* Neutral Palette */
	--gray-50: #f8fafc;
	--gray-100: #f1f5f9;
	--gray-200: #e2e8f0;
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-500: #64748b;
	--gray-600: #475569;
	--gray-700: #334155;
	--gray-800: #1e293b;
	--gray-900: #0f172a;
	
	/* Shadows */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	--shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
	--shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
	
	/* Fonts */
	--font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	
	/* Transitions */
	--transition-fast: 0.15s ease;
	--transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-sans);
	background-color: var(--gray-50);
	color: var(--gray-800);
	display: flex;
	flex-direction: column;
	position: relative;
}

/* Elegant background representing Italian Tricolore (Green, White, Red) */
.login-container {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 100%;
	padding: 48px 24px;
	z-index: 10;
	overflow: hidden;
	/* Vertical stripes (Green, White, Red) by default on PC and Mobile Landscape with subtle anti-alias transitions */
	background: linear-gradient(90deg, 
		rgba(0, 143, 57, 0.28) 0%, 
		rgba(0, 143, 57, 0.28) 33.1%, 
		rgba(255, 255, 255, 0.85) 33.5%, 
		rgba(255, 255, 255, 0.85) 66.4%, 
		rgba(200, 16, 46, 0.28) 66.8%, 
		rgba(200, 16, 46, 0.28) 100%
	), #f8fafc;
}

/* Diagonal stripes only on Mobile in Portrait mode for dynamic layout (with anti-alias padding) */
@media (max-width: 768px) and (orientation: portrait) {
	.login-container {
		background: linear-gradient(125deg, 
			rgba(0, 143, 57, 0.28) 0%, 
			rgba(0, 143, 57, 0.28) 29.2%, 
			rgba(255, 255, 255, 0.85) 30.8%, 
			rgba(255, 255, 255, 0.85) 69.2%, 
			rgba(200, 16, 46, 0.28) 70.8%, 
			rgba(200, 16, 46, 0.28) 100%
		), #f8fafc;
	}
}

/* Glowing blurred blobs behind card for high-end SaaS feel representing Italian Tricolore */
.bg-glow {
	position: absolute;
	width: 450px;
	height: 450px;
	border-radius: 50%;
	filter: blur(140px);
	opacity: 0.08;
	z-index: -1;
	pointer-events: none;
	animation: float 15s ease-in-out infinite alternate;
}

.bg-glow.green {
	background-color: #008f39; /* Italian Green */
	top: 15%;
	left: 15%;
}

.bg-glow.white {
	background-color: #ffffff; /* Italian White */
	top: 35%;
	left: 35%;
	width: 500px;
	height: 500px;
	opacity: 0.45;
	animation-delay: -5s;
}

.bg-glow.red {
	background-color: #c8102e; /* Italian Red */
	bottom: 15%;
	right: 15%;
	animation-delay: -10s;
}

@keyframes float {
	0% {
		transform: translate(0, 0) scale(1);
	}
	100% {
		transform: translate(40px, 30px) scale(1.1);
	}
}

/* Center Brand Logo (Frigo Point) inside/above Form Card */
.login-brand-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
}

.login-brand-logo img {
	height: 90px;
	width: auto;
	object-fit: contain;
	display: block;
	transition: transform var(--transition-normal);
}

.login-brand-logo img:hover {
	transform: scale(1.02);
}

/* Inline Gesto Logo next to header text */
.gesto-header-logo {
	height: 22px;
	width: auto;
	object-fit: contain;
	display: inline-block;
	transition: transform var(--transition-normal);
	vertical-align: middle;
}

.gesto-header-logo:hover {
	transform: scale(1.04);
}

/* Card Container */
.login-form-container {
	width: 100%;
	max-width: 460px;
	perspective: 1000px;
	z-index: 20;
}

.login {
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(12px);
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	padding: 40px;
	box-shadow: 0 0 25px rgba(255, 255, 255, 0.9), 0 0 50px rgba(255, 255, 255, 0.4), 0 12px 40px rgba(0, 0, 0, 0.04), var(--shadow-lg), var(--shadow-xl);
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: relative;
	overflow: hidden;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Glassmorphic decorative top line in Italian Tricolore */
.login::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: linear-gradient(90deg, #008f39 0%, #008f39 33.3%, #ffffff 33.3%, #ffffff 66.6%, #c8102e 66.6%, #c8102e 100%);
}

.login-header {
	font-size: 20px;
	font-weight: 600;
	color: var(--brand-black);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	letter-spacing: -0.3px;
	margin-bottom: 8px;
}

/* Modern Input wrapper with icon styling */
.login-body {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.form-group > label {
	font-size: 14px;
	font-weight: 600;
	color: var(--gray-700);
	letter-spacing: -0.1px;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.input-wrapper input {
	width: 100%;
	height: 48px;
	padding: 12px 16px 12px 48px;
	font-size: 15px;
	font-family: var(--font-sans);
	color: var(--gray-900);
	background-color: var(--gray-50);
	border: 1px solid var(--gray-200);
	border-radius: 10px;
	outline: none;
	transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper input::placeholder {
	color: var(--gray-400);
	opacity: 1;
}

/* Focus effects using dynamic --primary variable */
.input-wrapper input:focus {
	background-color: var(--brand-white);
	border-color: var(--primary);
	box-shadow: 0 0 0 4px rgba(0, 81, 255, 0.12), var(--shadow-sm);
}

/* If --primary is passed in rgb code like "0, 81, 255" from database, this rule leverages it */
@supports (border-color: var(--primary)) {
	.input-wrapper input:focus {
		border-color: var(--primary);
		box-shadow: 0 0 0 4px rgba(0, 81, 255, 0.12);
	}
}

.input-icon {
	position: absolute;
	left: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gray-400);
	pointer-events: none;
	transition: color var(--transition-fast);
}

.input-icon svg {
	width: 20px;
	height: 20px;
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
	color: var(--primary);
}

/* Password eye button styling */
.password-wrapper {
	position: relative;
}

.password-wrapper input {
	padding-right: 48px; /* Extra space on the right for eye icon */
}

.toggle-button {
	position: absolute;
	right: 16px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--gray-400);
	transition: color var(--transition-fast), transform var(--transition-fast);
	user-select: none;
	z-index: 5;
}

.toggle-button:hover {
	color: var(--gray-700);
	transform: scale(1.05);
}

.toggle-button:active {
	transform: scale(0.95);
}

.eye-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
	display: block;
}

/* Error alerts styling */
.login-error {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background-color: rgba(218, 30, 40, 0.05);
	border: 1px solid rgba(218, 30, 40, 0.15);
	border-radius: 10px;
	padding: 16px;
	color: var(--brand-red);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	animation: shake 0.4s ease;
}

.error-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-6px); }
	75% { transform: translateX(6px); }
}

/* Submit Button styling */
.submit {
	width: 100%;
	height: 48px;
	background-color: var(--primary);
	color: var(--primary-color);
	border: none;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	font-family: var(--font-sans);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 12px rgba(0, 81, 255, 0.15);
	transition: var(--transition-normal);
}

.submit-arrow {
	width: 18px;
	height: 18px;
	transition: transform var(--transition-fast);
}

.submit:hover {
	filter: brightness(0.95);
	box-shadow: 0 6px 16px rgba(0, 81, 255, 0.25);
}

.submit:hover .submit-arrow {
	transform: translateX(4px);
}

.submit:active {
	transform: scale(0.98);
}

/* Footer / register / password recovery links */
.div-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
	font-size: 14px;
	gap: 16px;
}

.btn-link {
	background: none;
	border: none;
	color: var(--gray-600);
	font-family: var(--font-sans);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: color var(--transition-fast), opacity var(--transition-fast);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	padding: 4px 0;
}

.btn-link:hover {
	color: var(--brand-blue);
	text-decoration: underline;
}

.float-left {
	margin-right: auto;
}

.float-right {
	margin-left: auto;
}

.spacer {
	display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.login-container {
		padding: 32px 16px;
	}
	
	.login-brand-logo img {
		height: 72px;
	}
	
	.gesto-header-logo {
		height: 20px;
	}
	
	.login {
		padding: 32px 24px;
		gap: 20px;
	}
	
	.login-header {
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	.login-container {
		padding: 24px 12px;
	}
	
	.login-brand-logo img {
		height: 60px;
	}
	
	.gesto-header-logo {
		height: 18px;
	}
	
	.login-header {
		font-size: 16px;
	}
	
	.div-link {
		flex-direction: column;
		align-items: center;
		gap: 12px;
	}
	
	.btn-link {
		text-align: center;
		width: 100%;
		justify-content: center;
	}
}

/* Styling for corporate value box (now placed outside the login card) */
.login-value-box {
	margin-top: 20px;
	padding: 10px 16px;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(12px);
	border-radius: 12px;
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.7);
	box-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 8px 24px rgba(0, 0, 0, 0.03), var(--shadow-md);
	width: 100%;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
	opacity: 0;
}

/* Subtle Italian flag accent on the bottom border */
.login-value-box::before {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: linear-gradient(90deg, #008f39 0%, #008f39 33.3%, #ffffff 33.3%, #ffffff 66.6%, #c8102e 66.6%, #c8102e 100%);
}

/* Slider navigation buttons */
.value-nav-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--gray-400);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
	flex-shrink: 0;
	padding: 0;
}

.value-nav-btn:hover {
	color: var(--gray-800);
	background-color: var(--gray-100);
	transform: scale(1.1);
}

.value-nav-btn:active {
	transform: scale(0.9);
}

.value-nav-btn svg {
	width: 16px;
	height: 16px;
}

/* Slider text container */
.login-value-content {
	flex-grow: 1;
	text-align: center;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 4px;
}

#login-value-text {
	font-size: 11.5px;
	color: var(--gray-600);
	font-style: italic;
	line-height: 1.5;
	transition: opacity 0.2s ease-in-out;
	width: 100%;
	white-space: normal;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}