/* Custom styles for Login Page - Bootstrap 4.5 Compatible */

/* Reset body and html */
html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}

/* Login Wrapper - Full height with gradient */
.login-wrapper {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	display: flex;
	align-items: center;
	padding: 20px 0;
	width: 100%;
}

/* Logo Slot */
.logo-container {
	margin-bottom: 1.5rem;
}

.company-logo {
	max-width: 200px;
	width: 60%;
	height: auto;
	object-fit: contain;
}

/* Card Enhancements */
.card {
	border: none;
	border-radius: 0.75rem;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3) !important;
}

.login-card {
	max-width: 440px;
	margin-left: auto;
	margin-right: auto;
}

/* Ensure container is properly centered */
.login-wrapper .container {
	width: 100%;
}

/* Loading Overlay */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.loading-overlay.active {
	display: flex;
}

/* Card Header */
.card-header {
	border-top-left-radius: 0.75rem !important;
	border-top-right-radius: 0.75rem !important;
	border-bottom: none;
	text-align: center;
}

/* Card Footer */
.card-footer {
	background-color: #f8f9fa;
	border-bottom-left-radius: 0.75rem !important;
	border-bottom-right-radius: 0.75rem !important;
	border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Form Control Enhancements */
.form-control {
	height: auto;
	padding: 0.6rem 0.9rem;
	font-size: 0.95rem;
	border: 1px solid #ced4da;
	border-radius: 0.375rem;
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-lg {
	padding: 0.65rem 1rem;
	font-size: 1rem;
	border-radius: 0.5rem;
}

/* Form Group Spacing */
.form-group {
	margin-bottom: 1.1rem;
}

.form-group label {
	margin-bottom: 0.4rem;
	font-size: 0.9rem;
}

/* Button Enhancements */
.btn {
	font-weight: 500;
	transition: all 0.2s ease;
}

.btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
	background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
	background: #6c757d;
	opacity: 0.65;
	box-shadow: none;
	cursor: not-allowed;
}

.btn-lg {
	padding: 0.75rem 1.25rem;
	font-size: 1rem;
	border-radius: 0.5rem;
}

/* Input Group Fixes */
.input-group-lg > .form-control {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.input-group-append .btn {
	border-left: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	border-top-right-radius: 0.5rem;
	border-bottom-right-radius: 0.5rem;
	padding: 0.65rem 1rem;
}

.input-group .form-control:focus {
	z-index: 3;
}

.input-group-append .btn-outline-secondary {
	background-color: #fff;
	border: 1px solid #ced4da;
	color: #6c757d;
}

.input-group-append .btn-outline-secondary:hover {
	background-color: #f8f9fa;
	border-color: #667eea;
	color: #667eea;
}

/* Validation Error Styling */
.text-danger.small {
	font-size: 0.875rem;
	margin-top: 0.25rem;
	display: block;
	animation: shake 0.3s ease;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* Alert Enhancements */
.alert {
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
	animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Card Title */
.card-title {
	font-size: 1.5rem;
	font-weight: 500;
	color: #333;
}

/* Form Text / Hints */
.form-text {
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
	.login-wrapper {
		padding: 15px 0;
		align-items: flex-start;
	}

	.logo-container {
		margin-top: 1rem;
		margin-bottom: 1rem;
	}

	.company-logo {
		width: 70%;
		max-width: 180px;
	}
	
	.card {
		margin-top: 2rem !important;
		margin-bottom: 2rem !important;
	}
	
	.card-body {
		padding: 2rem 1.5rem !important;
	}
	
	.card-header h4 {
		font-size: 1.25rem;
	}
	
	.card-title {
		font-size: 1.25rem;
	}
}

@media (max-width: 576px) {
	.login-wrapper {
		padding: 10px 0;
	}

	.logo-container {
		margin-top: 0.5rem;
		margin-bottom: 0.75rem;
	}

	.company-logo {
		width: 75%;
		max-width: 160px;
	}
	
	.card {
		margin-top: 1rem !important;
		margin-bottom: 1rem !important;
		border-radius: 0.5rem;
	}
	
	.card-body {
		padding: 1.5rem 1rem !important;
	}
	
	.card-header {
		padding: 1rem !important;
		border-top-left-radius: 0.5rem !important;
		border-top-right-radius: 0.5rem !important;
	}
	
	.card-footer {
		padding: 0.75rem !important;
		border-bottom-left-radius: 0.5rem !important;
		border-bottom-right-radius: 0.5rem !important;
	}
	
	.card-header h4 {
		font-size: 1.125rem;
	}
	
	.card-title {
		font-size: 1.125rem;
		margin-bottom: 1.5rem !important;
	}
	
	.form-control-lg {
		font-size: 0.95rem;
		padding: 0.6rem 0.9rem;
	}
	
	.btn-lg {
		font-size: 0.95rem;
		padding: 0.7rem 1.1rem;
	}
	
	.input-group-append .btn {
		padding: 0.6rem 0.9rem;
	}
	
	.form-group {
		margin-bottom: 1rem;
	}
}

/* Accessibility */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Focus visible for keyboard navigation */
.btn:focus,
.form-control:focus,
button:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* Print Styles */
@media print {
	.login-wrapper {
		background: white;
		min-height: auto;
	}
	
	.loading-overlay,
	.btn-primary {
		display: none !important;
	}
	
	.card {
		box-shadow: none !important;
		border: 1px solid #dee2e6;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.login-wrapper {
		background: white;
	}
	
	.card {
		border: 2px solid black;
	}
	
	.form-control {
		border: 2px solid black;
	}
	
	.btn-primary {
		background: black;
		border: 2px solid black;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
