:root {
	--bg-deep: #060d1a;
	--gold: #f0b93b;
	--gold-light: #ffd066;
	--gold-glow: rgba(240, 185, 59, 0.45);
	--text: #e2e8f0;
	--text-dim: #94a3b8;
	--border-subtle: rgba(100, 160, 210, 0.3);
	--card-bg: rgba(12, 24, 42, 0.75);
	--input-bg: #0f1f3a;
	--input-border: #3d6190;
	--danger: #f87171;
	--danger-glow: rgba(248, 113, 113, 0.4);
	--success: #5eead4;
	--radius-lg: 1.8rem;
	--radius-md: 1rem;
	--radius-sm: 0.6rem;
	--transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Segoe UI', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
}

body {
	background: var(--bg-deep);
	background-image:
		radial-gradient(ellipse at 50% 20%, rgba(14, 45, 75, 0.7) 0%, transparent 70%),
		radial-gradient(ellipse at 80% 70%, rgba(8, 35, 55, 0.55) 0%, transparent 65%),
		radial-gradient(ellipse at 20% 60%, rgba(6, 25, 45, 0.5) 0%, transparent 60%);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	color: var(--text);
	position: relative;
	overflow-x: hidden;
}

body::after {
	content: '';
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 130px;
	pointer-events: none;
	z-index: 0;
	background: repeating-linear-gradient(0deg,
			rgba(20, 100, 160, 0.05) 0px,
			rgba(20, 100, 160, 0.02) 4px,
			transparent 8px,
			rgba(20, 100, 160, 0.03) 12px,
			transparent 18px);
	animation: waveShimmer 8s ease-in-out infinite;
	mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
	-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
}

@keyframes waveShimmer {

	0%,
	100% {
		background-position: 0 0;
	}

	50% {
		background-position: 0 6px;
	}
}

.particles {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 0;
}

.particle {
	position: absolute;
	border-radius: 50%;
	background: rgba(240, 185, 59, 0.18);
	animation: floatUp 8s ease-in-out infinite;
	opacity: 0;
}

.particle:nth-child(1) {
	width: 4px;
	height: 4px;
	left: 15%;
	bottom: 10%;
	animation-delay: 0s;
	animation-duration: 7s;
}

.particle:nth-child(2) {
	width: 3px;
	height: 3px;
	left: 35%;
	bottom: 5%;
	animation-delay: 1.5s;
	animation-duration: 9s;
}

.particle:nth-child(3) {
	width: 5px;
	height: 5px;
	left: 55%;
	bottom: 15%;
	animation-delay: 3s;
	animation-duration: 6.5s;
}

.particle:nth-child(4) {
	width: 2px;
	height: 2px;
	left: 70%;
	bottom: 8%;
	animation-delay: 4.5s;
	animation-duration: 8.5s;
}

.particle:nth-child(5) {
	width: 4px;
	height: 4px;
	left: 85%;
	bottom: 12%;
	animation-delay: 2s;
	animation-duration: 7.5s;
}

.particle:nth-child(6) {
	width: 3px;
	height: 3px;
	left: 25%;
	bottom: 20%;
	animation-delay: 5s;
	animation-duration: 10s;
}

@keyframes floatUp {
	0% {
		transform: translateY(0) scale(0.5);
		opacity: 0;
	}

	15% {
		opacity: 0.7;
	}

	50% {
		opacity: 0.4;
		transform: translateY(-60px) scale(1.2);
	}

	85% {
		opacity: 0.1;
	}

	100% {
		transform: translateY(-120px) scale(0.3);
		opacity: 0;
	}
}

.login-wrapper {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
}

.brand-header {
	text-align: center;
	margin-bottom: 26px;
}

.brand-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: linear-gradient(145deg, rgba(240, 185, 59, 0.25), rgba(200, 140, 30, 0.12));
	border: 2px solid rgba(240, 185, 59, 0.45);
	box-shadow: 0 0 32px rgba(240, 185, 59, 0.22), 0 4px 16px rgba(0, 0, 0, 0.3);
	margin-bottom: 12px;
	font-size: 1.8rem;
	color: var(--gold);
	animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

	0%,
	100% {
		box-shadow: 0 0 26px rgba(240, 185, 59, 0.2), 0 4px 14px rgba(0, 0, 0, 0.3);
	}

	50% {
		box-shadow: 0 0 42px rgba(240, 185, 59, 0.38), 0 4px 20px rgba(0, 0, 0, 0.4);
	}
}

.brand-name {
	font-size: 1.3rem;
	font-weight: 700;
	background: linear-gradient(135deg, #FFD966, #f0b93b, #e8962e);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	letter-spacing: -0.2px;
	margin-bottom: 2px;
}

.brand-sub {
	font-size: 0.7rem;
	color: var(--text-dim);
	letter-spacing: 0.3px;
	opacity: 0.7;
}

.login-card {
	background: var(--card-bg);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border-radius: var(--radius-lg);
	border: 1px solid var(--border-subtle);
	padding: 1.8rem 2rem 2.2rem;
	box-shadow: 0 12px 44px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 140, 200, 0.08);
	transition: all 0.4s ease;
}

.login-card:hover {
	border-color: rgba(240, 185, 59, 0.3);
	box-shadow: 0 14px 50px rgba(0, 0, 0, 0.6), 0 2px 12px rgba(240, 185, 59, 0.06);
}

.card-title {
	font-size: 1.05rem;
	font-weight: 700;
	margin-bottom: 0.4rem;
	color: #e8eef6;
	display: flex;
	align-items: center;
	gap: 8px;
}

.card-title i {
	color: var(--gold);
	font-size: 0.95rem;
}

.card-desc {
	font-size: 0.7rem;
	color: var(--text-dim);
	margin-bottom: 1.4rem;
	line-height: 1.4;
}

.form-group {
	margin-bottom: 1rem;
	position: relative;
}

.form-label {
	display: block;
	font-size: 0.74rem;
	font-weight: 600;
	color: #bcc8da;
	margin-bottom: 0.35rem;
	letter-spacing: 0.2px;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.input-wrapper .input-icon {
	position: absolute;
	left: 13px;
	color: #6b8ab0;
	font-size: 0.85rem;
	pointer-events: none;
	transition: var(--transition-fast);
	z-index: 2;
}

.form-input {
	width: 100%;
	background: var(--input-bg);
	border: 1.5px solid var(--input-border);
	color: #fff;
	border-radius: 36px;
	padding: 11px 14px 11px 40px;
	font-size: 0.85rem;
	outline: none;
	transition: var(--transition-fast);
	letter-spacing: 0.3px;
}

.form-input::placeholder {
	color: #5a7090;
	font-size: 0.76rem;
}

.form-input:focus {
	border-color: var(--gold);
	box-shadow: 0 0 14px var(--gold-glow), 0 0 0 3px rgba(240, 185, 59, 0.05);
}

.input-wrapper:focus-within .input-icon {
	color: var(--gold);
}

.toggle-password {
	position: absolute;
	right: 12px;
	background: transparent;
	border: none;
	color: #6b8ab0;
	cursor: pointer;
	font-size: 0.82rem;
	padding: 4px 8px;
	transition: var(--transition-fast);
	z-index: 2;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.toggle-password:hover {
	color: #bccfe0;
	background: rgba(255, 255, 255, 0.06);
}

/* ========== 验证码区域 ========== */
.captcha-row {
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.captcha-row .form-group {
	flex: 1;
	margin-bottom: 0;
	min-width: 0;
}

.captcha-row .form-input {
	padding: 11px 14px;
	padding-left: 14px;
	letter-spacing: 3px;
	font-size: 0.9rem;
	font-weight: 600;
	text-align: center;
	border-radius: 36px;
}

.captcha-canvas-wrap {
	flex-shrink: 0;
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
}

.captcha-canvas {
	border-radius: 10px;
	border: 1.5px solid var(--input-border);
	cursor: pointer;
	transition: var(--transition-fast);
	display: block;
	background: #0a1628;
}

.captcha-canvas:hover {
	border-color: var(--gold);
	box-shadow: 0 0 12px rgba(240, 185, 59, 0.25);
}

.captcha-refresh-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1.5px solid var(--input-border);
	color: #8ab4d8;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	font-size: 0.85rem;
	transition: var(--transition-fast);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.captcha-refresh-btn:hover {
	background: rgba(240, 185, 59, 0.15);
	border-color: var(--gold);
	color: var(--gold-light);
	box-shadow: 0 0 10px rgba(240, 185, 59, 0.2);
}

.captcha-refresh-btn:active {
	transform: rotate(90deg);
	transition: 0.15s;
}

.error-message {
	background: rgba(248, 113, 113, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.4);
	color: #fca5a5;
	border-radius: 30px;
	padding: 8px 15px;
	font-size: 0.7rem;
	margin-bottom: 0.9rem;
	display: flex;
	align-items: center;
	gap: 7px;
	animation: shake 0.4s ease;
}

@keyframes shake {

	0%,
	100% {
		transform: translateX(0);
	}

	20% {
		transform: translateX(-6px);
	}

	40% {
		transform: translateX(6px);
	}

	60% {
		transform: translateX(-4px);
	}

	80% {
		transform: translateX(4px);
	}
}

.btn-login {
	width: 100%;
	background: linear-gradient(135deg, #f0b93b, #e8a52e);
	color: #0a1428;
	border: none;
	border-radius: 40px;
	padding: 12px 20px;
	font-size: 0.88rem;
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition-fast);
	letter-spacing: 0.3px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 18px rgba(240, 185, 59, 0.2);
	margin-top: 0.4rem;
}

.btn-login:hover {
	background: linear-gradient(135deg, #ffc844, #f5b53a);
	box-shadow: 0 6px 28px rgba(240, 185, 59, 0.4), 0 0 0 4px rgba(240, 185, 59, 0.06);
	transform: translateY(-1px);
}

.btn-login:active {
	transform: scale(0.97);
	transition: 0.08s;
}

.btn-login:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
	filter: grayscale(30%);
}

.btn-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(10, 20, 40, 0.3);
	border-top-color: #0a1428;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

.btn-login.loading .btn-spinner {
	display: inline-block;
}

.btn-login.loading .btn-text {
	display: none;
}

.btn-login.loading {
	pointer-events: none;
	opacity: 0.85;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.card-footer {
	text-align: center;
	margin-top: 1.2rem;
	font-size: 0.68rem;
	color: var(--text-dim);
	display: flex;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
}

.card-footer a {
	color: #8ab4d8;
	text-decoration: none;
	transition: var(--transition-fast);
	cursor: pointer;
}

.card-footer a:hover {
	color: var(--gold-light);
	text-decoration: underline;
}

.card-footer span {
	opacity: 0.35;
}

.security-note {
	text-align: center;
	margin-top: 1.6rem;
	font-size: 0.62rem;
	color: var(--text-dim);
	opacity: 0.55;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
}

.security-note i {
	font-size: 0.66rem;
	color: var(--success);
}

/* Toast */
.toast-popup {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	padding: 9px 20px;
	border-radius: 30px;
	font-weight: 600;
	font-size: 0.78rem;
	pointer-events: none;
	animation: toastIn 0.4s ease-out, toastOut 0.35s 2.2s ease-in forwards;
	white-space: nowrap;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
	max-width: 90vw;
	text-align: center;
}

.toast-success {
	background: #1a5c3a;
	color: #d0fce8;
	border: 1px solid #2ecc71;
}

.toast-error {
	background: #5c1a1a;
	color: #fce8d0;
	border: 1px solid #e67e22;
}

@keyframes toastIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-20px);
	}

	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

@keyframes toastOut {
	from {
		opacity: 1;
	}

	to {
		opacity: 0;
		transform: translateX(-50%) translateY(-20px);
	}
}

/* 响应式 */
@media (max-width: 500px) {
	body {
		padding: 12px;
		align-items: flex-start;
		padding-top: 32px;
	}

	.login-card {
		padding: 1.3rem 1.1rem 1.6rem;
		border-radius: 1.3rem;
	}

	.brand-logo {
		width: 52px;
		height: 52px;
		font-size: 1.4rem;
	}

	.brand-name {
		font-size: 1.05rem;
	}

	.brand-sub {
		font-size: 0.6rem;
	}

	.card-title {
		font-size: 0.9rem;
	}

	.form-input {
		padding: 10px 12px 10px 36px;
		font-size: 0.78rem;
		border-radius: 30px;
	}

	.form-label {
		font-size: 0.68rem;
	}

	.btn-login {
		padding: 10px 16px;
		font-size: 0.8rem;
		border-radius: 34px;
	}

	.input-wrapper .input-icon {
		left: 11px;
		font-size: 0.74rem;
	}

	.toggle-password {
		right: 7px;
		width: 26px;
		height: 26px;
		font-size: 0.7rem;
	}

	.captcha-row {
		gap: 6px;
	}

	.captcha-row .form-input {
		padding: 10px 10px;
		font-size: 0.8rem;
		letter-spacing: 2px;
		border-radius: 30px;
	}

	.captcha-canvas {
		border-radius: 8px;
	}

	.captcha-refresh-btn {
		width: 30px;
		height: 30px;
		font-size: 0.7rem;
	}

	.card-footer {
		font-size: 0.62rem;
		gap: 8px;
	}

	.security-note {
		font-size: 0.56rem;
	}

	.error-message {
		font-size: 0.64rem;
		padding: 7px 12px;
	}
}

@media (max-width: 380px) {
	body {
		padding: 6px;
		padding-top: 20px;
	}

	.login-card {
		padding: 1rem 0.85rem 1.2rem;
		border-radius: 1rem;
	}

	.brand-logo {
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
		margin-bottom: 8px;
	}

	.brand-name {
		font-size: 0.9rem;
	}

	.form-input {
		padding: 8px 10px 8px 30px;
		font-size: 0.7rem;
	}

	.btn-login {
		padding: 9px 14px;
		font-size: 0.72rem;
	}

	.captcha-row {
		gap: 4px;
	}

	.captcha-row .form-input {
		padding: 8px 8px;
		font-size: 0.7rem;
		letter-spacing: 1.5px;
	}

	.captcha-canvas {
		border-radius: 6px;
	}

	.captcha-refresh-btn {
		width: 26px;
		height: 26px;
		font-size: 0.62rem;
	}

	.card-footer {
		font-size: 0.56rem;
		flex-direction: column;
		gap: 3px;
	}

	.card-footer span {
		display: none;
	}
}