/* ===== DDMI LOGIN STYLES - CREG CENTER ===== */
/* Conception : Soft Solutions SARL - 2025 */

.login-body {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #0066cc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="300" r="100" fill="url(%23a)"/><circle cx="800" cy="200" r="150" fill="url(%23a)"/><circle cx="700" cy="700" r="120" fill="url(%23a)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg); 
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(30, 60, 114, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.25),
        0 15px 40px rgba(30, 60, 114, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #1e3c72, #2a5298, #0066cc, #1e3c72);
    border-radius: 22px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { 
        opacity: 0.7; 
    }
    50% { 
        opacity: 1; 
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(135deg, #0066cc, #1e3c72);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 102, 204, 0.6);
}

.login-title {
    color: #1e3c72;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1e3c72, #0066cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.form-label i {
    margin-right: 8px;
    color: #0066cc;
}

.form-control {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    background: white;
    border-color: #0066cc;
    box-shadow: 
        0 0 0 0.2rem rgba(0, 102, 204, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.form-check {
    margin: 20px 0;
}

.form-check-input:checked {
    background-color: #0066cc;
    border-color: #0066cc;
}

.form-check-label {
    color: #495057;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #1e3c72 50%, #2a5298 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #0052a3 0%, #163354 50%, #1f3e75 100%);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #0066cc;
    transition: all 0.3s ease;
}

.forgot-password a:hover::after {
    width: 100%;
    left: 0;
}

.forgot-password a:hover {
    color: #1e3c72;
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.login-footer strong {
    color: white;
}

/* Animations d'erreur */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
    animation: slideInDown 0.5s ease;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading spinner */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Input focus glow effect */
.form-control:focus {
    position: relative;
}

.form-control:focus::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0066cc, #1e3c72);
    border-radius: 14px;
    z-index: -1;
    animation: inputGlow 2s ease-in-out infinite;
}

@keyframes inputGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        max-width: 95%;
        padding: 10px;
    }
    
    .login-card {
        padding: 30px 25px;
        border-radius: 15px;
    }
    
    .login-title {
        font-size: 1.8rem;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 12px 25px;
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 320px) {
    .login-card {
        padding: 25px 20px;
    }
    
    .login-title {
        font-size: 1.6rem;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-card {
        border: 3px solid #000;
        background: #fff;
    }
    
    .form-control {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .login-body::before {
        animation: none;
    }
    
    .login-card::before {
        animation: none;
    }
}