﻿/* ===== UAT LDAP THEME - สี #100E9E ===== */

html, body {
	height: 100%;
	overflow: hidden;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.middle-box {
	width: 450px;
	max-width: 90%;
	margin: 0 auto;
}

/* UAT Badge - มุมบนขวา */
.ldap-demo-badge {
	position: absolute;
	top: 20px;
	right: 20px;
	background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
	color: white;
	padding: 10px 20px;
	border-radius: 25px;
	font-weight: bold;
	font-size: 14px;
	z-index: 1000;
	box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
	animation: pulse 2s ease-in-out infinite;
	letter-spacing: 1px;
}

@keyframes pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

/* Login Box Container */
.login-box-container {
	background: rgba(255, 255, 255, 0.98);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	backdrop-filter: blur(10px);
}

/* Header Section */
.login-header {
	background-color: #196960;
	padding: 30px 20px;
	text-align: center;
	color: white;
}

.login-header h2 {
	margin: 0 0 5px 0;
	font-size: 28px;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.login-header p {
	margin: 0;
	font-size: 14px;
	opacity: 0.9;
}

.login-header i.fa-shield {
	font-size: 50px;
	margin-bottom: 15px;
	opacity: 0.9;
}

.ldap-info-box {
	background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
	border: 2px solid #100E9E;
	border-left: 5px solid #100E9E;
	padding: 12px 15px;
	border-radius: 8px;
	margin-bottom: 15px;
}

.ldap-info-box h4 {
	margin-top: 0;
	color: #100E9E;
	font-size: 13px;
	font-weight: 600;
}

.ldap-info-box p {
	margin: 3px 0;
	font-size: 11px;
	color: #2c3e50;
}

.test-connection-btn {
	margin-bottom: 10px;
	padding: 8px 12px;
	font-size: 13px;
	background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
	border: none !important;
	border-radius: 8px !important;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(23, 162, 184, 0.3);
}

.test-connection-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(23, 162, 184, 0.4);
}

.connection-status {
	padding: 12px 15px;
	border-radius: 10px;
	margin-bottom: 15px;
	display: none;
	font-size: 13px;
	font-weight: 500;
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.connection-status.success {
	background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
	border: 2px solid #28a745;
	border-left: 5px solid #28a745;
	color: #155724;
}

.connection-status.error {
	background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
	border: 2px solid #dc3545;
	border-left: 5px solid #dc3545;
	color: #721c24;
}

/* ลด spacing ของ form elements */
.form-group {
	margin-bottom: 15px;
}

.form-control {
	height: 45px;
	font-size: 14px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	padding: 10px 15px;
	transition: all 0.3s ease;
	background: #f8f9fa;
}

.form-control:focus {
	border-color: #100E9E;
	box-shadow: 0 0 0 0.2rem rgba(16, 14, 158, 0.15);
	background: white;
	outline: none;
}

.form-control::placeholder {
	color: #adb5bd;
}

/* Input Icons */
.form-control-feedback {
	color: #100E9E;
	font-size: 16px;
}

.btn-block {
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 10px;
	transition: all 0.3s ease;
	letter-spacing: 0.5px;
}

.btn-primary {
	background-color: #196960;
	border: none !important;
}

.btn-primary:hover {
	transform: translateY(-2px);
}

.btn-primary:active {
	transform: translateY(0);
}

.m-b {
	margin-bottom: 12px !important;
}

.m-t-md {
	margin-top: 0 !important;
}

/* ปรับ form padding */
.bg-login2 form {
	padding: 35px 30px !important;
}

/* ลดขนาด footer text */
.text-login {
	font-size: 12px !important;
	margin-top: 20px !important;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Back Link Styling */
.back-link {
	display: inline-block;
	color: #196960 !important;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	padding: 8px 15px;
	border-radius: 8px;
	background: #f0f4ff;
	transition: all 0.3s ease;
	margin-top: 5px;
}

.back-link:hover {
	background: #e0e8ff;
	transform: translateX(-3px);
	text-decoration: none;
}

.back-link i {
	margin-right: 5px;
}

/* Moved from inline styles */
.ldap-form-col {
	height: auto !important;
}

.ldap-back-group {
	margin-bottom: 0;
	margin-top: 15px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile Portrait (< 576px) */
@media (max-width: 575px) {
	html, body {
		overflow: auto;
		display: block;
	}

	.middle-box {
		width: 100%;
		max-width: 100%;
		padding: 0 15px;
		margin-top: 20px !important;
		margin-bottom: 20px !important;
	}

	.ldap-demo-badge {
		top: 10px;
		right: 10px;
		padding: 8px 15px;
		font-size: 12px;
	}

	.login-header {
		padding: 20px 15px;
	}

	.login-header h2 {
		font-size: 22px;
	}

	.login-header i.fa-shield {
		font-size: 40px;
		margin-bottom: 10px;
	}

	.bg-login2 form {
		padding: 25px 20px !important;
	}

	.form-control {
		height: 45px;
		font-size: 14px;
	}

	.btn-block {
		padding: 12px 15px;
		font-size: 14px;
	}

	.connection-status {
		font-size: 12px;
		padding: 10px;
	}

	.text-login {
		font-size: 11px !important;
		padding: 0 15px;
	}

	.form-group {
		margin-bottom: 15px;
	}
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
	.middle-box {
		width: 500px;
		max-width: 95%;
	}

	.login-header {
		padding: 25px 20px;
	}

	.bg-login2 form {
		padding: 30px 25px !important;
	}

	.form-control {
		height: 44px;
		font-size: 14px;
	}
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
	.middle-box {
		width: 500px;
		max-width: 90%;
	}

	.login-header {
		padding: 30px 20px;
	}

	.bg-login2 form {
		padding: 35px 30px !important;
	}
}

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
	.middle-box {
		width: 480px;
	}

	.login-header {
		padding: 30px 20px;
	}

	.bg-login2 form {
		padding: 35px 30px !important;
	}
}

/* Large Desktop (>= 1200px) */
@media (min-width: 1200px) {
	.middle-box {
		width: 500px;
	}

	.login-header {
		padding: 35px 25px;
	}

	.login-header h2 {
		font-size: 30px;
	}

	.bg-login2 form {
		padding: 40px 35px !important;
	}

	.form-control {
		height: 48px;
		font-size: 15px;
	}

	.btn-block {
		padding: 14px 20px;
		font-size: 16px;
	}
}

/* Landscape Orientation (สำหรับมือถือหมุนจอ) */
@media (max-height: 600px) and (orientation: landscape) {
	html, body {
		overflow: auto;
		display: block;
	}

	.middle-box {
		margin-top: 15px !important;
		margin-bottom: 15px !important;
	}

	.login-header {
		padding: 15px 20px;
	}

	.login-header i.fa-shield {
		font-size: 35px;
		margin-bottom: 8px;
	}

	.login-header h2 {
		font-size: 20px;
	}

	.bg-login2 form {
		padding: 20px 25px !important;
	}

	.form-group {
		margin-bottom: 10px;
	}

	.m-t-md {
		margin-top: 0 !important;
	}

	.connection-status {
		padding: 8px 12px;
		font-size: 12px;
	}

	.text-login {
		margin-top: 10px !important;
		font-size: 10px !important;
	}
}

/* Very Small Height (iPad ในแนวนอน หรือจอเตี้ย) */
@media (max-height: 768px) {
	.middle-box {
		margin-top: 20px !important;
	}

	.login-header {
		padding: 20px;
	}

	.bg-login2 form {
		padding: 25px 30px !important;
	}

	.form-group {
		margin-bottom: 12px;
	}
}

/* Animation Classes */
.bounceIn {
	animation-duration: 0.8s;
}

/* Loading Spinner */
.btn[disabled] {
	opacity: 0.7;
	cursor: not-allowed;
}

/* Focus Visible */
*:focus-visible {
	outline: 2px solid #100E9E;
	outline-offset: 2px;
}

/* Custom Scrollbar for mobile */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
	background: rgba(16, 14, 158, 0.5);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(16, 14, 158, 0.7);
}
