/* === VARIABLES ET RESET === */
:root {
    --primary-color: #9d86ff;
    --primary-light: rgba(138, 111, 248, 0.1);
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --positive: #10b981;
    --negative: #ef4444;
    --input-bg: #f8f8f8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #9d86ff;
        --primary-light: rgba(157, 134, 255, 0.15);
        --bg-color: #151515;
        --card-bg: #1d1d1e;
        --text-color: #f0f0f0;
        --text-secondary: #b0b0b0;
        --border-color: rgba(255, 255, 255, 0.15);
        --hover-bg: rgba(255, 255, 255, 0.08);
        --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
        --input-bg: #1e1e1e;
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === CONTENEUR PRINCIPAL === */
.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

/* === CARTE DE CONNEXION === */
.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
}

/* === EN-TÊTE === */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.login-logo-icon {
    font-size: 3.14rem;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #7c6bd9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* === MESSAGE D'ERREUR === */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--negative);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.error-message::before {
    content: "⚠️";
    font-size: 1rem;
}

/* === FORMULAIRE === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* === BOUTON DE CONNEXION === */
.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #7c6bd9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 134, 255, 0.3);
}

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

/* === LIEN D'INSCRIPTION === */
.register-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.register-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

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

    .login-subtitle {
        font-size: 0.9rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}