/* Variables CSS pour cohérence */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-light: #ffffff;
    --text-dark: #2d3748;
    --bg-glass: rgba(0, 0, 0, 0.7);
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.15);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Gestion de l'image de fond splash */
body.body_splash {
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.2) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
    z-index: -1;
}

body.body_splash::before {
    display: none;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.main-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    color: var(--text-light);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 30px 0;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-body {
    margin-bottom: 20px;
}

.form-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: var(--text-light);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
}

.form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: none;
    border-radius: 0 12px 12px 0;
    color: var(--text-light);
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    flex: 1;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.input-group-text:focus-within,
.form-control:focus + .input-group-text {
    border-color: var(--accent-color);
}

.btn-modern {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border: none;
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 14px 30px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.btn-modern::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;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.card-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.card-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.card-footer a:hover {
    color: var(--accent-color);
}

/* Animation d'apparition */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les messages d'erreur/succès */
.msgbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.msgbox-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.msgbox-card h3 {
    color: var(--text-light);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.msgbox-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.msgbox-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.msgbox-icon.success {
    color: #4ade80;
}

.msgbox-icon.warning {
    color: #fbbf24;
}

.msgbox-icon.error {
    color: #f87171;
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-section img {
    max-height: 80px;
    max-width: 200px;
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.login-title {
    color: var(--text-light);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 400;
}

.version-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
    font-style: italic;
}

.form-group {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.form-input {
    width: 100%;
    max-width: 320px;
    padding: 16px 20px 16px 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 1;
}

.form-input:focus + .input-icon {
    color: var(--text-light);
    transform: translateY(-50%) scale(1.1);
}

.button-group {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.login-button {
    width: 100%;
    max-width: 320px;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border: none;
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.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(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.forgot-password {
    text-align: center;
    margin-top: 24px;
}

.forgot-password a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.forgot-password a:hover {
    color: var(--text-light);
}

.forgot-password a:hover::after {
    width: 100%;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card,
    .msgbox-card {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 20px;
    }
    
    .card-header {
        font-size: 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .form-input {
        padding: 14px 18px 14px 45px;
        max-width: 100%;
    }
    
    .login-button {
        max-width: 100%;
    }
    
    .error-card {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 20px;
    }
    
    .error-title {
        font-size: 20px;
    }
    
    .error-icon {
        font-size: 36px;
    }
}

/* Animation de chargement */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.error-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.error-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.error-title {
    color: var(--text-light);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.error-icon {
    color: #ff6b6b;
    font-size: 48px;
    margin-bottom: 20px;
}

.error-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.error-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border: none;
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 12px 30px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.error-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;
}

.error-button:hover::before {
    left: 100%;
}

.error-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.error-button:active {
    transform: translateY(0);
}