
/* Modern CSS Reset and Variables - PSO Official Colors */
:root {
	--primary-color: #003366; /* PSO Dark Blue */
	--primary-dark: #002244; /* PSO Darker Blue */
	--primary-light: #1e4d7c; /* PSO Medium Blue */
	--secondary-color: #6c757d;
	--accent-color: #ff6600; /* PSO Orange for accents */
	--text-light: #ffffff;
	--text-dark: #333333;
	--border-color: #e1e1e1;
	--bg-light: #f8f9fa;
	--error-color: #dc3545;
	--success-color: #28a745;
	--warning-color: #ffc107;
	--box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
	--transition: all 0.3s ease;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	overflow-x: hidden;
	min-height: 100vh;
}

/* Video Background */
.bg-video-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	overflow: hidden;
}

.bgvid {
	position: absolute;
	top: 50%;
	left: 50%;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%, -50%);
	object-fit: cover;
}

.overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(0,51,102,0.4) 0%, rgba(0,34,68,0.5) 100%);
}

/* Main Content - Adjusted to move login box up */
.content {
	min-height: 100vh;
	display: flex;
	align-items: flex-start; /* Changed from center to flex-start */
	justify-content: center;
	padding: 15px;
	position: relative;
	/*padding-top: 8vh;*/ /* Added top padding to control position */
}

.login-wrapper {
	width: 100%;
	max-width: 420px;
	animation: fadeInUp 0.6s ease;
	margin-top: 20px; /* Fine-tune position */
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Login Card */
.login-card {
	background: rgba(255, 255, 255, 0.98);
	border-radius: 16px;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	backdrop-filter: blur(10px);
	width: 100%;
}

.login-header {
	background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
	padding: 25px 20px;
	text-align: center;
	border-bottom: 3px solid var(--accent-color);
}

	.login-header h2 {
		color: var(--text-light);
		font-size: 26px;
		font-weight: 600;
		/*margin-bottom: 5px;*/
		letter-spacing: 1px;
	}

	.login-header p {
		color: rgba(255, 255, 255, 0.9);
		font-size: 14px;
	}

.login-body {
	padding: 25px;
}

/* Form Elements - COMPLETELY FIXED OVERLAP ISSUES */
.form-group {
	margin-bottom: 10px;
	position: relative;
	width: 100%;
}

.input-wrapper {
	position: relative;
	width: 100%;
	display: block;
}

.input-icon {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--primary-color);
	z-index: 2;
	font-size: 16px;
	width: 20px;
	text-align: center;
	pointer-events: none;
}

.form-control {
	width: 100%;
	padding: 14px 45px 14px 45px; /* Equal padding on both sides */
	border: 1.5px solid var(--border-color);
	border-radius: 10px;
	font-size: 15px;
	transition: var(--transition);
	background: white;
	height: 52px;
	line-height: normal;
	text-indent: 32px; /* Ensure text doesn't get extra indentation */
}

	.form-control:focus {
		border-color: var(--primary-color);
		box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
		outline: none;
	}

	.form-control::placeholder {
		color: #999;
		font-weight: 400;
		font-size: 14px;
		opacity: 1;
		padding-left: 0; /* Remove any default padding */
	}

.password-field {
	position: relative;
	width: 100%;
}

/* Input padding (accounts for eye button) */
.password-input {
	padding-right: 55px !important;
}

/* Eye icon */
.password-toggle {
	position: absolute;
	right: 5px;
	top: 38%;
	transform: translateY(-50%);
	cursor: pointer;
	z-index: 5;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--secondary-color);
	background: rgba(255, 255, 255, 0.1);
}

	.password-toggle:hover {
		color: var(--primary-color);
		background: rgba(0,51,102,0.1);
	}
/* Forgot password link */
.forgot-link {
	text-align: right;
	margin: 5px 0 15px 0;
}

	.forgot-link a {
		color: var(--primary-color);
		text-decoration: none;
		font-size: 13px;
		font-weight: 500;
		transition: var(--transition);
	}

		.forgot-link a:hover {
			color: var(--accent-color);
			text-decoration: underline;
		}

/* CAPTCHA Section */
.captcha-section {
	background: var(--bg-light);
	border-radius: 12px;
	padding: 18px;
	margin: 15px 0 20px 0;
	border: 1px solid #e9ecef;
}

.captcha-label {
	display: block;
	margin-bottom: 12px;
	font-weight: 600;
	color: var(--text-dark);
	font-size: 14px;
}

.captcha-container {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

.captcha-image-wrapper {
	flex: 1;
	min-width: 150px;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--border-color);
	height: 52px;
	padding: 2px; /* Add small padding to prevent edge cutting */
}

.captcha-image {
	width: 100%;
	height: 100%;
	object-fit: contain; /* Changed from cover to contain */
	display: block;
	background: white;
	border-radius: 8px;
}

.refresh-btn {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: var(--primary-color);
	color: white;
	border: none;
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}

	.refresh-btn:hover {
		background: var(--primary-dark);
		transform: rotate(180deg);
	}

.captcha-input {
	text-align: center;
	font-weight: 600;
	letter-spacing: 2px;
	font-size: 16px;
	padding: 14px 15px !important;
	height: 52px;
}

/* Messages */
.alert {
	padding: 12px 15px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.alert-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: var(--error-color);
}

.alert-warning {
	background: #fff3cd;
	border: 1px solid #ffeeba;
	color: #856404;
}

.alert i {
	font-size: 16px;
}

/* Buttons - FIXED VISIBILITY */
.btn {
	width: 100%;
	padding: 14px;
	border: none;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 12px 0;
	visibility: visible !important;
	opacity: 1 !important;
}

.btn-primary {
	background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
	color: white;
	box-shadow: 0 4px 15px rgba(0,51,102,0.3);
	margin-bottom: 12px;
}

	.btn-primary:hover:not(:disabled) {
		transform: translateY(-2px);
		box-shadow: 0 6px 20px rgba(0,51,102,0.4);
	}

	.btn-primary:disabled {
		opacity: 0.7;
		cursor: not-allowed;
	}

.btn-secondary {
	background: white;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
	margin-bottom: 0;
}

	.btn-secondary:hover {
		background: var(--primary-color);
		color: white;
	}

/* Divider */
.divider {
	display: flex;
	align-items: center;
	text-align: center;
	margin: 15px 0;
}

	.divider::before,
	.divider::after {
		content: '';
		flex: 1;
		border-bottom: 1px solid var(--border-color);
	}

	.divider span {
		padding: 0 10px;
		color: var(--secondary-color);
		font-size: 13px;
		font-style: normal;
		background: transparent;
	}

/* Footer */
.powered-by {
	color: var(--text-light);
	font-size: 12px;
	margin-top: 20px;
	opacity: 0.9;
	text-align: center;
}

	.powered-by a {
		color: var(--text-light);
		text-decoration: none;
		font-weight: 600;
		border-bottom: 1px dotted rgba(255,255,255,0.5);
	}

		.powered-by a:hover {
			border-bottom-color: var(--accent-color);
		}

/* OTP Section */
.otp-section {
	text-align: center;
}

.otp-refresh {
	color: var(--primary-color);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	display: inline-block;
	margin: 10px 0;
}

	.otp-refresh:hover {
		color: var(--accent-color);
		text-decoration: underline;
	}

/* Popup */
.login-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 51, 102, 0.9);
	z-index: 9999;
	justify-content: center;
	align-items: center;
	padding: 15px;
}

	.login-popup.active {
		display: flex;
	}

.login-popup-content {
	position: relative;
	max-width: 500px;
	width: 100%;
	animation: fadeInUp 0.4s ease;
}

	.login-popup-content img {
		width: 100%;
		border-radius: 12px;
		display: block;
	}

.login-close-button {
	position: absolute;
	top: -15px;
	right: -15px;
	width: 35px;
	height: 35px;
	background: var(--accent-color);
	color: white !important;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: bold;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 2px 10px rgba(0,0,0,0.2);
	border: 2px solid white;
}

	.login-close-button:hover {
		background: #ff8533;
		transform: rotate(90deg);
	}

/* Loading Overlay */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 51, 102, 0.8);
	z-index: 10000;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 15px;
}

.loading-spinner {
	background: white;
	padding: 25px;
	border-radius: 12px;
	text-align: center;
	box-shadow: var(--box-shadow);
	max-width: 200px;
	width: 100%;
}

	.loading-spinner img {
		width: 50px;
		height: 50px;
		margin-bottom: 10px;
	}

	.loading-spinner p {
		color: var(--text-dark);
		font-weight: 500;
	}

/* Responsive Design */
@media (max-width: 768px) {
	.content {
		padding-top: 5vh; /* Adjusted for mobile */
	}

	.login-header {
		padding: 20px 15px;
	}

		.login-header h2 {
			font-size: 24px;
		}

	.login-body {
		padding: 20px 15px;
	}

	.login-wrapper {
		max-width: 400px;
	}
}

@media (max-width: 480px) {
	.content {
		padding: 10px;
		padding-top: 3vh; /* Adjusted for mobile */
	}

	.login-wrapper {
		max-width: 100%;
	}

	.login-header h2 {
		font-size: 22px;
	}

	.login-header p {
		font-size: 13px;
	}

	.captcha-container {
		flex-direction: column;
		gap: 10px;
	}

	.captcha-image-wrapper {
		width: 100%;
		min-width: 100%;
	}

	.refresh-btn {
		width: 100%;
		height: 48px;
		border-radius: 8px;
	}

		.refresh-btn:hover {
			transform: none;
		}

	.login-popup-content {
		width: 95%;
	}

	.login-close-button {
		top: -10px;
		right: -10px;
		width: 32px;
		height: 32px;
		font-size: 18px;
	}

	.btn {
		font-size: 15px;
		padding: 12px;
		height: 50px;
	}

	.form-control {
		padding: 12px 45px 12px 45px;
		font-size: 14px;
		height: 50px;
	}

	.password-toggle {
		width: 34px;
		height: 34px;
	}
}

/* Fix for browser zoom at 80% and below - ENSURES BUTTON VISIBILITY */
@media (max-width: 1200px) {
	.btn-secondary {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: relative !important;
		z-index: 10 !important;
	}

	.login-body {
		overflow: visible !important;
	}

	.divider span {
		background: transparent;
	}
}

/* Fine-tuning for different zoom levels */
@media (max-width: 900px) and (min-width: 481px) {
	.login-wrapper {
		max-width: 380px;
	}

	.login-body {
		padding: 20px;
	}

	.content {
		padding-top: 6vh;
	}
}

/* Utility Classes */
.text-center {
	text-align: center;
}

.mt-10 {
	margin-top: 10px;
}

.mb-10 {
	margin-bottom: 10px;
}

/* CAPTCHA image fix */
#captchaImage {
	overflow: visible !important;
	visibility: visible !important;
}


.bgvid {
	position: absolute;
	top: 50%;
	left: 50%;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%, -50%);
	object-fit: cover;
	will-change: transform; /* Performance hint */
}

/* Pause video when not in view (saves battery) */
@media (prefers-reduced-motion) {
	.bgvid {
		display: none;
	}

	.bg-video-container {
		background: linear-gradient(135deg, #003366, #002244);
	}
}


