/* ======== IMPORT DES VARIABLES GLOBALES ======== */
@import url('../../Accueil/css/index.css');

/* ======== RESET & BASE ======== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	overflow: hidden;
}

body {
	background-color: var(--body-color);
	font-family: 'Poppins', sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ======== ALERT JAVASCRIPT ======== */
.alert-js {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background-color: #f8d7da;
	color: #721c24;
	padding: 15px;
	text-align: center;
	z-index: 1000;
	font-size: 14px;
}

/* ======== MOBILE WARNING ======== */
.mobile-page {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--body-color);
	z-index: 999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.mobile-text {
	text-align: center;
	background: var(--sidebar-color);
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-text h2 {
	color: var(--primary-color);
	font-size: 20px;
	margin-bottom: 15px;
}

.mobile-text p {
	color: var(--secondary-text-color);
	font-size: 14px;
	line-height: 1.6;
}

@media (max-width: 700px) {
	.mobile-page {
		display: flex;
	}

	.login-wrapper {
		display: none;
	}
}

/* ======== LOGIN WRAPPER ======== */
.login-wrapper {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

/* ======== LOGIN CONTAINER ======== */
.login-container {
	background: var(--sidebar-color);
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	padding: 35px;
	width: 100%;
	max-width: 450px;
	z-index: 1;
	animation: slideUp 0.6s ease-out;
	position: relative;
	overflow: hidden;
}

.login-container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--primary-color), #ff6b35);
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ======== LOGIN HEADER ======== */
.login-header {
	text-align: center;
	margin-bottom: 30px;
}

.logo-wrapper {
	margin-bottom: 0px;
}

.logo {
	width: 80px;
	height: 80px;
	object-fit: contain;
}

.login-header h1 {
	font-size: 28px;
	font-weight: 700;
	color: var(--primary-text-color);
	margin-bottom: 8px;
}

.subtitle {
	font-size: 14px;
	color: var(--secondary-text-color);
}

/* ======== MESSAGES ======== */
.messages-wrapper {
	margin-bottom: 25px;
}

.alert {
	padding: 14px 20px;
	border-radius: 8px;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 10px;
	animation: slideIn 0.4s ease-out;
	transition: opacity 0.3s ease;
	position: relative;
	overflow: hidden;
}

.alert::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
}

.alert i {
	font-size: 20px;
}

/* Success messages */
.alert-success {
	background-color: rgba(39, 174, 96, 0.1);
	color: var(--success-color);
	border: 1px solid rgba(39, 174, 96, 0.2);
}

.alert-success::before {
	background-color: var(--success-color);
}

.alert-success i {
	color: var(--success-color);
}

/* Error/Danger messages */
.alert-error,
.alert-danger {
	background-color: rgba(231, 76, 60, 0.1);
	color: #e74c3c;
	border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-error::before,
.alert-danger::before {
	background-color: #e74c3c;
}

.alert-error i,
.alert-danger i {
	color: #e74c3c;
}

/* Warning messages */
.alert-warning {
	background-color: rgba(243, 156, 18, 0.1);
	color: #f39c12;
	border: 1px solid rgba(243, 156, 18, 0.2);
}

.alert-warning::before {
	background-color: #f39c12;
}

.alert-warning i {
	color: #f39c12;
}

/* Info messages */
.alert-info {
	background-color: rgba(52, 152, 219, 0.1);
	color: #3498db;
	border: 1px solid rgba(52, 152, 219, 0.2);
}

.alert-info::before {
	background-color: #3498db;
}

.alert-info i {
	color: #3498db;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Dark mode pour les messages */
.darkmode .alert {
	filter: brightness(0.9);
}

.darkmode .alert-success {
	background-color: rgba(39, 174, 96, 0.15);
	border-color: rgba(39, 174, 96, 0.3);
}

.darkmode .alert-error,
.darkmode .alert-danger {
	background-color: rgba(231, 76, 60, 0.15);
	border-color: rgba(231, 76, 60, 0.3);
}

.darkmode .alert-warning {
	background-color: rgba(243, 156, 18, 0.15);
	border-color: rgba(243, 156, 18, 0.3);
}

.darkmode .alert-info {
	background-color: rgba(52, 152, 219, 0.15);
	border-color: rgba(52, 152, 219, 0.3);
}

/* ======== FORM ======== */
.login-form {
	display: flex;
	flex-direction: column;
	gap: 25px;
}

.form-group {
	position: relative;
}

.form-group label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--primary-text-color);
	margin-bottom: 10px;
}

.form-group label i {
	font-size: 18px;
	color: var(--primary-color);
}

.form-control {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid transparent;
	border-radius: 8px;
	font-size: 15px;
	background-color: var(--primary-color-light);
	color: var(--primary-text-color);
	transition: all 0.3s ease;
	outline: none;
}

.form-control:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 4px rgba(255, 130, 20, 0.1);
}

.form-control::placeholder {
	color: var(--secondary-text-color);
	opacity: 0.7;
}

/* Password toggle */
.password-wrapper {
	position: relative;
}

.toggle-password {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--secondary-text-color);
	cursor: pointer;
	padding: 5px;
	transition: color 0.3s ease;
}

.toggle-password:hover {
	color: var(--primary-color);
}

.toggle-password i {
	font-size: 20px;
}

/* Focus border animation */
.focus-border {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 2px;
	background-color: var(--primary-color);
	transition: all 0.3s ease;
	transform: translateX(-50%);
}

.form-control:focus~.focus-border {
	width: 100%;
}

/* ======== FORM ACTIONS ======== */
.form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: -10px;
	margin-bottom: 10px;
}

.remember-me {
	display: flex;
	align-items: center;
	gap: 8px;
}

.remember-me input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--primary-color);
}

.remember-me label {
	font-size: 14px;
	color: var(--secondary-text-color);
	cursor: pointer;
}

.forgot-password {
	font-size: 14px;
	color: var(--primary-color);
	text-decoration: none;
	transition: all 0.3s ease;
}

.forgot-password:hover {
	text-decoration: underline;
}

/* ======== LOGIN BUTTON ======== */
.btn-login {
	width: 100%;
	padding: 15px 24px;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	position: relative;
	overflow: hidden;
	background-color: var(--primary-color);
	color: white;
	margin-top: 20px;
}

.btn-login::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.btn-login:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(255, 130, 20, 0.3);
}

.btn-login:hover::before {
	width: 300px;
	height: 300px;
}

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

.btn-login i {
	font-size: 20px;
	transition: transform 0.3s ease;
}

.btn-login:hover i {
	transform: translateX(5px);
}

/* ======== FOOTER ======== */
.login-footer {
	text-align: center;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid var(--primary-color-light);
}

.login-footer p {
	font-size: 12px;
	color: var(--secondary-text-color);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 480px) {
	.login-container {
		padding: 30px 20px;
		margin: 10px;
	}

	.login-header h1 {
		font-size: 24px;
	}

	.logo {
		width: 60px;
		height: 60px;
	}
}

/* ======== DARK MODE ======== */
.darkmode .login-container {
	background: var(--sidebar-color);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.darkmode .form-control {
	background-color: var(--primary-color-light);
	border-color: var(--border-color);
}

.darkmode .form-control:focus {
	box-shadow: 0 0 0 4px rgba(255, 130, 20, 0.2);
}