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

:root {
	--blue: #2f6bff;
	--blue-deep: #1e4fd6;
	--violet: #7b4fff;
	--navy: #0b1e3d;
	--muted: #8b96b3;
	--line: #e7ecf7;
	--field-bg: #f7f9fe;
	--danger: #ef4444;
}

html,
body {
	height: 100%;
	font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}

body {
	min-height: 100vh;
	min-height: 100dvh;
	background: #fff;
	overflow-x: hidden;
}

/* ---------------------------------------------------------------- */
/* Layout                                                            */
/* ---------------------------------------------------------------- */

.login-page {
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	grid-template-columns: minmax(380px, 38%) 1fr;
}

/* ---------------------------------------------------------------- */
/* Brand panel (left, desktop)                                       */
/* ---------------------------------------------------------------- */

.brand-panel {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 64px 56px;
	background: radial-gradient(circle at 20% 10%, #6e8cff 0%, #4a63f0 40%, #6c4fe0 100%);
	color: #fff;
}

.brand-shape {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	pointer-events: none;
}

.brand-shape-a {
	width: 420px;
	height: 420px;
	top: -140px;
	right: -160px;
}

.brand-shape-b {
	width: 320px;
	height: 320px;
	bottom: -140px;
	left: -100px;
	background: rgba(255, 255, 255, 0.06);
}

.brand-content {
	position: relative;
	z-index: 1;
	max-width: 420px;
}

.brand-logo {
	width: 68px;
	height: 68px;
	margin-bottom: 32px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.16);
	border: 1.5px solid rgba(255, 255, 255, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
}

.brand-logo i {
	font-size: 32px;
	color: #fff;
}

.brand-content h1 {
	font-size: 34px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.4px;
}

.brand-lead {
	margin-top: 14px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 15.5px;
	font-weight: 500;
	line-height: 1.55;
}

.brand-features {
	list-style: none;
	margin-top: 40px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.brand-features li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14.5px;
	font-weight: 600;
}

.brand-features li i {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.14);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
}

.brand-footer {
	position: relative;
	z-index: 1;
	margin-top: 56px;
	color: rgba(255, 255, 255, 0.65);
	font-size: 12.5px;
	font-weight: 500;
}

/* ---------------------------------------------------------------- */
/* Form panel (right, desktop)                                       */
/* ---------------------------------------------------------------- */

.form-panel {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 32px;
	background: #fff;
}

.form-panel-inner {
	width: 100%;
	max-width: 400px;
}

.form-header {
	margin-bottom: 32px;
}

.form-logo {
	display: none;
}

.form-header h2 {
	color: var(--navy);
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.3px;
}

.form-header p {
	margin-top: 6px;
	color: var(--muted);
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.5;
}

.alert-error {
	background: rgba(239, 68, 68, 0.09);
	border: 1px solid rgba(239, 68, 68, 0.22);
	border-radius: 14px;
	padding: 12px 14px;
	margin-bottom: 20px;
	color: var(--danger);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	display: flex;
	align-items: center;
	gap: 8px;
}

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

.field-label {
	display: block;
	font-size: 12px;
	font-weight: 800;
	color: var(--navy);
	letter-spacing: 0.6px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.field {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1.5px solid var(--line);
	border-radius: 14px;
	padding: 14px 16px;
	background: var(--field-bg);
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field:focus-within {
	background: #fff;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.field svg {
	width: 19px;
	height: 19px;
	stroke: var(--muted);
	flex-shrink: 0;
}

.form-control {
	min-width: 0;
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	font-family: "Plus Jakarta Sans", sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: var(--navy);
}

.form-control::placeholder {
	color: #b7c0da;
	font-weight: 500;
}

.toggle-pass {
	width: 24px;
	height: 24px;
	border: none;
	background: transparent;
	color: var(--muted);
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

.btn-login {
	width: 100%;
	min-height: 52px;
	padding: 16px;
	margin-top: 8px;
	border: none;
	border-radius: 15px;
	background: linear-gradient(90deg, var(--blue), var(--violet));
	color: #fff;
	font-family: "Plus Jakarta Sans", sans-serif;
	font-size: 15.5px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	box-shadow: 0 14px 26px -8px rgba(47, 107, 255, 0.55);
	cursor: pointer;
	transition: transform 0.15s, opacity 0.18s, box-shadow 0.18s;
}

.btn-login:hover {
	box-shadow: 0 16px 30px -8px rgba(47, 107, 255, 0.62);
}

.btn-login svg {
	width: 19px;
	height: 19px;
}

.btn-login:active {
	transform: scale(0.98);
}

.btn-login.loading {
	pointer-events: none;
	opacity: 0.82;
}

.spinner {
	width: 17px;
	height: 17px;
	border: 2px solid rgba(255, 255, 255, 0.36);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

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

.form-footer-mobile {
	display: none;
	margin-top: 28px;
	text-align: center;
	color: var(--muted);
	font-size: 12.5px;
	font-weight: 500;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

/* Tablet: keep split layout but tighten spacing */
@media (max-width: 1100px) {
	.brand-panel {
		padding: 48px 40px;
	}

	.brand-content h1 {
		font-size: 28px;
	}
}

/* Below this, stack into a single column and collapse the brand
   panel into a compact hero above the form. */
@media (max-width: 860px) {
	.login-page {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}

	.brand-panel {
		padding: 40px 28px 36px;
		align-items: center;
		text-align: center;
	}

	.brand-content {
		max-width: none;
	}

	.brand-logo {
		width: 64px;
		height: 64px;
		margin: 0 auto 18px;
	}

	.brand-logo svg {
		width: 32px;
		height: 32px;
	}

	.brand-content h1 {
		font-size: 24px;
	}

	.brand-lead {
		font-size: 14px;
	}

	.brand-features {
		display: none;
	}

	.brand-footer {
		display: none;
	}

	.form-panel {
		padding: 32px 24px 40px;
	}

	.form-header {
		text-align: center;
	}

	.form-logo {
		display: flex;
		width: 48px;
		height: 48px;
		margin: 0 auto 16px;
		border-radius: 14px;
		background: linear-gradient(135deg, #1877f2, #0d5fd1);
		box-shadow: 0 6px 16px rgba(24, 119, 242, 0.24);
		align-items: center;
		justify-content: center;
	}

	.form-logo i {
		font-size: 24px;
		color: #fff;
	}

	.form-footer-mobile {
		display: block;
	}
}

@media (max-width: 420px) {
	.brand-panel {
		padding: 32px 20px 28px;
	}

	.form-panel {
		padding: 28px 18px 32px;
	}

	.form-header h2 {
		font-size: 22px;
	}
}

/* Very short viewports (landscape phones): drop the hero entirely
   so the form stays reachable without scrolling. */
@media (max-width: 860px) and (max-height: 480px) {
	.login-page {
		grid-template-columns: 1fr;
		grid-template-rows: 1fr;
	}

	.brand-panel {
		display: none;
	}

	.form-header {
		text-align: center;
	}
}
