:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #4CAF50;
    --error-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animation de fond */
body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: float 6s ease-in-out infinite;
}

body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    background: var(--primary-gradient);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.auth-header .logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #667eea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-header h2 {
    margin: 0 0 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.auth-body {
    padding: 40px 30px;
}

.form-floating {
    margin-bottom: 20px;
    position: relative;
}

.form-floating input {
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    padding: 1rem 1rem 1rem 3rem;
    height: 60px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-floating input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-floating label {
    padding-left: 3rem;
    color: #999;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
    z-index: 4;
    transition: color 0.3s ease;
}

.form-floating input:focus ~ .input-icon {
    color: #667eea;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    z-index: 4;
    padding: 5px;
}

.password-toggle:hover {
    color: #667eea;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #764ba2;
}

.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login .spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 0.9rem;
    position: relative;
}

.register-link {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #764ba2;
}

.alert {
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

/* Loader */
.spinner-border {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Animations des inputs */
.form-floating input.is-invalid {
    border-color: var(--error-color);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.form-floating input.is-valid {
    border-color: var(--success-color);
}

/* Responsive */
@media (max-width: 576px) {
    .auth-header {
        padding: 30px 20px;
    }

    .auth-header .logo {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .auth-body {
        padding: 30px 20px;
    }

    .form-floating input {
        height: 55px;
        padding-left: 2.5rem;
    }

    .input-icon {
        left: 12px;
        font-size: 1rem;
    }
}
