:root {
    --primary-color: #04d9ff;
    --secondary-color: #8a2be2;
    --text-color: #e0e6ff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --background: rgba(9, 14, 33, 0.97);
    --card-bg: rgba(15, 23, 42, 0.95);
    --card-border: rgba(4, 217, 255, 0.2);
    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(4, 217, 255, 0.2);
    --glass-effect: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    background-image: 
        radial-gradient(at 0% 0%, rgba(4, 217, 255, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(138, 43, 226, 0.2) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(9, 14, 33, 0.2) 0px, transparent 50%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, 
            rgba(4, 217, 255, 0.05) 0%, 
            rgba(138, 43, 226, 0.05) 100%);
    animation: pulse 8s ease infinite;
    z-index: -2;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(80px);
    z-index: -1;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.shape {
    position: absolute;
    opacity: 0.1;
    filter: blur(20px);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    animation: float 10s ease-in-out infinite;
}

.shape.circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.shape.square {
    width: 60px;
    height: 60px;
}

.shape.triangle {
    width: 0; 
    height: 0; 
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(255, 255, 255, 0.5);
    background: transparent;
}

.shape:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    top: 60%;
    left: 20%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    top: 30%;
    right: 15%;
    animation-delay: 4s;
}

.shape:nth-child(4) {
    bottom: 20%;
    right: 25%;
    animation-delay: 6s;
}

.shape:nth-child(5) {
    bottom: 30%;
    left: 30%;
    animation-delay: 8s;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    opacity: 0.9;
}

.logo-image {
    width: 80px;
    height: auto;
    object-fit: contain;
    animation: none;
}

.logo-img {
    width: 180px;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: 0;
    box-shadow: none;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.login-header h2 {
    color: var(--text-color);
    font-size: 28px;
    margin: 0;
    font-weight: 600;
    animation-delay: 0.2s;
    animation: fadeIn 0.8s ease-out forwards;
}

.subtitle {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    animation-delay: 0.6s;
    animation: fadeIn 0.8s ease-out forwards;
}

.form-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    padding-right: 3.5rem; /* Augmenter l'espace à droite pour le bouton */
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(4, 217, 255, 0.25);
    outline: none;
}

.form-control:focus + .focus-border {
    width: 100%;
}

.form-control:focus ~ i {
    color: var(--primary-color);
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.toggle-password {
    position: absolute;
    right: 1.25rem; /* Déplacer le bouton plus vers l'intérieur */
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 20px); /* Réduire légèrement la hauteur */
    width: 30px; /* Définir une largeur fixe */
    padding: 0; /* Supprimer le padding */
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 2;
    font-size: 0.9rem; /* Réduire légèrement la taille de l'icône */
    opacity: 0.7;
    transition: all 0.3s ease;
}

.toggle-password:focus {
    outline: none;
}

.toggle-password:hover {
    color: var(--secondary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    animation-delay: 0.8s;
    animation: fadeIn 0.8s ease-out forwards;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.remember-me label {
    font-size: 14px;
    color: var(--secondary-color);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation-delay: 1s;
    animation: fadeIn 0.8s ease-out forwards;
}

.login-btn span {
    z-index: 1;
    transition: var(--transition);
}

.login-btn i {
    margin-left: 8px;
    transition: var(--transition);
    z-index: 1;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(4, 217, 255, 0.3);
}

.login-btn:hover i {
    transform: translateX(3px);
}

.login-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.login-btn:hover:before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    border-left: 3px solid var(--error-color);
    animation: shake 0.5s ease-in-out;
}

.error-message i {
    font-size: 1.2rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.form-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.875rem;
    animation-delay: 1.2s;
    animation: fadeIn 0.8s ease-out forwards;
}

.copyright {
    color: var(--secondary-color);
    font-size: 12px;
    margin-top: 20px;
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
}
