/* =================================
   TOQOS - Page de Connexion Moderne
   ================================= */

/* Animation de fond dégradé */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Container principal */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(-45deg, #1a237e 0%, #2196f3 20%, #64b5f6 40%, #ffffff 50%, #90caf9 60%, #42a5f5 80%, #0d47a1 100%);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Carte de connexion */
.login-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: fadeInUp 0.8s ease-out;
    max-width: 450px;
    width: 100%;
}

/* Header de la carte */
.login-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 50%, #212121 100%);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.login-logo-container {
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.login-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* Corps de la carte */
.login-body {
    padding: 40px 30px;
}

/* Groupes d'input personnalisés */
.custom-input-group {
    margin-bottom: 25px;
    position: relative;
}

.custom-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 1;
}

.custom-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.custom-input:focus {
    outline: none;
    border-color: #1976d2;
    background: white;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
}

.custom-input:focus ~ .input-icon {
    color: #1976d2;
}

.custom-input-group:focus-within label {
    color: #1976d2;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #a0aec0;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: #1976d2;
}

/* Checkbox remember me */
.remember-forgot-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #1976d2;
}

.custom-checkbox label {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* Lien mot de passe oublié */
.forgot-password-link {
    color: #1976d2;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #0d47a1;
    text-decoration: none;
}

/* Bouton de connexion */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.6);
}

.btn-login:hover::before {
    left: 100%;
}

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

/* Alert personnalisé */
.custom-alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.custom-alert.alert-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #fc8181;
    color: #c53030;
}

.custom-alert h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.custom-alert p {
    margin: 0;
    font-size: 0.95rem;
}

/* Footer */
.login-footer {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.register-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link:hover {
    color: #0d47a1;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 576px) {
    .login-card {
        border-radius: 15px;
        margin: 10px;
    }

    .login-header {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 2rem;
    }

    .login-body {
        padding: 30px 20px;
    }

    .remember-forgot-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Animation de chargement */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Effet de particules (optionnel) */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}
