/* =========================================================
   LOGIN – LIQUID GLASS STYLE
   Colors are based on the original login (#4e54c8 / #8f94fb / #2f2185)
   ========================================================= */
:root {
	--bg-1: #2f2185;
	--bg-2: #4e54c8;
	--bg-3: #8f94fb;
	--blob-1: #8f94fb;
	--blob-2: #6a5cff;
	--blob-3: #5fb4ff;
	--accent-1: #5b6cf0;
	--accent-2: #8f94fb;
	--accent-dark: #2f2185;

	--glass: rgba(255, 255, 255, 0.10);
	--glass-strong: rgba(255, 255, 255, 0.18);
	--text: #ffffff;
	--text-dim: rgba(255, 255, 255, 0.72);

	--radius-card: 30px;
	--radius-field: 18px;
}

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

html, body {
	min-height: 100%;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif;
	font-size: 16px;
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 100%);
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
	overflow-x: hidden;
}

/* =========================================================
   BACKGROUND
   ========================================================= */
.area {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	background: linear-gradient(160deg, var(--bg-3) 0%, var(--bg-2) 45%, var(--bg-1) 100%);
}

/* liquid color blobs */
.blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: 0.7;
	animation: blobFloat 24s ease-in-out infinite alternate;
}
.blob-1 { width: 60vmax; height: 60vmax; left: -22vmax; top: -24vmax; background: var(--blob-1); }
.blob-2 { width: 50vmax; height: 50vmax; right: -20vmax; top: 20vh; background: var(--blob-2); animation-duration: 30s; }
.blob-3 { width: 55vmax; height: 55vmax; left: -15vmax; bottom: -30vmax; background: var(--blob-3); opacity: 0.45; animation-duration: 27s; }

@keyframes blobFloat {
	0%   { transform: translate(0, 0) scale(1); }
	50%  { transform: translate(5vmax, 4vmax) scale(1.08); }
	100% { transform: translate(-4vmax, 7vmax) scale(0.95); }
}

/* floating glass bubbles (from the original animation) */
.circles {
	position: absolute;
	inset: 0;
	list-style: none;
}
.circles li {
	position: absolute;
	display: block;
	width: 20px;
	height: 20px;
	bottom: -160px;
	border-radius: 30%;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06));
	border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 8px 24px rgba(20, 10, 80, 0.15);
	animation: rise 25s linear infinite;
}
.circles li:nth-child(1)  { left: 25%; width: 80px;  height: 80px;  animation-delay: 0s; }
.circles li:nth-child(2)  { left: 10%; width: 20px;  height: 20px;  animation-delay: 2s;  animation-duration: 12s; }
.circles li:nth-child(3)  { left: 70%; width: 20px;  height: 20px;  animation-delay: 4s; }
.circles li:nth-child(4)  { left: 40%; width: 60px;  height: 60px;  animation-delay: 0s;  animation-duration: 18s; }
.circles li:nth-child(5)  { left: 65%; width: 20px;  height: 20px;  animation-delay: 0s; }
.circles li:nth-child(6)  { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.circles li:nth-child(7)  { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.circles li:nth-child(8)  { left: 50%; width: 25px;  height: 25px;  animation-delay: 15s; animation-duration: 45s; }
.circles li:nth-child(9)  { left: 20%; width: 15px;  height: 15px;  animation-delay: 2s;  animation-duration: 35s; }
.circles li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s;  animation-duration: 11s; }

@keyframes rise {
	0%   { transform: translateY(0) rotate(0deg);        opacity: 1;  border-radius: 30%; }
	100% { transform: translateY(-115vh) rotate(540deg); opacity: 0;  border-radius: 50%; }
}

/* =========================================================
   GLASS BASE
   ========================================================= */
.glass {
	position: relative;
	isolation: isolate;
	background: linear-gradient(145deg, var(--glass-strong), var(--glass) 60%);
	-webkit-backdrop-filter: blur(26px) saturate(180%);
	backdrop-filter: blur(26px) saturate(180%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.40),
		inset 0 -1px 0 rgba(255, 255, 255, 0.08),
		inset 0 0 30px rgba(255, 255, 255, 0.05),
		0 24px 60px -16px rgba(20, 12, 90, 0.55);
}
/* reflective edge */
.glass::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(135deg,
		rgba(255, 255, 255, 0.65),
		rgba(255, 255, 255, 0.10) 35%,
		rgba(255, 255, 255, 0.05) 65%,
		rgba(255, 255, 255, 0.40));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}
/* soft highlight that follows the pointer (set via js/login.js) */
.glass::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(400px circle at var(--mx, 25%) var(--my, 0%),
		rgba(255, 255, 255, 0.16), transparent 45%);
}

/* =========================================================
   LAYOUT
   ========================================================= */
.login {
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 26px;
}

.brand {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
.brand-icon {
	width: 80px;
	height: 80px;
	border-radius: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 6px;
}
.brand-icon i {
	font-size: 2.3rem;
	line-height: 1;
}
.brand h1 {
	font-size: clamp(1.4rem, 6vw, 1.9rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
}
.subtitle {
	color: var(--text-dim);
	font-size: 1rem;
	max-width: 300px;
}

.card {
	width: 100%;
	border-radius: var(--radius-card);
	padding: 26px 22px;
}
.card form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* =========================================================
   FIELDS
   ========================================================= */
.field {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 58px;
	padding: 0 16px 0 18px;
	border-radius: var(--radius-field);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.20);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -8px 16px rgba(0, 0, 0, 0.06);
	cursor: text;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field:focus-within {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 4px rgba(143, 148, 251, 0.30);
}
.field > i {
	flex: none;
	font-size: 1.3rem;
	opacity: 0.9;
}
.field input {
	flex: 1;
	min-width: 0;
	height: 100%;
	background: transparent;
	border: 0;
	outline: 0;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
	color: var(--text);
	font: inherit;
	font-size: 1.02rem;
}
.field input::placeholder {
	color: rgba(255, 255, 255, 0.62);
}
/* keep autofill transparent (Chrome/Safari) */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--text);
	caret-color: var(--text);
	transition: background-color 9999s ease-in-out 0s;
}

/* 2FA code field */
.field-otp input {
	font-size: 1.5rem;
	letter-spacing: 0.45em;
	font-variant-numeric: tabular-nums;
	text-align: center;
	padding-right: 1.9rem; /* visually balance the icon */
}
.field-otp input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

/* show / hide password */
.pw-toggle {
	flex: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	width: 36px;
	height: 36px;
	margin-right: -6px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.75;
	transition: opacity 0.2s, background 0.2s;
}
.pw-toggle[hidden] { display: none; }
.pw-toggle i { font-size: 1.2rem; }
.pw-toggle:hover,
.pw-toggle:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
	outline: none;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
	position: relative;
	overflow: hidden;
	height: 58px;
	width: 100%;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-size: 1.1rem;
	font-weight: 650;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	-webkit-appearance: none;
	appearance: none;
	transition: transform 0.15s, filter 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn i {
	font-size: 1.25rem;
	transition: transform 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.btn-primary {
	margin-top: 4px;
	background: linear-gradient(100deg, var(--accent-1) 0%, #6a5cff 50%, var(--accent-2) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.50),
		inset 0 -6px 14px rgba(30, 20, 120, 0.25),
		0 12px 30px -8px rgba(47, 33, 133, 0.75);
}
/* glass shine on top */
.btn-primary::before {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: 3px;
	height: 45%;
	border-radius: 999px;
	background: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
	pointer-events: none;
}
/* light sweep on hover */
.btn-primary::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -60%;
	width: 40%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	transform: skewX(-20deg);
	transition: left 0.6s;
	pointer-events: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:hover::after { left: 120%; }
.btn-primary:hover .bi-arrow-right { transform: translateX(3px); }

.btn-glass {
	background: rgba(255, 255, 255, 0.10);
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.18); }
.btn-glass:hover .bi-arrow-left { transform: translateX(-3px); }

.btn-row {
	display: flex;
	gap: 12px;
	margin-top: 4px;
}
.btn-row .btn { margin-top: 0; }
.btn-row .btn-glass { flex: 0.8; }
.btn-row .btn-primary { flex: 1.2; }

/* loading state after submit (no "disabled": the button value must be sent) */
.btn.is-loading {
	pointer-events: none;
	filter: saturate(0.8) brightness(0.95);
}
.btn.is-loading i {
	animation: spin 0.9s linear infinite;
}
.btn.is-loading i::before {
	content: "\F130"; /* bi-arrow-repeat */
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   MESSAGES
   ========================================================= */
.message {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	margin-bottom: 16px;
	border-radius: 16px;
	font-size: 0.94rem;
	line-height: 1.4;
	text-align: left;
	border: 1px solid;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
	animation: messageIn 0.35s ease-out;
}
.message i {
	flex: none;
	font-size: 1.1rem;
	line-height: 1.3;
}
.message-error {
	background: rgba(255, 70, 100, 0.20);
	border-color: rgba(255, 130, 150, 0.50);
	color: #ffe3e8;
	animation: messageIn 0.35s ease-out, shake 0.4s 0.35s;
}
.message-error i { color: #ff8fa3; }
.message-success {
	background: rgba(60, 220, 150, 0.18);
	border-color: rgba(120, 240, 190, 0.45);
	color: #e0fff1;
}
.message-success i { color: #7cf0c0; }
.message-info {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.30);
	color: #fff;
}

@keyframes messageIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text-dim);
	font-size: 0.9rem;
}
.foot::before,
.foot::after {
	content: "";
	width: 44px;
	height: 1px;
	background: rgba(255, 255, 255, 0.35);
}

/* =========================================================
   FALLBACKS / RESPONSIVE
   ========================================================= */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.glass { background: rgba(47, 33, 133, 0.85); }
	.btn-glass { background: rgba(47, 33, 133, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
	.blob,
	.circles li,
	.message,
	.btn-primary::after {
		animation: none !important;
		transition: none !important;
	}
	.circles { display: none; }
}

@media (min-width: 480px) {
	.card { padding: 32px 28px; }
}

@media (max-height: 640px) {
	.brand-icon { width: 64px; height: 64px; border-radius: 20px; }
	.brand-icon i { font-size: 1.8rem; }
	.login { gap: 18px; }
}
