@import '@signozhq/design-tokens/dist/style.css';

.login-form-container {
	display: flex;
	justify-content: center;
	width: 100%;
	align-items: flex-start;
}

.login-form-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 32px;
	text-align: center;
	width: 100%;
}

.login-form-emoji {
	width: 32px;
	height: 32px;
	font-size: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-form-title {
	font-family: Inter, sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	color: var(--levels-l1-foreground, #eceef2);
	margin: 0 !important;
}

.login-form-description {
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 20px;
	letter-spacing: -0.065px;
	color: var(--semantic-secondary-foreground, #adb4c2);
	max-width: 317px;
	margin: 0 !important;
	text-align: center;
}

.login-form-card {
	width: 100%;
	background: var(--semantic-secondary-background, #121317);
	border: 1px solid var(--semantic-secondary-border, #23262e);
	border-radius: 4px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.login-error-container {
	margin-top: 24px;
	width: 100%;

	.error-content {
		background: rgba(229, 72, 77, 0.1);
		border: 1px solid rgba(229, 72, 77, 0.2);
		border-radius: 4px;

		&__summary-section {
			border-bottom: 1px solid rgba(229, 72, 77, 0.2);
		}

		&__summary {
			padding: 16px;
		}

		&__summary-left {
			gap: 10px;
		}

		&__icon-wrapper {
			width: 12px;
			height: 12px;
			flex-shrink: 0;
		}

		.login-error-icon {
			color: var(--bg-cherry-200);
			padding-top: 1px;
		}

		&__summary-text {
			gap: 6px;
		}

		&__error-code {
			color: #fadadb;
			font-size: 13px;
			font-weight: 500;
			line-height: 1;
			letter-spacing: -0.065px;
		}

		&__error-message {
			color: #f5b6b8;
			font-size: 13px;
			font-weight: 400;
			line-height: 20px;
			letter-spacing: -0.065px;
		}

		&__message-badge {
			padding: 0px 16px 16px;
		}

		&__message-badge-label-text {
			color: #fadadb;
		}

		&__message-badge-line {
			background-image: radial-gradient(
				circle,
				rgba(229, 72, 77, 0.3) 1px,
				transparent 2px
			);
		}

		&__messages-section {
			padding: 0;
		}

		&__message-list {
			max-height: 200px;
		}

		&__message-item {
			color: #f5b6b8;
			font-size: 13px;
			font-weight: 400;
			line-height: 20px;
			letter-spacing: -0.065px;

			&::before {
				background: #f5b6b8;
			}
		}

		&__scroll-hint {
			background: rgba(229, 72, 77, 0.2);
		}

		&__scroll-hint-text {
			color: #fadadb;
		}
	}
}

.lightMode {
	.login-error-container {
		.error-content {
			background: rgba(229, 72, 77, 0.1);
			border-color: rgba(229, 72, 77, 0.2);

			&__error-code {
				color: var(--bg-ink-100);
			}

			&__error-message {
				color: var(--bg-ink-400);
			}

			&__docs-button {
				color: var(--bg-ink-400);
				border-color: var(--bg-vanilla-300, #e9e9e9);
				background: transparent;

				&:hover {
					color: var(--bg-ink-100);
					border-color: var(--bg-vanilla-400, #d1d5db);
					background: transparent;
				}
			}

			&__message-badge-label-text {
				color: var(--bg-ink-100);
			}

			&__message-item {
				color: var(--bg-ink-400);

				&::before {
					background: var(--bg-ink-400);
				}
			}

			&__scroll-hint-text {
				color: var(--bg-ink-100);
			}
		}
	}
}

.password-label-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin-bottom: 12px;

	> label {
		margin-bottom: 0;
	}
}

.forgot-password-link {
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.065px;
	color: var(--text-neutral-dark-200) !important;

	&:hover {
		color: var(--text-neutral-dark-300) !important;
	}
}

.login-form-input {
	height: 32px;
	background: var(--levels-l3-background, #23262e);
	border: 1px solid var(--levels-l3-border, #2c303a);
	border-radius: 2px;
	padding: 6px 8px;
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.065px;
	color: var(--levels-l1-foreground, #eceef2);

	&::placeholder {
		color: var(--levels-l3-foreground, #747b8b);
	}

	&:hover {
		border-color: var(--levels-l3-border, #2c303a);
	}

	&:focus {
		border-color: var(--semantic-primary-background, #4e74f8);
		box-shadow: none;
	}

	// Select component styling to match Input
	&.ant-select {
		width: 100%;
		height: 32px;
		margin: 0;
		padding: 0;

		.ant-select-selector {
			height: 32px !important;
			min-height: 32px !important;
			padding: 0 8px !important;
			border-radius: 2px !important;
			font-family: Inter, sans-serif !important;
			font-size: 13px !important;
			font-weight: 400 !important;
			line-height: 1 !important;
			letter-spacing: -0.065px !important;
			background: var(--levels-l3-background, #23262e) !important;
			border: 1px solid var(--levels-l3-border, #2c303a) !important;
			display: flex !important;
			align-items: center !important;
		}

		.ant-select-selection-search {
			height: 20px;
			line-height: 20px;
		}

		.ant-select-selection-item,
		.ant-select-selection-placeholder {
			line-height: 20px !important;
			height: 20px !important;
			font-family: Inter, sans-serif !important;
			font-size: 13px !important;
			font-weight: 400 !important;
			letter-spacing: -0.065px !important;
			display: flex !important;
			align-items: center !important;
			margin: 0 !important;
		}

		.ant-select-selection-placeholder {
			color: var(--levels-l3-foreground, #747b8b) !important;
		}

		.ant-select-selection-item {
			color: var(--levels-l1-foreground, #eceef2) !important;
		}

		&:hover .ant-select-selector {
			border-color: var(--levels-l3-border, #2c303a) !important;
		}

		&.ant-select-focused .ant-select-selector {
			border-color: var(--semantic-primary-background, #4e74f8) !important;
			box-shadow: none !important;
		}
	}

	// Remove border for orgId Select only
	&.login-form-select-no-border {
		&.ant-select .ant-select-selector {
			border: none !important;
		}

		&.ant-select:hover .ant-select-selector {
			border: none !important;
		}

		&.ant-select.ant-select-focused .ant-select-selector {
			border: none !important;
			box-shadow: none !important;
		}
	}
}

.login-form-actions {
	width: 100%;
	margin-top: 24px;
}

.login-submit-btn {
	width: 100%;
	height: 32px;
	padding: 10px 16px;
	background: var(--semantic-primary-background, #4e74f8);
	border: none;
	border-radius: 2px;
	font-family: Inter, sans-serif;
	font-size: 11px;
	font-weight: 500;
	line-height: 1;
	color: var(--semantic-primary-foreground, #eceef2);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	&:hover:not(:disabled) {
		background: var(--semantic-primary-background, #4e74f8);
		opacity: 0.9;
	}

	&:disabled {
		background: var(--semantic-primary-background, #4e74f8);
		opacity: 0.6;
		cursor: not-allowed;
	}
}

.lightMode {
	.login-form-title {
		color: var(--text-ink-500);
	}

	.login-form-description {
		color: var(--text-neutral-light-200, #80828d);
	}

	.login-form-card {
		background: var(--bg-base-white, #ffffff);
		border-color: var(--bg-vanilla-300, #e9e9e9);
	}

	.forgot-password-link {
		color: var(--text-neutral-dark-300);
	}

	.login-form-input {
		background: var(--bg-vanilla-200, #f5f5f5);
		border-color: var(--bg-vanilla-300, #e9e9e9);
		color: var(--text-ink-500);

		&::placeholder {
			color: var(--text-neutral-light-200, #80828d);
		}

		&:focus {
			border-color: var(--semantic-primary-background, #4e74f8);
		}

		// Select component light mode styling
		&.ant-select {
			.ant-select-selector {
				background: var(--bg-vanilla-200, #f5f5f5) !important;
				border-color: var(--bg-vanilla-300, #e9e9e9) !important;
				color: var(--text-ink-500) !important;
			}

			.ant-select-selection-placeholder {
				color: var(--text-neutral-light-200, #80828d) !important;
			}

			&:hover .ant-select-selector {
				border-color: var(--bg-vanilla-300, #e9e9e9) !important;
			}

			&.ant-select-focused .ant-select-selector {
				border-color: var(--semantic-primary-background, #4e74f8) !important;
			}
		}
	}
}
