/* ────────────────────────────────────────────────────────────────────────────
   Login Page Styles
   Import global styles first
   ──────────────────────────────────────────────────────────────────────────── */

@import url('global.css');

/* ── Layout ──────────────────────────────────────────────────────────────── */
.login-shell {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: linear-gradient(135deg, var(--surface) 0%, var(--gray-100) 100%);
}

.login-form-panel {
	display: flex;
	flex-direction: column;
	width: 520px;
	padding: 30px;
	background: var(--surface-elevated);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
}

/* ── Logo & Title ───────────────────────────────────────────────────────── */
.login-logo {
	width: 250px;
	height: auto;
	margin: 0 auto 16px;
	display: block;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
}

.login-title {
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 2rem;
	color: var(--text-primary);
	text-align: center;
	margin-bottom: 32px;
}

/* ── Form Fields ────────────────────────────────────────────────────────── */
.field-group {
	margin-bottom: 20px;
}

.field-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-secondary);
	margin-bottom: 8px;
}

.field-wrap {
	position: relative;
}

.field-wrap svg {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: var(--text-tertiary);
	transition: var(--transition);
	pointer-events: none;
}

.field-input,
.login-input {
	width: 100%;
	padding: 18px;
	border: 1.5px solid var(--gold);
	border-radius: 8px;
	font-size: 14px;
	color: var(--gray-800);
	outline: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field-input:hover,
.login-input:hover {
	border-color: var(--un-blue-light);
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
}

.field-input:focus,
.login-input:focus {
	outline: none;
	border-color: var(--un-blue-mid);
	box-shadow: 0 0 0 3px rgba(29, 78, 143, 0.18);
}

.field-input:valid:not(:placeholder-shown),
.login-input:valid:not(:placeholder-shown) {
	border-color: var(--un-blue-light);
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.14);
}

.field-input.error,
.login-input.error {
	border-color: var(--danger);
	background: rgba(197, 48, 48, 0.04);
	box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.12);
}

.field-input:focus + svg {
	color: var(--un-blue-light);
}

.field-input::placeholder,
.login-input::placeholder {
	color: var(--gray-400);
}

/* ── Password Toggle ────────────────────────────────────────────────────── */
.field-eye {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-tertiary);
	padding: 6px;
	transition: var(--transition);
}

.field-eye:hover {
	color: var(--text-primary);
}

.field-eye svg {
	position: static;
	transform: none;
	width: 18px;
	height: 18px;
}

/* ── Remember Me & Forgot Password ──────────────────────────────────────── */
.field-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85rem;
	color: var(--text-secondary);
	cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--blue-500);
	cursor: pointer;
}

.forgot-link {
	font-size: 0.85rem;
	color: var(--blue-500);
	transition: color var(--transition);
}

.forgot-link:hover {
	color: var(--blue-700);
	text-decoration: underline;
}

/* ── Submit Button ──────────────────────────────────────────────────────── */
.btn-login {
	width: 100%;
	padding: 14px;
	background: var(--blue-500);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 14px rgba(0, 146, 233, 0.3);
}

.btn-login:hover {
	color: #fff;
	background: var(--blue-600);
	box-shadow: 0 6px 20px rgba(0, 131, 209, 0.35);
	transform: translateY(-2px);
}

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

.btn-login svg {
	width: 18px;
	height: 18px;
	transition: transform var(--transition);
}

.btn-login:hover svg {
	transform: translateX(4px);
}

.btn-login:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

/* ── Error State ────────────────────────────────────────────────────────── */
.login-error {
	display: none;
	background: rgba(197, 48, 48, 0.07);
	border: 1px solid rgba(197, 48, 48, 0.22);
	border-left: 3px solid var(--danger);
	border-radius: 6px;
	padding: 11px 14px;
	font-size: 0.84rem;
	font-weight: 500;
	color: #9b1c1c;
	align-items: flex-start;
	gap: 9px;
	margin-top: 16px;
	line-height: 1.5;
}

.login-error.show {
	display: flex;
	animation: shake 0.45s ease-in-out;
}

.login-error svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	opacity: 0.9;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	20%       { transform: translateX(-5px); }
	40%       { transform: translateX(5px); }
	60%       { transform: translateX(-3px); }
	80%       { transform: translateX(3px); }
}

/* ── Loading Spinner ────────────────────────────────────────────────────── */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: var(--white);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	display: none;
}

.btn-login.loading .spinner {
	display: block;
}

.btn-login.loading .btn-text {
	opacity: 0.8;
}

.btn-login.loading .btn-arrow {
	display: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
	.login-shell {
		padding: 16px;
	}

	.login-form-panel {
		padding: 36px 28px;
	}

	.login-title {
		font-size: 1.75rem;
	}

	.field-row {
		flex-direction: column;
		gap: 12px;
		align-items: flex-start;
	}
}

.login-page {
	background: #1A3A6B;
	border-radius: var(--radius-xl);
	overflow: hidden;
	display: grid;
	grid-template-columns:1fr 1fr;
}

.login-left {
	padding: 32px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.login-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}


.login-logo-inner {
	font-family: var(--font-heading);
	font-size: 11px;
	font-weight: 600;
	color: #1A3A6B;
	text-align: center;
	line-height: 1.2;
}

.login-title {
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 500;
	color: #000;
	letter-spacing: 0.5px;
	line-height: 1.3;
	margin-bottom: 6px;
}

.login-sub {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.5);
	line-height: 1.6;
}

.login-values {
	margin-top: 24px;
}

.lv-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 8px;
}

.lv-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #B8962E;
	flex-shrink: 0;
}

.login-footer {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.3);
	margin-top: 16px;
}

.login-right {
	background: #F7F9FC;
	padding: 32px;
}

.login-form-title {
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 500;
	color: #1A3A6B;
	margin-bottom: 4px;
	letter-spacing: 0.3px;
}

.login-form-sub {
	font-size: 12.5px;
	color: #8896A8;
	margin-bottom: 24px;
}

.login-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	font-size: 11.5px;
	color: #CBD2DC;
}

.login-divider::before, .login-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #E8ECF2;
}

.forgot {
	font-size: 12px;
	color: #1A3A6B;
	cursor: pointer;
	text-align: right;
	margin-top: 4px;
}
