/* Open Copro Login CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Login wrapper - two columns layout */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left section with image/background */
.login-left {
    position: relative;
    flex: 1;
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.5) 100%), url('../img/deco-2.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Override pour charger l'image HD dynamiquement tout en gardant le dégradé */
.login-left.loaded {
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.5) 100%), url('../img/deco-2-hd.jpg');
}

.login-left-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    padding: 2rem;
}

.login-left-content .logo-large {
    width: 150px;
    height: auto;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
    opacity: 0.1;
}

.login-left-content h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-left-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* Right section with login form */
.login-right {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.login-card {
    position: relative;
    background: white;
    padding: 3rem 2rem;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.login-header h1 .logo {
    width: 60px;
    height: auto;
}

.login-header h1 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 1.1rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #999;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-wrapper input:focus + i,
.input-wrapper input:not(:placeholder-shown) + i {
    color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.login-footer {
    text-align: center;
}

.login-footer p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #764ba2;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.cube {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    animation: float 6s ease-in-out infinite;
}

.cube-1 {
    width: 60px;
    height: 60px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.cube-2 {
    width: 80px;
    height: 80px;
    top: 70%;
    right: 10%;
    animation-delay: 1s;
}

.cube-3 {
    width: 40px;
    height: 40px;
    top: 30%;
    right: 20%;
    animation-delay: 2s;
}

.cube-4 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 15%;
    animation-delay: 3s;
}

.cube-5 {
    width: 50px;
    height: 50px;
    top: 50%;
    left: 80%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .cube {
        display: block;
    }

}

/* Loading state */
.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error state for inputs */
.input-wrapper.error input {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.input-wrapper.error i {
    color: #dc3545;
}

/* Two-step login styles */
.step-indicator {
    text-align: center;
    margin-bottom: 1.5rem;
}

.step-number {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    position: relative;
}

.user-info i.fa-user-circle {
    font-size: 1.5rem;
    color: #667eea;
}

.user-info span {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.user-info .change-user {
    position: absolute;
    right: 1rem;
    color: #999;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-info .change-user:hover {
    color: #667eea;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-back {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-back:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

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

.form-actions .btn-login {
    flex: 1;
}

/* Step transitions */
#step1, #step2 {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Forgot password link in step 2 */
#step2 .login-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

/* Responsive for two-step login */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    .user-info {
        font-size: 0.9rem;
    }
    .btn-back {
        display: none;
    }
}