/* Modern Login Page Styles - New Design */

body {
	background: white !important;
}

/* Hide default Frappe header and footer */
nav.navbar.navbar-light.navbar-expand-lg {
	display: none !important;
}
body[data-path="me"] nav.navbar.navbar-light.navbar-expand-lg {
	display: block !important;
}
footer.web-footer {
	display: none !important;
}

/* Remove container padding from main tag on login page */
main.container.my-4 {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
}

/* Main container */
.modern-login-container {
	min-height: 100vh;
	display: flex;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
		sans-serif;
	background: white;
	overflow: hidden;
}

/* Left Promotional Section */
.promotional-section {
	flex: 1;
	background: white;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 40px;
	position: relative;
	overflow: hidden;
}

.promotional-section::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
	opacity: 0.3;
}

.promotional-content {
	max-width: 500px;
	color: black;
	z-index: 2;
	position: relative;
}

/* Brand Section */
.brand-section {
	display: flex;
	align-items: center;
	margin-bottom: 40px;
}

.brand-logo {
	margin-right: 16px;
}

.brand-logo svg {
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
	width: 48px;
	height: 48px;
	display: block;
}

.brand-name {
	font-size: 2rem;
	font-weight: 700;
	margin: 0;
	color: black;
}

.brand-subtitle {
	font-size: 1rem;
	margin: 4px 0 0 0;
	color: #4e5868;
	font-weight: 400;
}

/* Main Heading */
.main-heading {
	margin-bottom: 40px;
}

.main-heading h2 {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 16px 0;
	color: black;
}

.gradient-text {
	background: linear-gradient(135deg, #0699b3, #0d7377);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.description {
	font-size: 1.125rem;
	line-height: 1.6;
	color: #4e5868;
	margin: 0;
}

/* Features List */
.features-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.feature-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.feature-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.feature-icon.security {
	background: rgba(96, 165, 250, 0.2);
	color: #60a5fa;
}

.feature-icon.patient {
	background: rgba(167, 139, 250, 0.2);
	color: #a78bfa;
}

.feature-icon.team {
	background: rgba(34, 197, 94, 0.2);
	color: #22c55e;
}

.feature-content h4 {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 4px 0;
	color: black;
}

.feature-content p {
	font-size: 0.875rem;
	line-height: 1.5;
	margin: 0;
	color: #4e5868;
}

/* Right Login Section */
.login-section {
	flex: 0 0 600px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	background: white;
}

.login-card {
	width: 100%;
	max-width: 500px;
	background: white;
	border-radius: 20px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
	padding: 40px;
	position: relative;
}

/* Top Controls */
.top-controls {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-bottom: 24px;
}

.control-btn {
	width: 40px;
	height: 40px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: white;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	color: #64748b;
}

.control-btn:hover {
	border-color: #667eea;
	color: #667eea;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.language-selector {
	gap: 6px;
	padding: 0 12px;
	width: auto;
	min-width: 70px;
	justify-content: center;
}

.language-selector svg {
	flex-shrink: 0;
}

.lang-text {
	font-size: 0.75rem;
	font-weight: 600;
	margin-left: 4px;
}

/* Language Dropdown for Login Page */
.language-dropdown {
	position: fixed;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	z-index: 10000;
	min-width: 180px;
	overflow: hidden;
	animation: dropdownFadeIn 0.2s ease;
	max-width: calc(100vw - 20px);
}

.language-dropdown .language-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #374151;
	gap: 12px;
}

.language-dropdown .language-option:hover {
	background: #f9fafb;
}

.language-dropdown .language-option.active {
	background: #eff6ff;
	color: #1e40af;
	font-weight: 500;
}

.language-dropdown .language-option .flag {
	font-size: 18px;
	flex-shrink: 0;
}

.language-dropdown .language-option .lang-name {
	flex: 1;
	font-size: 0.875rem;
}

.language-dropdown .language-option .check-icon {
	width: 16px;
	height: 16px;
	color: #3b82f6;
	flex-shrink: 0;
}

@keyframes dropdownFadeIn {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Welcome Section */
.welcome-section {
	text-align: center;
	margin-bottom: 32px;
}

.welcome-title {
	font-size: 1.875rem;
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 8px 0;
}

.welcome-subtitle {
	font-size: 1rem;
	color: #64748b;
	margin: 0;
}

/* Form Fields */
.form-fields {
	margin-bottom: 24px;
}

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

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	margin-bottom: 8px;
}

.input-wrapper {
	position: relative;
}

.form-control {
	width: 100%;
	padding: 16px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 1rem;
	transition: all 0.3s ease;
	background: white;
	box-sizing: border-box;
}

.form-control:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
	color: #9ca3af;
}

.password-toggle {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	transition: color 0.3s ease;
}

.password-toggle:hover {
	color: #667eea;
}

/* Form Options */
.form-options {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
}

.checkbox-wrapper {
	display: flex;
	align-items: center;
	cursor: pointer;
	gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
	display: none;
}

.checkmark {
	width: 20px;
	height: 20px;
	border: 2px solid #e2e8f0;
	border-radius: 4px;
	position: relative;
	transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
	background: #667eea;
	border-color: #667eea;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.checkbox-label {
	font-size: 0.875rem;
	color: #374151;
	font-weight: 500;
}

.forgot-link {
	font-size: 0.875rem;
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s ease;
}

.forgot-link:hover {
	color: #764ba2;
	text-decoration: underline;
}

/* Login Button */
.login-btn,
.signup-btn,
.forgot-btn {
	width: 100%;
	padding: 16px;
	background: linear-gradient(135deg, #0699b3, #0d7377);
	color: white;
	border: none;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 15px rgba(6, 153, 179, 0.3);
}

.login-btn:hover,
.signup-btn:hover,
.forgot-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(6, 153, 179, 0.4);
}

.login-btn:active,
.signup-btn:active,
.forgot-btn:active {
	transform: translateY(0);
}

.btn-icon {
	flex-shrink: 0;
}

/* Support Section */
.support-section {
	margin: 32px 0;
	text-align: center;
}

.support-text {
	font-size: 0.875rem;
	color: #64748b;
	margin: 0 0 16px 0;
}

.support-buttons {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.support-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: 10px;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.3s ease;
}
.support-btn.icon-only {
	padding: 12px;
	width: 44px;
	height: 44px;
	justify-content: center;
}

.support-btn.icon-only .btn-text {
	display: none;
}

.support-btn.whatsapp {
	background: #25d366;
	color: white;
}

.support-btn.whatsapp:hover {
	background: #20ba5a;
	transform: translateY(-1px);
}

.support-btn.instagram {
	background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
	color: white;
}

.support-btn.instagram:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(131, 58, 180, 0.3);
}
.support-btn.linkedin {
	background: linear-gradient(135deg, #0077b5, #00a0dc, #0077b5);
	color: white;
}

.support-btn.linkedin:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0, 119, 181, 0.4);
}
/* Footer Info */
.footer-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 24px;
	border-top: 1px solid #e2e8f0;
}

.info-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	color: #64748b;
}

.info-icon {
	color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.modern-login-container {
		flex-direction: column;
	}

	.promotional-section {
		flex: none;
		min-height: 50vh;
		padding: 40px 20px;
	}

	.login-section {
		flex: none;
		padding: 20px;
	}

	.main-heading h2 {
		font-size: 2rem;
	}
}

@media (max-width: 768px) {
	.promotional-section {
		padding: 30px 20px;
	}

	.login-card {
		padding: 30px 25px;
	}

	.main-heading h2 {
		font-size: 1.75rem;
	}

	.brand-name {
		font-size: 1.75rem;
	}

	.support-buttons {
		flex-direction: column;
	}

	.footer-info {
		flex-direction: column;
		gap: 12px;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.login-card {
		padding: 25px 20px;
	}

	.main-heading h2 {
		font-size: 1.5rem;
	}

	.welcome-title {
		font-size: 1.5rem;
	}

	.form-control {
		padding: 14px;
	}

	.login-btn {
		padding: 14px;
	}
}

/* Animation for form sections */
section {
	animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Hide sections by default */
/* section:not(.for-login) {
  display: none;
} */

/* Show active section */
section.active {
	display: block;
}

/* Hide frappe's default notifications on login page to prevent duplicates */
body[data-route="login"] .modal-backdrop,
body[data-route="login"] .modal.show,
body[data-route="login"] .modal.show.frappe-msgprint,
body[data-route="login"] .modal-dialog,
body[data-route="login"] .msgprint {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* Hide all types of frappe notifications on login page */
body[data-route="login"] .indicator-pill,
body[data-route="login"] .alert,
body[data-route="login"] .toast,
body[data-route="login"] .frappe-toast,
body[data-route="login"] div[id*="indicator"],
body[data-route="login"] .notification-message,
body[data-route="login"] .desk-alert {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
}

/* Hide frappe's message area */
body[data-route="login"] #freeze,
body[data-route="login"] .freeze,
body[data-route="login"] .freeze-message-container {
	display: none !important;
}

/* Prevent any absolute/fixed positioned notifications */
body[data-route="login"] > div[style*="position: fixed"],
body[data-route="login"] > div[style*="position: absolute"] {
	display: none !important;
}

/* Loading states */
.login-btn:disabled,
.signup-btn:disabled,
.forgot-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none !important;
}

/* Error states */
.invalid-login {
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {
	0%,
	100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-5px);
	}
	75% {
		transform: translateX(5px);
	}
}

.form-control.invalid {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.5);
}

/* Logo gradient definition */
#logoGradient {
	stop-color: #0699b3;
	stop-opacity: 1;
}

#logoGradient stop:last-child {
	stop-color: #0d7377;
	stop-opacity: 1;
}

/* Custom logo container styles */
.custom-logo-container {
	display: flex;
	align-items: center;
	gap: 12px;
}

.logo-icon svg {
	width: 48px;
	height: 48px;
	display: block;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text .app-name {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
}

/* Field Icon Styles */
.field-icon {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: #9ca3af;
	pointer-events: none;
	transition: all 0.3s ease;
	z-index: 2;
}

.field-icon svg {
	transition: all 0.3s ease;
}

/* Input wrapper positioning */
.input-wrapper {
	position: relative;
}

/* Enhanced field validation styles */
.form-control.valid {
	border-color: #10b981;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control.valid + .field-icon {
	color: #10b981;
}

.form-control.invalid + .field-icon {
	color: #ef4444;
}

/* Field error styles */
.field-error {
	color: #ef4444;
	font-size: 0.75rem;
	margin-top: 4px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 4px;
}

.field-error::before {
	content: "⚠";
	font-size: 0.875rem;
}

/* Loading Spinner Styles */
.loading-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
	margin-right: 8px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.login-btn.loading,
.signup-btn.loading,
.forgot-btn.loading {
	pointer-events: none;
	opacity: 0.8;
}

/* Login Message Styles */
.login-message {
	margin-top: 20px;
	padding: 16px;
	border-radius: 12px;
	border-left: 4px solid;
	animation: slideInUp 0.3s ease-out;
}

.login-message.success {
	background: rgba(16, 185, 129, 0.1);
	border-left-color: #10b981;
	color: #065f46;
}

.login-message.error {
	background: rgba(239, 68, 68, 0.1);
	border-left-color: #ef4444;
	color: #991b1b;
}

.login-message.info {
	background: rgba(59, 130, 246, 0.1);
	border-left-color: #3b82f6;
	color: #1e40af;
}

.message-content {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.message-icon {
	flex-shrink: 0;
	margin-top: 2px;
}

.message-icon svg {
	width: 20px;
	height: 20px;
}

.login-message.success .message-icon svg {
	color: #10b981;
}

.login-message.error .message-icon svg {
	color: #ef4444;
}

.login-message.info .message-icon svg {
	color: #3b82f6;
}

.message-text {
	flex: 1;
}

.message-title {
	font-weight: 600;
	font-size: 0.875rem;
	margin-bottom: 4px;
}

.message-description {
	font-size: 0.875rem;
	line-height: 1.4;
}

@keyframes slideInUp {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========================================
   RTL Support for Login Page
   ======================================== */
html[dir="rtl"] .top-controls {
	justify-content: flex-start;
}

html[dir="rtl"] .language-selector {
	direction: ltr; /* Keep language selector LTR even in RTL mode */
}

html[dir="rtl"] .language-dropdown {
	right: 972px !important;
	left: auto !important;
}

html[dir="rtl"] .form-options {
	flex-direction: row-reverse;
}

html[dir="rtl"] .support-section {
	direction: rtl;
}

html[dir="rtl"] .support-text {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .welcome-section {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .form-label {
	text-align: right;
}

html[dir="rtl"] .password-toggle {
	right: auto;
	left: 16px;
}

html[dir="rtl"] .forgot-link {
	direction: rtl;
}

html[dir="rtl"] .login-btn,
html[dir="rtl"] .signup-btn,
html[dir="rtl"] .forgot-btn {
	direction: ltr; /* Keep button text LTR */
}

html[dir="rtl"] .language-dropdown .language-option {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .language-dropdown .language-option .flag {
	order: 1;
}

html[dir="rtl"] .language-dropdown .language-option .lang-name {
	order: 2;
	text-align: right;
}

html[dir="rtl"] .language-dropdown .language-option .check-icon {
	order: 3;
	margin-right: auto;
	margin-left: 0;
}

html[dir="rtl"] .login-message {
	border-left: none;
	border-right: 4px solid;
}

html[dir="rtl"] .promotional-section {
	direction: rtl;
}

html[dir="rtl"] .promotional-content {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .brand-section {
	direction: rtl;
}

html[dir="rtl"] .brand-logo {
	margin-right: 0;
	margin-left: 16px;
}

html[dir="rtl"] .main-heading {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .description {
	direction: rtl;
	text-align: right;
}
