/* Variables pour le thème clair (défaut) */
:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #4cc9f0;
    --text-color: #2b2d42;
    --light-text: #6c757d;
    --background: #e7eaf4;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --icon-color: #6c757d;
    --icon-hover: #4361ee;
    --error-color: #ef476f;
    --success-color: #06d6a0;
}

/* Variables pour le thème sombre */
body.dark-theme {
    --primary-color: #4cc9f0;
    --primary-hover: #3db8df;
    --secondary-color: #4361ee;
    --text-color: #e9ecef;
    --light-text: #adb5bd;
    --background: #121212;
    --card-bg: #1e1e1e;
    --input-bg: #2C3034;
    --input-border: #333333;
    --error-color: #ff5c8d;
    --success-color: #06d6a0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --icon-color: #adb5bd;
    --icon-hover: #4cc9f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: white;
    z-index: 1000;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.top-bar .language-selector {
    margin: 0;
    text-align: left;
}

.top-bar .theme-toggle {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.login-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 90%;
    padding: 30px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.logo {
    max-width: 60px;
    height: auto;
    margin-bottom: 15px;
}

body.dark-theme .logo {
    filter: brightness(0) invert(1);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 15px;
}

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

.user-icon, .lock-icon, .login-icon, .error-icon {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: inline-block;
}

.user-icon, .lock-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
}

.user-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

.lock-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
}

.login-icon {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'%3E%3C/path%3E%3Cpolyline points='10 17 15 12 10 7'%3E%3C/polyline%3E%3Cline x1='15' y1='12' x2='3' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.error-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef476f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}

.input-with-icon input {
    padding-left: 40px;
}

input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    transition: var(--transition);
    color: var(--text-color);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

.error-message {
    color: var(--error-color);
    margin-top: 20px;
    text-align: center;
    display: none;
    font-size: 14px;
    padding: 10px;
    border-radius: 6px;
    background-color: rgba(239, 71, 111, 0.08);
    border-left: 3px solid var(--error-color);
}

/* Language button styles */
.language-button {
    display: flex;
    align-items: center;
    background-color: transparent;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
}

.flag-icon {
    width: 24px;
    height: 16px;
    margin-right: 8px;
    background-size: cover;
    background-position: center;
}

.flag-icon.fr {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='20' height='30' fill='%23002654'/%3E%3Crect x='20' width='20' height='30' fill='%23fff'/%3E%3Crect x='40' width='20' height='30' fill='%23ED2939'/%3E%3C/svg%3E");
}

.flag-icon.en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='gb-login'%3E%3Cpath d='M0,0 v30 h60 v-30 z'/%3E%3C/clipPath%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23gb-login)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}

.language-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

/* Theme toggle styles */
.theme-switch {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.theme-label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: #e9e9e9;
    border-radius: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-label:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 3px;
    left: 4px;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f1c40f' stroke='none'%3E%3Ccircle cx='12' cy='12' r='5'%3E%3C/circle%3E%3Cline x1='12' y1='1' x2='12' y2='3' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='12' y1='21' x2='12' y2='23' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='1' y1='12' x2='3' y2='12' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='21' y1='12' x2='23' y2='12' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22' stroke='%23f1c40f' stroke-width='2'%3E%3C/line%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.theme-switch:checked + .theme-label {
    background-color: #4c64ff;
}

.theme-switch:checked + .theme-label:before {
    transform: translateX(18px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 14px;
}

/* Dark theme adjustments */
body.dark-theme .top-bar {
    background-color: rgba(30, 30, 30, 0.9);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

body.dark-theme input {
    background-color: var(--input-bg);
}

body.dark-theme .language-button {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-color);
}

body.dark-theme .user-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23adb5bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

body.dark-theme .lock-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23adb5bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 0;
    background-color: var(--card-bg);
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
}

.copyright {
    font-size: 12px;
    color: var(--light-text);
    margin: 0;
}

/* Change password modal styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-content {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-content .btn {
    margin-right: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

body.dark-theme .btn-secondary {
    background-color: #444;
    color: #e0e0e0;
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        width: 90%;
        padding: 20px;
    }

    input, button {
        padding: 10px;
    }

    .footer {
        padding: 8px 0;
    }

    .copyright {
        font-size: 11px;
    }
}

@media (max-height: 600px) {
    .login-container {
        padding: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .header {
        margin-bottom: 15px;
    }
}