:root {
	--green-900: #123a33;
	--green-800: #1d584e;
	--green-700: #2b7669;
	--green-600: #3f988c;
	--green-500: #5cb9a8;
	--green-400: #91d9cc;
	--green-100: #e9f7f4;
	--green-50: #f4fcfb;
	--purple: #6f5cff;
	--purple-light: #edeaff;
	--text-dark: #0f172a;
	--text-mid: #334155;
	--text-muted: #64748b;
	--border: rgba(15, 23, 42, 0.08);
	--surface: rgba(255, 255, 255, 0.94);
	--red: #ef4444;
	--radius-lg: 28px;
	--radius-md: 14px;
	--shadow-lg: 0 24px 64px rgba(2, 6, 23, 0.16);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "DM Sans", sans-serif;
	min-height: 100vh;
	margin: 0;
	background-color: var(--purple-light);
	color: var(--text-dark);
	overflow: hidden;
}

.page-bg {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background-color: var(--purple-light);
}

.auth-shell {
	width: min(1030px, 100%);
	position: relative;
}

.home-back-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
	font-size: 0.84rem;
	font-weight: 600;
	text-decoration: none;
	z-index: 2;
	backdrop-filter: blur(8px);
	transition:
		background 0.2s ease,
		transform 0.2s ease;
}

.home-back-btn:hover {
	background: rgba(255, 255, 255, 0.26);
	transform: translateY(-1px);
}

.auth-card {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	min-height: 560px;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.96),
		rgba(248, 252, 251, 0.92)
	);
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	backdrop-filter: blur(16px);
}

.auth-visual {
	position: relative;
	padding: 30px 28px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	color: #ffffff;
	background:
		radial-gradient(
			circle at top right,
			rgba(255, 255, 255, 0.18),
			transparent 30%
		),
		linear-gradient(135deg, var(--green-800), var(--green-600));
}

.auth-visual::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		120deg,
		transparent 0%,
		rgba(255, 255, 255, 0.08) 50%,
		transparent 100%
	);
	pointer-events: none;
}

.pill {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	width: fit-content;
	padding: 7px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.auth-visual h2 {
	position: relative;
	z-index: 1;
	font-family: "Playfair Display", serif;
	font-size: clamp(1.55rem, 2.2vw, 2rem);
	line-height: 1.16;
	margin: 12px 0 8px;
	max-width: 360px;
}

.auth-visual p {
	position: relative;
	z-index: 1;
	font-size: 0.94rem;
	line-height: 1.6;
	max-width: 340px;
	color: rgba(255, 255, 255, 0.9);
}

.feature-list {
	position: relative;
	z-index: 1;
	list-style: none;
	display: grid;
	gap: 8px;
	padding: 0;
	margin: 16px 0 0;
}

.feature-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 0.9rem;
}

.feature-list li::before {
	content: "✓";
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	font-size: 0.74rem;
}

.visual-badge {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	padding: 8px 12px;
	margin-top: 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.84rem;
}

.badge-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #9ff0d6;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.auth-form-panel {
	padding: 26px 24px 22px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.brand-block {
	text-align: center;
	margin-bottom: 14px;
}

.brand-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-bottom: 10px;
	border-radius: 16px;
	color: #ffffff;
	font-family: "Playfair Display", serif;
	font-size: 1.08rem;
	font-weight: 800;
	box-shadow: 0 8px 18px rgba(43, 118, 105, 0.22);
}

.brand-block h1 {
	font-family: "Playfair Display", serif;
	font-size: clamp(1.35rem, 2vw, 1.7rem);
	font-weight: 800;
	color: var(--text-dark);
	margin-bottom: 3px;
}

.brand-tagline {
	color: var(--text-muted);
	font-size: 0.88rem;
}

.form-container {
	width: 100%;
	background: rgba(255, 255, 255, 0.78);
	border: 1px solid var(--border);
	border-radius: 18px;
	padding: 18px;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.7),
		0 8px 18px rgba(15, 23, 42, 0.05);
}

.recent-accounts-section {
	margin-bottom: 4px;
}

.recent-label {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.recent-accounts-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}

.recent-account-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: var(--green-50);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: all 0.2s ease;
	width: 100%;
	text-align: left;
	font-family: "DM Sans", sans-serif;
}

.recent-account-chip:hover {
	transform: translateY(-1px);
	border-color: rgba(43, 118, 105, 0.33);
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.chip-avatar {
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, var(--purple), #8f7dff);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	flex-shrink: 0;
}

.chip-info {
	flex: 1;
	min-width: 0;
}

.chip-name {
	display: block;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--text-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chip-email {
	display: block;
	font-size: 0.72rem;
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chip-arrow {
	color: var(--green-600);
	font-weight: 700;
	font-size: 1rem;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.recent-account-chip:hover .chip-arrow {
	transform: translateX(3px);
}

.divide,
.divider {
	border: none;
	border-top: 1px solid var(--border);
	margin: 14px 0 18px;
}

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

label {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-mid);
	margin-bottom: 6px;
}

label .required {
	color: var(--purple);
	margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
	width: 100%;
	padding: 11px 12px;
	border: 1.5px solid rgba(15, 23, 42, 0.1);
	border-radius: 12px;
	font-size: 0.9rem;
	font-family: "DM Sans", sans-serif;
	background: #ffffff;
	color: var(--text-dark);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background 0.2s ease;
}

input::placeholder {
	color: var(--text-muted);
}

input:focus {
	outline: none;
	border-color: var(--green-600);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(63, 152, 140, 0.16);
}

.password-wrap {
	position: relative;
}

.password-wrap input {
	padding-right: 48px;
}

.eye-btn {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	padding: 0;
	transition: color 0.2s ease;
}

.eye-btn:hover {
	color: var(--green-600);
}

.login-button {
	width: 100%;
	background: linear-gradient(135deg, var(--green-700), var(--green-500));
	color: #ffffff;
	border: none;
	border-radius: 12px;
	padding: 11px 12px;
	font-size: 0.9rem;
	font-weight: 700;
	font-family: "DM Sans", sans-serif;
	letter-spacing: 0.03em;
	cursor: pointer;
	margin: 4px 0 14px;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.2s ease;
	box-shadow: 0 8px 18px rgba(43, 118, 105, 0.2);
}

.login-button:hover {
	opacity: 0.95;
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(43, 118, 105, 0.25);
}

.login-button:active {
	transform: translateY(0);
}

.forgot-link {
	background: none;
	border: none;
	padding: 0;
	color: var(--green-700);
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
}

.forgot-link:hover {
	text-decoration: underline;
}

.register-link {
	margin-top: 4px;
	text-align: center;
	color: var(--text-mid);
	font-size: 0.86rem;
}

.register-link a {
	color: var(--green-700);
	font-weight: 700;
	text-decoration: none;
}

.register-link a:hover {
	text-decoration: underline;
}

footer {
	text-align: center;
	margin-top: 12px;
	font-size: 0.78rem;
	color: var(--text-muted);
}

footer a {
	color: var(--green-700);
	text-decoration: none;
}

footer a:hover {
	text-decoration: underline;
}

#loginMessage {
	margin-bottom: 4px;
}

.modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(7, 22, 27, 0.62);
	backdrop-filter: blur(5px);
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.modal-content {
	background: var(--surface);
	padding: 28px 24px 22px;
	border-radius: 20px;
	max-width: 440px;
	width: 90%;
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
	position: relative;
	text-align: center;
	animation: modalIn 0.25s ease;
}

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

.modal-success-icon {
	width: 52px;
	height: 52px;
	background: linear-gradient(135deg, var(--green-700), var(--green-500));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 auto 16px;
}

.modal-content h3 {
	color: var(--text-dark);
	font-size: 1.25rem;
	font-weight: 700;
	margin-bottom: 10px;
}

.modal-content p {
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 8px;
}

.close {
	position: absolute;
	top: 14px;
	right: 18px;
	font-size: 22px;
	cursor: pointer;
	color: var(--text-muted);
	background: none;
	border: none;
	line-height: 1;
	transition: color 0.2s;
}

.close:hover {
	color: var(--red);
}

.modal-buttons {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.modal-button {
	padding: 11px 24px;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 700;
	font-family: "DM Sans", sans-serif;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s ease;
	min-width: 118px;
}

.modal-button.admin {
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
}

.modal-button.admin:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.modal-button.user {
	background: var(--green-600);
	color: #fff;
	border-color: var(--green-600);
}

.modal-button.user:hover {
	background: var(--green-700);
	border-color: var(--green-700);
}

.modal-button.no {
	background: #f3f4f6;
	color: var(--text-mid);
	border-color: var(--border);
}

.modal-button.no:hover {
	background: #e5e7eb;
}

.modal-button.yes {
	background: var(--green-600);
	color: #fff;
	border-color: var(--green-600);
}

.modal-button.yes:hover {
	background: var(--green-700);
}

.modal-button.ok {
	background: var(--green-600);
	color: #fff;
	border-color: var(--green-600);
	margin-top: 10px;
	padding: 12px 42px;
}

.modal-button.ok:hover {
	background: var(--green-700);
}

.email-example {
	color: var(--text-muted);
	font-size: 0.85rem !important;
	font-style: italic;
	background: var(--green-50);
	padding: 6px 16px;
	border-radius: 999px;
	display: inline-block;
	margin-top: 4px;
}

.user-type-message {
	background: var(--green-50);
	border-left: 3px solid var(--green-500);
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
	padding: 14px 16px;
	margin: 14px 0 18px;
	text-align: left;
}

.user-type-message p {
	font-size: 0.88rem !important;
	color: var(--text-mid) !important;
	margin-bottom: 6px !important;
}

.user-type-message p:last-child {
	margin-bottom: 0 !important;
}

/* ── White-based theme alignment ── */
body {
	background: #f7fafc;
	overflow: auto;
}

.page-bg {
	padding: 28px 20px 36px;
}

.auth-shell {
	width: min(1000px, 100%);
}

.home-back-btn {
	position: absolute;
	top: 16px;
	right: 16px;
	color: var(--text-dark);
	background: rgba(15, 23, 42, 0.05);
	border: 1px solid rgba(15, 23, 42, 0.08);
	backdrop-filter: none;
}

.home-back-btn:hover {
	background: rgba(15, 23, 42, 0.08);
}

.auth-card {
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 22px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.auth-visual {
	padding: 34px 32px;
	background: linear-gradient(135deg, #f9fcfa 0%, #eef8f3 100%);
	color: var(--text-dark);
	border-right: 1px solid var(--border);
}

.auth-visual::after {
	display: none;
}

.pill {
	background: #f2fdf6;
	color: var(--green-700);
	border-color: rgba(43, 118, 105, 0.14);
}

.auth-visual h2,
.auth-visual p,
.feature-list li,
.visual-badge {
	color: var(--text-dark);
}

.feature-list li::before {
	background: var(--green-100);
	color: var(--green-700);
}

.visual-badge {
	background: #ffffff;
	border: 1px solid var(--border);
}

.auth-form-panel {
	background: #ffffff;
	padding: 32px 30px 28px;
}

.form-container {
	background: #ffffff;
	border: 1px solid var(--border);
	box-shadow: none;
}

@media (max-width: 1024px) {
	body {
		overflow: auto;
	}

	.page-bg {
		padding: 14px;
	}

	.home-back-btn {
		position: relative;
		top: auto;
		right: auto;
		margin-bottom: 12px;
	}

	.auth-visual {
		display: none;
	}

	.auth-card {
		grid-template-columns: 1fr;
		border-radius: 22px;
	}

	.auth-visual {
		min-height: 280px;
		border-right: none;
		border-bottom: 1px solid var(--border);
	}

	.auth-form-panel {
		padding: 24px 18px 22px;
	}

	.form-container {
		padding: 20px;
	}

	.modal-content {
		padding: 30px 22px 24px;
	}

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

	.modal-button {
		width: 100%;
	}
}
