/* Tenant Portal Login Styles - Based on Figma Design */
:root {
    --secondary-purple-light: #e5eafc;
}

/* Outer wrapper - centered single column layout */
.tenant-portal-login {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	width: 100%;
	background: var(--card-bg, #fff);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	overflow: auto;
	box-sizing: border-box;
}

/* Form container - centered column */
.login-form-container {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 20px;
	width: 100%;
	max-width: 500px;
	padding: 16px 32px;
	box-sizing: border-box;
}

/* Logo */
.tenant-portal-logo {
	width: 100%;
	background: none;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 24px;
}

.branding-logo {
	max-width: 400px;
	max-height: 140px;
	object-fit: contain;
}

.branding-name {
	font-family: 'Inter', sans-serif;
	font-weight: 700;
	font-size: 24px;
	color: var(--black);
}

/* Welcome section */
.welcome-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
	position: relative;
	z-index: 1;
}

.welcome-title {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 24px;
	line-height: 1.2;
	color: var(--black);
	margin: 0;
}

.welcome-subtitle {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.5;
	color: var(--grey-darken2);
	margin: 0;
}

/* Form styles */
.login-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	position: relative;
	z-index: 1;
}

/* Form field - matching Figma exact spacing */
.form-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	height: 69px; /* Exact height from Figma */
}

.field-label {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.5;
	color: var(--grey-darken2);
	letter-spacing: 0.07px;
	margin: 0;
	padding: 0 1px 0 0; /* Exact padding from Figma */
}

.field-input {
	position: relative;
	width: 100%;
	height: 40px; /* Exact height from Figma */
}

.input-field {
	width: 100%;
	height: 40px;
	padding: 12px;
	border: 1px solid var(--grey-lighten2);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.01);
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.5;
	color: var(--black);
	opacity: 1;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.input-field:focus {
	outline: none;
	border-color: var(--grey-darken2);
	opacity: 1;
}

/* Input wrapper for password field */
.input-wrapper {
	position: relative;
	width: 100%;
	height: 40px;
}

.input-wrapper .input-field {
	padding-right: 40px; /* Make room for the visibility icon */
}

.show-password {
	position: absolute;
	right: 12px;
	top: 55%;
	transform: translateY(-50%);
	cursor: pointer;
	color: var(--grey-lighten2);
	transition: color 0.2s ease;
}

.show-password:hover {
	color: var(--grey-darken2);
}

.material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-weight: normal;
	font-style: normal;
	font-size: 20px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	word-wrap: normal;
	direction: ltr;
	font-feature-settings: 'liga';
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
}

/* Caps Lock warning */
.caps-lock-pop-up {
	position: absolute;
	top: -30px;
	right: 0;
	background: var(--error);
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-family: 'Inter', sans-serif;
	z-index: 1000;
}

.field-input.caps-lock {
	border-color: var(--error);
}

/* Validation error states */
.field-input.invalid .input-field {
	border: 2px solid var(--error) !important;
}

.field-input.invalid .show-password,
.field-input.invalid .validation-icon {
	color: var(--error);
}

/* Validation messages and labels */
.input-validation,
.field-validation-error {
	font-size: 12px !important;
	color: var(--error) !important;
	display: block;
	margin-top: 4px;
}

.field-label.field-validation-error {
	color: var(--error) !important;
	font-weight: 600;
}

/* Add extra bottom margin for form fields with validation errors */
.form-field:has(.field-input.invalid),
.form-field:has(.input-validation-error) {
	margin-bottom: 16px;
}

/* Fallback for browsers that don't support :has() */
.form-field .field-input.invalid {
	margin-bottom: 16px;
}

.form-field .input-validation {
	margin-bottom: 16px;
}

/* Login alert for invalid credentials */
.login-alert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: var(--error-lighten4);
	border: 1px solid var(--error-lighten2);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 8px;
	animation: slideIn 0.3s ease-out;
}

.alert-icon {
	font-size: 20px;
	color: var(--error-darken2);
	flex-shrink: 0;
	margin-top: 2px;
}

.alert-header {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: var(--error-darken2);
	margin: 0 0 4px 0;
}

.alert-message {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	color: var(--error);
	line-height: 1.4;
}

/* Success alert for password reset */
.success-alert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: var(--success-lighten4);
	border: 1px solid var(--success-lighten2);
	border-radius: 8px;
	padding: 16px;
	animation: slideIn 0.3s ease-out;
}

.success-icon {
	font-size: 20px;
	color: var(--success);
	flex-shrink: 0;
	margin-top: 2px;
}

.success-header {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: var(--success);
	margin: 0 0 4px 0;
}

.success-message {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	color: var(--success);
	line-height: 1.4;
}

/* Animation for alert */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Validation error section (kept for other validation errors) */
.validation-error-section {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: var(--error-lighten4);
	border: 1px solid var(--error-lighten2);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 24px;
}

.error-icon {
	font-size: 20px;
	color: var(--error-darken2);
	flex-shrink: 0;
	margin-top: 2px;
}

.validation-error-header {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: var(--error-darken2);
	margin: 0 0 4px 0;
}

.validation-error-message {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	color: var(--error);
	line-height: 1.4;
}

.forgot-password-link {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.5;
	color: var(--grey-darken2);
	text-decoration: none;
	letter-spacing: 0.07px;
}

.forgot-password-link:hover {
	text-decoration: underline;
}

.forgot-password-form {
	width: 100%;
}

/* Action buttons - matching Figma exact positioning */
.action-buttons {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	margin-top: 16px;
	width: 100%;
	height: 48px; /* Exact height from Figma */
}

.auth-action-buttons {
	margin-top: 32px;
}

.btn {
	height: 48px;
	padding: 0 16px;
	border-radius: 4px;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 24px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	box-sizing: border-box;
}

.btn-primary {
	background: var(--secondary-purple-light);
	color: var(--black);
	border: 1px solid var(--secondary-purple-light);
	min-width: 70px; /* Exact width from Figma */
}

.btn-primary:hover {
	background: #d1d9f7;
}

.btn-secondary {
	background: var(--white);
	color: var(--black);
	border: 1px solid #e6e6e6;
	min-width: 86px; /* Exact width from Figma */
}

.btn-secondary:hover {
	background: #f5f5f5;
}

/* Validation errors */
.validation-error-section {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
	margin-bottom: 16px;
	position: relative;
	z-index: 1;
}

.error-icon {
	font-size: 20px;
	color: #dc2626;
	flex-shrink: 0;
}

.validation-error-header {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: #dc2626;
	margin: 0 0 4px 0;
}

.validation-error-message {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 14px;
	color: #dc2626;
}

/* Two-factor authentication */
.two-factor-section {
	margin-bottom: 16px;
}

.two-factor-banner {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 4px;
}

.two-factor-icon {
	font-size: 20px;
	color: #d97706;
	flex-shrink: 0;
}

.two-factor-header {
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: #d97706;
	margin: 0 0 4px 0;
}

.two-factor-message {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 14px;
	color: #d97706;
	margin: 0;
}

.help-message {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 12px;
	color: var(--grey-lighten1);
	margin-top: 4px;
}


/* Processing section */
.processing {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	z-index: 100;
}

.processing.show {
	display: flex;
}

/* Hide content when loading */
.login-form-container.loading .login-form {
	opacity: 0;
	pointer-events: none;
}

/* Show only logo during loading, hide welcome section */
.login-form-container.loading .tenant-portal-logo {
	opacity: 1;
	pointer-events: auto;
}

.login-form-container.loading .welcome-section {
	opacity: 0 !important;
	pointer-events: none !important;
	display: none !important;
}

/* Center spinner horizontally during loading */
.login-form-container.loading .processing {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Forgot password page loading state */
#forgotPasswordFormContainer.loading .forgot-password-form {
	opacity: 0;
	pointer-events: none;
}

#forgotPasswordFormContainer.loading .tenant-portal-logo,
#forgotPasswordFormContainer.loading .welcome-section {
	opacity: 0 !important;
	pointer-events: none !important;
	display: none !important;
}

#forgotPasswordFormContainer.loading .processing {
	display: flex !important;
	justify-content: center;
	align-items: center;
	z-index: 100;
}

/* Loading message styling */
.loading-message {
	font-family: 'Inter', sans-serif;
	font-weight: 400;
	font-size: 14px;
	color: var(--black);
	margin-top: 8px;
	margin-bottom: 0;
}




.loading-spinner {
	display: inline-block;
	position: relative;
	width: 40px;
	height: 40px;
}

.loading-spinner div {
	box-sizing: border-box;
	display: block;
	position: absolute;
	width: 32px;
	height: 32px;
	margin: 4px;
	border: 4px solid var(--grey-lighten2);
	border-radius: 50%;
	animation: loading-spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
	border-color: var(--grey-lighten2) transparent transparent transparent;
}

.loading-spinner div:nth-child(1) { animation-delay: -0.45s; }
.loading-spinner div:nth-child(2) { animation-delay: -0.3s; }
.loading-spinner div:nth-child(3) { animation-delay: -0.15s; }

.two-factor-submit {
    margin-top: 2em;
}

@keyframes loading-spinner {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}


/* Responsive design */
@media (max-width: 600px) {
	.login-form-container {
		padding: 24px 16px;
	}

	.welcome-title {
		font-size: 20px;
	}

	.action-buttons {
		flex-direction: column;
		height: auto;
		gap: 12px;
	}

	.btn {
		width: 100%;
		height: 48px;
	}
}
