/* CSS spécifique aux pages de connexion avec animations */

/* Arrière-plan animé */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: var(--bg-primary);
    overflow: hidden;
}

.auth-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(var(--border-primary) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-primary) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
    animation: grid-drift 60s linear infinite;
}

.auth-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
    animation: glow-pulse 8s ease-in-out infinite;
}

@keyframes grid-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

/* Container principal */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Carte de connexion */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    animation: rotating-shadow 3s linear infinite;
}

@keyframes rotating-shadow {
    0% {
        box-shadow: 0 -8px 20px -4px rgba(139, 92, 246, 0.4), var(--shadow-lg);
    }
    25% {
        box-shadow: 8px 0 20px -4px rgba(139, 92, 246, 0.4), var(--shadow-lg);
    }
    50% {
        box-shadow: 0 8px 20px -4px rgba(139, 92, 246, 0.4), var(--shadow-lg);
    }
    75% {
        box-shadow: -8px 0 20px -4px rgba(139, 92, 246, 0.4), var(--shadow-lg);
    }
    100% {
        box-shadow: 0 -8px 20px -4px rgba(139, 92, 246, 0.4), var(--shadow-lg);
    }
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.brand-icon {
    color: var(--accent-violet);
    width: 28px;
    height: 28px;
    animation: icon-glow 3s ease-in-out infinite;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

@keyframes icon-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3)); }
    50% { filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.6)); }
}

.auth-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    animation: text-fade-in 0.8s ease-out 0.2s both;
}

.auth-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: text-fade-in 0.8s ease-out 0.4s both;
}

@keyframes text-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Formulaire */
.auth-form {
    margin-bottom: 2rem;
}

.form-field {
    margin-bottom: 1.5rem;
    animation: field-slide-in 0.6s ease-out both;
}

.form-field:nth-child(1) { animation-delay: 0.6s; }
.form-field:nth-child(2) { animation-delay: 0.8s; }

@keyframes field-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.field-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

.field-input {
    position: relative;
    transition: all 0.3s ease;
}

.field-input.focused {
    transform: translateY(-1px);
}

.field-input.focused .input-icon {
    color: var(--accent-violet);
    transform: scale(1.1);
}

.field-input.typing .input-control {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-control:focus {
    outline: none;
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-secondary);
}

.input-control::placeholder {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-control:focus::placeholder {
    color: var(--text-subtle);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    z-index: 1;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    padding: 0;
}

.password-toggle:hover {
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

/* Bouton de soumission */
.auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: button-slide-in 0.6s ease-out 1s both;
}

.auth-submit::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: left 0.5s ease;
}

.auth-submit:hover::before {
    left: 100%;
}

.auth-submit:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit.loading {
    background: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

.auth-submit.loading .submit-icon {
    animation: spin 1s linear infinite;
}

@keyframes button-slide-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.submit-text {
    transition: all 0.3s ease;
}

.submit-icon {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

/* Messages d'erreur */
.auth-error {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: var(--radius-sm);
    animation: error-shake 0.5s ease-in-out;
}

/* Messages de succès */
.auth-success {
    color: var(--accent-green);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    animation: success-pulse 0.6s ease-in-out;
}

@keyframes success-pulse {
    0% { 
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Footer */
.auth-footer {
    text-align: center;
    animation: footer-fade-in 0.8s ease-out 1.2s both;
}

.auth-terms {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-link:hover {
    color: var(--accent-violet);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-violet);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

.link-separator {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.back-home:hover {
    color: var(--text-primary);
    transform: translateX(-3px);
}

.back-home i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.back-home:hover i {
    transform: translateX(-2px);
}

@keyframes footer-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animation de chargement de page */
body {
    opacity: 0;
    animation: page-load 0.8s ease-out forwards;
}

body.loaded {
    opacity: 1;
}

@keyframes page-load {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Notification System */
.notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: #1a1a1a !important;
    border: 2px solid #333 !important;
    border-radius: 0.5rem !important;
    padding: 1rem 1.5rem !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transform: translateX(0) !important;
    transition: transform 0.3s ease !important;
    z-index: 99999 !important;
    max-width: 400px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    font-size: 0.9rem !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.notification.show {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

.notification-success {
    border-color: #10b981 !important;
}

.notification-error {
    border-color: #ef4444 !important;
}

.notification-info {
    border-color: #3b82f6 !important;
}

.notification i {
    font-size: 1.1rem !important;
    min-width: 16px !important;
    text-align: center !important;
}

.notification-success i {
    color: #10b981 !important;
}

.notification-error i {
    color: #ef4444 !important;
}

.notification-info i {
    color: #3b82f6 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        max-width: 100%;
        padding: 2rem;
    }
    
    .auth-title h1 {
        font-size: 1.75rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .link-separator {
        display: none;
    }
}
