/* Variables CSS pour une cohérence dans le design */
:root {
    --x-blue: #1d9bf0;
    --x-blue-hover: #1a8cd8;
    --x-black: #000;
    --x-white: #fff;
    --x-gray: #71767b;
    --x-border: #333;
    --x-transition: all 0.2s ease;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--x-black);
    color: var(--x-white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

/* Container principal */
.container {
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

/* Logo X */
.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo svg {
    width: 32px;
    height: 32px;
    fill: var(--x-white);
    transition: var(--x-transition);
}

.logo:hover svg {
    fill: var(--x-blue);
}

/* Titre principal */
.title {
    font-size: 31px;
    font-weight: bold;
    margin-bottom: 32px;
    text-align: left;
    color: var(--x-white);
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 20px;
}

/* Conteneur d'input avec focus */
.input-container {
    position: relative;
}

.input-container.focused::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--x-blue);
    transform: scaleX(1);
    transition: transform 0.2s ease;
}

/* Champs de saisie */
.input-field {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--x-border);
    border-radius: 4px;
    background-color: var(--x-black);
    color: var(--x-white);
    font-size: 17px;
    transition: var(--x-transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--x-blue);
    box-shadow: 0 0 0 1px var(--x-blue);
}

.input-field::placeholder {
    color: var(--x-gray);
}

/* Enhanced input focus states */
.input-container.focused .input-field {
    border-color: var(--x-blue);
    box-shadow: 0 0 0 1px var(--x-blue);
}

.input-container.error .input-field {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 1px #ff6b6b;
}

/* Boutons génériques */
.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 9999px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--x-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Bouton principal */
.btn-primary {
    background-color: var(--x-blue);
    color: var(--x-white);
    margin-bottom: 20px;
}

.btn-primary:hover {
    background-color: var(--x-blue-hover);
    transform: translateY(-1px);
}

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

/* Bouton secondaire */
.btn-secondary {
    background-color: transparent;
    color: var(--x-white);
    border: 1px solid var(--x-border);
    margin-bottom: 12px;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--x-gray);
}

/* Boutons sociaux */
.social-btn svg {
    width: 18px;
    height: 18px;
}

/* Séparateur */
.divider {
    text-align: center;
    margin: 20px 0;
    color: var(--x-gray);
    position: relative;
    font-size: 15px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--x-border);
}

.divider span {
    background-color: var(--x-black);
    padding: 0 20px;
    position: relative;
}

/* Liens */
.forgot-password {
    text-align: center;
    margin: 20px 0;
}

.forgot-password a {
    color: var(--x-blue);
    text-decoration: none;
    font-size: 15px;
    transition: var(--x-transition);
}

.forgot-password a:hover {
    text-decoration: underline;
    color: var(--x-blue-hover);
}

/* Lien d'inscription */
.signup-link {
    text-align: center;
    margin-top: 40px;
    color: var(--x-gray);
    font-size: 15px;
}

.signup-link a {
    color: var(--x-blue);
    text-decoration: none;
    transition: var(--x-transition);
}

.signup-link a:hover {
    text-decoration: underline;
    color: var(--x-blue-hover);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container > * {
    animation: fadeIn 0.6s ease forwards;
}

.container > *:nth-child(2) { animation-delay: 0.1s; }
.container > *:nth-child(3) { animation-delay: 0.2s; }
.container > *:nth-child(4) { animation-delay: 0.3s; }

/* Animation classes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        max-width: 90%;
    }
    
    .title {
        font-size: 28px;
        text-align: center;
    }
    
    .input-field {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

@media (max-width: 320px) {
    .title {
        font-size: 24px;
    }
    
    .btn {
        font-size: 15px;
        padding: 10px 20px;
    }
}

/* États de chargement */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Messages d'erreur */
.error-message {
    background-color: #1c1c1c;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ff6b6b;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.input-container.error .input-field {
    border-color: #f4212e;
}

.input-container.error .error-message {
    display: block;
}

/* Success message styles */
.success-message {
    background-color: #1c1c1c;
    color: #00d4aa;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #00d4aa;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

/* Focus visible pour l'accessibilité */
.btn:focus-visible,
.input-field:focus-visible {
    outline: 2px solid var(--x-blue);
    outline-offset: 2px;
}

/* Dark mode support (déjà en dark par défaut) */
@media (prefers-color-scheme: light) {
    /* Si nécessaire, vous pouvez ajouter des styles pour le mode clair */
}

/* Accessibility improvements */
.input-field:focus-visible {
    outline: 2px solid var(--x-blue);
    outline-offset: 2px;
}

/* Dark mode support */
.dark-mode {
    background-color: var(--x-black);
    color: var(--x-white);
}

/* Better hover states for social buttons */
.social-btn:hover {
    background-color: rgba(29, 155, 240, 0.05);
    transform: translateY(-1px);
}

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