/** @format */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
	--primary-color: #2563eb;
	--primary-hover: #1d4ed8;
	--bg-color: #f8fafc;
	/* High transparency for strong glassmorphism look */
	--surface-color: rgba(255, 255, 255, 0.2);
	--surface-border: rgba(255, 255, 255, 0.25);
	--text-primary: #0f172a;
	--text-secondary: #475569;
	--input-bg: rgba(255, 255, 255, 0.4);
	/* Increased border visibility to separate from background */
	--input-border: rgba(148, 163, 184, 0.8);
	--input-focus: #2563eb;
	--error-color: #ef4444;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: "Outfit", sans-serif;
}

/* Ensure body doesn't inherit Bootstrap's default margin/padding styles if they conflict */
body {
	background-color: var(--bg-color);
	background-image:
		radial-gradient(at 0% 0%, hsla(210, 100%, 95%, 1) 0, transparent 50%),
		radial-gradient(at 50% 0%, hsla(200, 100%, 90%, 0.8) 0, transparent 50%),
		radial-gradient(at 100% 0%, hsla(280, 100%, 95%, 0.8) 0, transparent 50%);
	background-size: 200% 200%;
	animation: gradientShift 15s ease infinite alternate;
	background-position: center;
	background-attachment: fixed;
	color: var(--text-primary);
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 2rem;
	overflow: hidden;
	/* Hide overflow from animated background shapes */
	position: relative;
	z-index: 1;
}

/* Animated Background Shapes */
.circles {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: -1;
	margin: 0;
	padding: 0;
}

.circles li {
	position: absolute;
	display: block;
	list-style: none;
	width: 20px;
	height: 20px;
	background: rgba(37, 99, 235, 0.15);
	/* primary-color with opacity */
	animation: animate 25s linear infinite;
	bottom: -150px;
	border-radius: 50%;
}

.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 animate {
	0% {
		transform: translateY(0) rotate(0deg);
		opacity: 1;
		border-radius: 0;
	}

	100% {
		transform: translateY(-1000px) rotate(720deg);
		opacity: 0;
		border-radius: 50%;
	}
}

.auth-container {
	width: 100%;
	max-width: 440px;
	perspective: 1000px;
}

.auth-card {
	background: var(--surface-color);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--surface-border);
	border-radius: 24px;
	padding: 3rem 2.5rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
	/* Lighter shadow for true glassmorphism */
	transform-style: preserve-3d;
	animation: fadeInUp 0.6s ease-out forwards;
}

.auth-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 1.5rem;
}

.auth-logo img {
	height: 110px;
	object-fit: contain;
}

.auth-header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.auth-header h1 {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #2563eb;
}

.auth-header p {
	color: var(--text-secondary);
	font-size: 0.95rem;
}

.form-group {
	margin-bottom: 1.5rem;
	position: relative;
}

.form-group label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text-secondary);
	transition: color 0.3s ease;
}

/* Bootstrap override for label margin */
.form-group label {
	margin-bottom: 0px !important;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.input-wrapper label {
	position: absolute;
	left: 3rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-secondary);
	font-size: 1rem;
	font-weight: 400;
	pointer-events: none;
	transition: all 0.3s ease;
	margin-bottom: 0;
}

.input-wrapper svg:first-of-type {
	position: absolute;
	left: 1rem;
	color: var(--text-secondary);
	width: 20px;
	height: 20px;
	transition: color 0.3s ease;
	pointer-events: none;
}

.form-control {
	width: 100%;
	background: var(--input-bg) !important;
	border: 1.5px solid var(--input-border) !important;
	border-radius: 12px !important;
	padding: 1.25rem 3.5rem 0.5rem 3rem !important;
	/* Adjusted padding to accommodate floating label */
	color: var(--text-primary) !important;
	font-size: 1rem !important;
	transition: all 0.3s ease !important;
	outline: none !important;
	line-height: 1.5 !important;
}

.form-control:focus {
	border-color: var(--input-focus) !important;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
	background: rgba(255, 255, 255, 0.8) !important;
	/* Slightly less transparent on focus */
}

.form-control:focus + svg,
.form-control:focus ~ svg {
	color: var(--input-focus);
}

/* Floating label logic */
.form-control:focus ~ label,
.form-control:not(:placeholder-shown) ~ label {
	top: 0.35rem;
	left: 3rem;
	font-size: 0.75rem;
	font-weight: 500;
	transform: translateY(0);
	color: var(--input-focus);
}

.password-toggle {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--text-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: color 0.2s;
	height: 100%;
	width: 40px;
	z-index: 10;
}

.password-toggle:hover {
	color: var(--text-primary);
}

.form-options {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 2rem;
	font-size: 0.9rem;
}

.checkbox-wrapper {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
	accent-color: var(--primary-color);
	cursor: pointer;
}

.checkbox-wrapper span {
	color: var(--text-secondary);
}

.forgot-link {
	color: var(--primary-color);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
}

.forgot-link:hover {
	color: var(--primary-hover);
}

.btn-primary {
	width: 100%;
	background: var(--primary-color);
	color: white;
	border: none;
	border-radius: 12px;
	padding: 1rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
	background: var(--primary-hover);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
	transform: translateY(0);
}

.auth-footer {
	margin-top: 2rem;
	text-align: center;
	font-size: 0.95rem;
	color: var(--text-secondary);
}

.auth-footer a {
	color: var(--primary-color);
	text-decoration: none;
	font-weight: 600;
	margin-left: 0.25rem;
	transition: color 0.2s;
}

.auth-footer a:hover {
	color: var(--primary-hover);
}

/* Animations */
@keyframes gradientShift {
	0% {
		background-position: 0% 50%;
	}

	50% {
		background-position: 100% 50%;
	}

	100% {
		background-position: 0% 50%;
	}
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px) rotateX(-5deg);
	}

	to {
		opacity: 1;
		transform: translateY(0) rotateX(0);
	}
}

/* Staggered form elements */
.auth-logo {
	animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.auth-header {
	animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.form-group:nth-of-type(1) {
	animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.form-group:nth-of-type(2) {
	animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.form-options {
	animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

.btn-primary {
	animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.auth-footer {
	animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.error-message {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.2);
	color: var(--error-color);
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
	margin-bottom: 1.5rem;
	display: none;
	align-items: center;
	gap: 0.5rem;
}

.error-message.show {
	display: flex;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Response Design for Auth Pages */
@media (max-width: 480px) {
	body {
		padding: 1rem;
	}

	.auth-card {
		padding: 2rem 1.5rem;
		border-radius: 20px;
	}

	.auth-header h1 {
		font-size: 1.75rem;
	}

	.auth-logo img {
		height: 80px;
	}

	.form-control {
		padding-left: 2.5rem;
		padding-right: 1rem;
	}

	.input-wrapper label {
		left: 2.5rem;
	}

	.form-control:focus ~ label,
	.form-control:not(:placeholder-shown) ~ label {
		left: 2.5rem;
	}
}
