/* Variables CSS pour la page de connexion - YesReCan TRC */
:root {
    --primary-gradient: linear-gradient(135deg, #4f9cf9 0%, #2563eb 100%);
    --secondary-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --success-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --danger-gradient: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --text-light: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --shadow-glow: 0 0 40px rgba(79, 156, 249, 0.3);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-light);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(79, 156, 249, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
    animation: floating 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    animation: slideDown 0.8s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Space Grotesk', sans-serif;
}

.navbar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lang-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Main Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

/* Login Card */
.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 4rem;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Title */
.login-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 3rem;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(240, 147, 251, 0.8)); }
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-input {
    padding: 1.25rem 1.5rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-light);
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #4f9cf9;
    box-shadow: 0 0 0 4px rgba(79, 156, 249, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

/* Password input with icon */
.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--text-light);
}

/* Login Button */
.login-button {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    margin-top: 1rem;
}

.login-button::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;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 156, 249, 0.4);
}

.login-button:active {
    transform: translateY(-1px);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 6rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.flash {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border-left: 4px solid;
    backdrop-filter: blur(20px);
    animation: slideInRight 0.5s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash.success {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border-left-color: #34d399;
}

.flash.error, .flash.danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-left-color: #f87171;
}

.flash.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-left-color: #fbbf24;
}

.flash.info {
    background: rgba(79, 156, 249, 0.1);
    color: #4f9cf9;
    border-left-color: #4f9cf9;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    opacity: 0.1;
}

.floating-element:nth-child(1) {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 120px;
    height: 120px;
    background: var(--secondary-gradient);
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(15px) rotate(240deg); }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-card {
        max-width: 450px;
        padding: 3.5rem;
    }

    .login-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    .navbar-brand {
        display: none;
    }

    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2.5rem 2rem;
        margin: 5rem auto 1rem;
        border-radius: 24px;
        max-width: 100%;
    }

    .login-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .form-input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .form-label {
        font-size: 1rem;
    }

    .login-button {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
    }

    .flash-messages {
        top: 5rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .floating-element:nth-child(1) {
        width: 60px;
        height: 60px;
        top: 10%;
        left: 5%;
    }

    .floating-element:nth-child(2) {
        width: 80px;
        height: 80px;
        top: 70%;
        right: 5%;
    }

    .floating-element:nth-child(3) {
        width: 40px;
        height: 40px;
        bottom: 15%;
        left: 10%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 4rem auto 1rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .form-input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .login-button {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .navbar {
        padding: 0.8rem 1rem;
    }

    .navbar-actions {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .lang-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .flash-messages {
        top: 4rem;
        right: 0.5rem;
        left: 0.5rem;
    }

    .flash {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .floating-element {
        opacity: 0.05;
    }
}

@media (max-width: 320px) {
    .login-card {
        padding: 1.5rem 1rem;
        margin: 3rem auto 1rem;
    }

    .login-title {
        font-size: 1.6rem;
    }

    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .login-button {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

/* Micro-interactions */
.form-group {
    animation: fadeInUp 0.6s ease;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accessibilité et high contrast */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.2);
        --glass-border: rgba(255, 255, 255, 0.4);
    }
    
    .login-card, .flash {
        border-width: 2px;
    }
}
