/* Box-sizing global */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Variables de thème */
:root {
    --bg-color-dark: #121212;
    --bg-color-light: #F7F7F7;
    --text-color-dark: #E0E0E0;
    --text-color-light: #333333;
    --accent-color: #00BFFF;
    --accent-color-hover: #009ad6;
    --container-bg-dark: rgba(30, 30, 30, 0.9);
    --container-bg-light: rgba(255, 255, 255, 0.95);
    --border-radius: 12px;
    --transition-speed: 0.3s ease;
    --error-color: #ff6b6b;
}

/* Styles de base */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color-dark);
    color: var(--text-color-dark);
    transition: background var(--transition-speed), color var(--transition-speed);
    position: relative;
    font-size: 16px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
body.light {
    background: var(--bg-color-light);
    color: var(--text-color-light);
}

/* Conteneur central */
.center-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
    z-index: 2;
}

/* Bouton de basculement du thème */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    border: none;
    border-radius: var(--border-radius);
    color: #121212;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--transition-speed);
    font-size: 0.9rem;
}
#theme-toggle:hover {
    background: var(--accent-color-hover);
}

/* Canvas de fond animé */
#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at 50% 30%, #3949ab, #121212 80%);
    transition: background var(--transition-speed);
}
body.light #background-canvas {
    background: radial-gradient(circle at 50% 30%, #a6c8ff, #F7F7F7 80%);
}

/* Conteneur du formulaire de connexion */
.login-container {
    width: 100%;
    max-width: 360px;
    background: var(--container-bg-dark);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s forwards;
}
body.light .login-container {
    background: var(--container-bg-light);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: var(--accent-color);
}

/* Tagline rotative */
.tagline {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    min-height: 20px;
}

/* Champs de saisie */
.form-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: border var(--transition-speed), background var(--transition-speed), color var(--transition-speed);
}
.form-input:focus {
    border-color: var(--accent-color);
    outline: none;
}
body.light .form-input {
    background: #FFF;
    color: var(--text-color-light);
    border: 1px solid #CCC;
}

/* Boutons */
.btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--transition-speed);
    margin-bottom: 10px;
    color: #121212;
}
.btn:hover {
    background: var(--accent-color-hover);
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-bottom: 10px;
    display: none;
}