/* ─────────── Login Page - Design Identique Dashboard 2026 ─────────── */

/* Body styles identiques au dashboard */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(77, 110, 180, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(89, 194, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(77, 110, 180, 0.1) 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--accent);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(77, 110, 180, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(89, 194, 219, 0.2) 0%, transparent 40%),
        linear-gradient(180deg, rgba(10, 10, 15, 0.8) 0%, rgba(10, 10, 15, 0.95) 100%);
    pointer-events: none;
    z-index: 0;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--card-bg);
    backdrop-filter: var(--blur-xl);
    -webkit-backdrop-filter: var(--blur-xl);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 48px 56px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-2xl), var(--glow-primary);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-box:hover {
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-2xl), var(--glow-primary), 0 0 40px rgba(77, 110, 180, 0.3);
    transform: translateY(-2px);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(77, 110, 180, 0.1) 0%, 
        transparent 30%,
        transparent 70%,
        rgba(89, 194, 219, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.6s;
    pointer-events: none;
}

.login-box:hover::before {
    opacity: 1;
}

.login-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary), 
        var(--secondary), 
        var(--primary), 
        transparent);
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.login-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-header h1 .icon {
    font-size: clamp(36px, 6vw, 60px);
    display: inline-block;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-header h1 .text {
    background: linear-gradient(135deg, #ffffff 0%, #59C2DB 50%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s ease-in-out infinite;
    font-size: clamp(24px, 4vw, 40px);
}

@keyframes textShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-header p {
    opacity: 0.85;
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    margin-top: 16px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 12px 40px rgba(77, 110, 180, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-logo-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 16px 50px rgba(77, 110, 180, 0.5);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    z-index: 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--accent);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(77, 110, 180, 0.2);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Boutons EXACTEMENT comme dashboard.css */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:hover::after {
    opacity: 1;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: var(--gradient-primary);
    background: linear-gradient(90deg, #4D6EB4 0%, #59C2DB 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(77, 110, 180, 0.4), var(--glow-secondary);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(89, 194, 219, 0.5), var(--glow-gradient);
    background: linear-gradient(90deg, #4D6EB4 0%, #59C2DB 100%);
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    font-size: 18px;
}

.alert {
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: alertSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
    position: relative;
    z-index: 2;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-icon {
    font-size: 20px;
}

.alert-message {
    font-size: 14px;
    font-weight: 500;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.login-help {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.8;
    font-weight: 400;
}

.login-help small {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: var(--blur-md);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin-top: 16px;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.login-help small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 640px) {
    .login-container {
        padding: 24px 16px;
    }
    
    .login-box {
        padding: 40px 32px;
        border-radius: 28px;
    }
    
    .login-header h1 {
        font-size: 32px;
    }
    
    .login-header p {
        font-size: 16px;
    }
    
    .login-logo-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }
    
    .form-group input {
        padding: 14px 18px;
    }
    
    .btn {
        padding: 14px 24px;
    }
    
    .login-footer {
        margin-top: 28px;
        padding-top: 28px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
        border-radius: 24px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .form-group {
        gap: 10px;
    }
    
    .form-group input {
        padding: 12px 16px;
    }
    
    .login-form {
        gap: 24px;
    }
}
