/* =================================
   1. BASE STYLES & RESET
   ================================= */
* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	height: 100%;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: #f8f9fa;
	-webkit-font-smoothing: antialiased;
}

/* =================================
   2. MAIN LAYOUT STRUCTURE
   ================================= */
.login-wrapper {
	min-height: 100vh;
	background: #f8f9fa;
	display: flex;
	padding: 0;
}

.login-container {
	display: flex;
	width: 100%;
	height: 100vh;
	background: transparent;
	overflow: hidden;
}

/* Left Side - Illustration */
.login-left {
	flex: 1;
	background: #f6f6f626;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	position: relative;
	border-right: 1px solid #e8ecef;
	min-height: 100vh;
}

.illustration-container {
	position: relative;
	width: 100%;
	max-width: 450px;
	height: 350px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-illustration {
	width: 100%;
	height: auto;
	max-width: 671px;
	max-height: 688px;
	object-fit: contain;
}

/* Right Side - Form */
.login-right {
	flex: 1;
	padding: 40px 50px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: white;
}

/* =================================
   3. HEADER & BRANDING
   ================================= */
.brand-header {
	text-align: center;
	margin-bottom: 40px;
}

.brand-header h1 {
	color: #E42127;
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 6px 0;
	letter-spacing: -0.5px;
}

.powered-by {
	color: #8e9aaf;
	font-size: 14px;
	margin: 0;
	font-weight: 400;
}

/* =================================
   4. FORM CONTAINER & STRUCTURE
   ================================= */
.login-form-container {
	width: 100%;
	max-width: 340px;
	margin: 0 auto;
}

.form-title {
	font-size: 24px;
	font-weight: 700;
	color: #2c3e50;
	margin: 0 0 28px 0;
	text-align: left;
	letter-spacing: -0.3px;
}

.form-group {
	margin-bottom: 20px;
}

/* =================================
   5. FORM FIELDS & INPUTS
   ================================= */
.input-wrapper {
	position: relative;
}

.form-field {
	width: 100%;
	padding: 14px 16px 14px 48px;
	border: 2px solid #e8ecef;
	border-radius: 10px;
	font-size: 16px;
	background: #fff;
	transition: all 0.3s ease;
	color: #2c3e50;
	font-weight: 400;
	line-height: 1.5;
}

.form-field::placeholder {
	color: #8e9aaf;
	font-weight: 400;
}

.form-field:focus {
	outline: none;
	scroll-margin-top: 100px;
}

.form-field:hover:not(:focus) {
	border-color: #d1d9e0;
}

/* Input Icons */
.input-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: #8e9aaf;
	pointer-events: none;
	width: 16px;
	height: 16px;
}

/* Password Toggle */
.password-toggle {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #8e9aaf;
	cursor: pointer;
	padding: 6px;
	display: flex;
	align-items: center;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.password-toggle:hover {
	color: #0d6efd;
	background: rgba(228, 33, 39, 0.04);
}

.password-toggle:active {
	transform: translateY(-50%) scale(0.95);
}

/* =================================
   6. BUTTONS & ACTIONS
   ================================= */
.login-btn, .next-btn {
	width: 100%;
	padding: 16px 20px;
	background: #E42127;
	color: white;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	transition: all 0.3s ease;
	text-transform: none;
	letter-spacing: 0.3px;
	box-shadow: 0 4px 14px rgba(228, 33, 39, 0.25);
}

.login-btn:hover {
	background: #c31e24;
	transform: translateY(-1px);
	box-shadow: 0 8px 25px rgba(228, 33, 39, 0.3);
}

.login-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(228, 33, 39, 0.2);
}

/* Button States */
.login-btn:disabled {
	background: #8e9aaf;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.login-btn.loading {
	position: relative;
	color: transparent;
}

.login-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 20px;
	height: 20px;
	border: 2px solid transparent;
	border-top: 2px solid white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =================================
   7. LINKS & NAVIGATION
   ================================= */
.forgot-password-link,
.create-account-link,
.cancel-link {
	display: block;
	text-align: center;
	color: #8e9aaf;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.forgot-password-link:hover,
.create-account-link:hover,
.cancel-link:hover {
	color: #E42127;
	text-decoration: none;
	transform: translateY(-1px);
}

/* =================================
   8. MESSAGES & ALERTS
   ================================= */
.text-red {
	color: #dc3545;
	margin-bottom: 20px;
	text-align: center;
	font-size: 14px;
	font-weight: 500;
	padding: 12px 16px;
	background: #fff5f5;
	border: 1px solid #fed7d7;
	border-radius: 8px;
}

/* =================================
   9. MODAL COMPONENTS
   ================================= */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	backdrop-filter: blur(4px);
}

.modal-content {
	background: white;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
	max-width: 480px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-30px) scale(0.9);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Modal Content */
.modal-form {
	padding: 32px;
}

.modal-title {
	font-size: 24px;
	font-weight: 700;
	color: #2c3e50;
	margin: 0 0 24px 0;
	text-align: left;
	letter-spacing: -0.3px;
}

.form-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #2c3e50;
	margin-bottom: 8px;
}

/* Modal Form Fields */
.modal-form .form-field {
	padding: 14px 16px;
	border: 2px solid #e8ecef;
	border-radius: 8px;
	font-size: 16px;
	background: #fff;
	transition: all 0.3s ease;
	color: #2c3e50;
	font-weight: 400;
	line-height: 1.5;
}

.modal-form .form-field:focus {
	outline: none;
}

/* Modal Actions */
.modal-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
	justify-content: flex-end;
}

.btn-primary {
	padding: 12px 24px;
	background: #E42127;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	text-transform: none;
	letter-spacing: 0.3px;
	box-shadow: 0 4px 14px rgba(228, 33, 39, 0.25);
}

.btn-primary:hover {
	background: #c31e24;
	transform: translateY(-1px);
	box-shadow: 0 8px 25px rgba(228, 33, 39, 0.3);
}

.btn-secondary {
	padding: 12px 24px;
	background: #f8f9fa;
	color: #6c757d;
	border: 1px solid #e8ecef;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	text-transform: none;
}

.btn-secondary:hover {
	background: #e9ecef;
	border-color: #d1d9e0;
	color: #495057;
}

/* =================================
   10. UTILITY CLASSES
   ================================= */
.hide {
	display: none !important;
}

/* =================================
   11. RESPONSIVE DESIGN
   ================================= */

/* Large Screens (1024px and below) */
@media (max-width: 1024px) {
	.login-right {
		padding: 40px 30px;
	}

	.login-left {
		padding: 30px 20px;
	}

	.login-form-container {
		max-width: 320px;
	}
}

/* Mobile Base (768px and below) */
@media (max-width: 768px) {
	.login-wrapper {
		padding: 0;
		background: white;
		min-height: 100vh;
	}

	.login-container {
		flex-direction: column;
		background: white;
		height: 100vh;
		width: 100%;
	}

	.login-left {
		display: none;
	}

	.login-right {
		padding: 0;
		width: 100%;
		min-height: 100vh;
		background: white;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.login-form-section {
		width: 100%;
		max-width: 400px;
		background: white;
		min-height: 100vh;
		padding: 60px 24px 40px 24px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.login-form-container {
		width: 100%;
		max-width: none;
		margin: 0;
	}

	.form-field {
		border-radius: 12px;
		min-height: 52px;
	}

	.input-icon {
		width: 18px;
		height: 18px;
	}

	.password-toggle {
		padding: 10px;
		width: 40px;
		height: 40px;
		justify-content: center;
	}

	.login-btn {
		padding: 16px 24px;
		border-radius: 12px;
		min-height: 52px;
	}

	.forgot-password-link,
	.create-account-link,
	.cancel-link {
		display: flex;
		padding: 2px 0;
		min-height: 44px;
		align-items: center;
		justify-content: center;
	}
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
	.login-form-section {
		padding: 40px 20px 30px 20px;
	}

	.brand-header h1 {
		font-size: 26px;
	}

	.form-title {
		font-size: 22px;
	}

	.form-field {
		min-height: 50px;
		padding: 13px 15px 13px 46px;
	}

	.input-icon {
		left: 15px;
		width: 16px;
		height: 16px;
	}

	.password-toggle {
		right: 15px;
		width: 38px;
		height: 38px;
	}

	.login-btn {
		min-height: 50px;
		padding: 15px 22px;
	}
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
	.password-toggle {
		padding: 12px;
		width: 44px;
		height: 44px;
	}

	.form-field {
		min-height: 48px;
	}

	.login-btn {
		min-height: 48px;
	}

	.forgot-password-link,
	.create-account-link,
	.cancel-link {
		min-height: 48px;
		padding: 14px 0;
	}
}

/* Keyboard Accessibility - Small Heights */
@media (max-height: 600px) and (max-width: 768px) {
	.login-form-section {
		min-height: auto;
		justify-content: flex-start;
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.brand-header {
		margin-bottom: 30px;
	}

	.form-title {
		margin-bottom: 20px;
	}

	.form-group {
		margin-bottom: 16px;
	}
}

/* =================================
   12. RESET PASSWORD MODAL STYLES
   ================================= */
#reset_password_modal .form-group .field-error {
	color: #dc3545;
	font-size: 13px;
	margin-top: 8px;
	text-align: left;
	width: 100%;
}

#reset_password_modal .form-field.error {
	border-color: #dc3545;
}

#reset_password_modal .form-group .field-success {
	color: #28a745;
	font-size: 13px;
	margin-top: 8px;
	text-align: left;
	width: 100%;
}

#reset_password_modal .form-field.success {
	border-color: #28a745;
}
