/* Configuration de base & Couleurs */
:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --error: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Supprime le flash bleu au clic sur mobile */
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Container adaptable */
.container {
    width: 100%;
    max-width: 400px; /* Taille idéale pour un formulaire de connexion */
    margin: 0 auto;
}

/* Carte moderne */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

h2 {
    margin-top: 0;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Formulaire & Inputs */
form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacement entre les champs */
}

input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    padding: 14px; /* Plus large pour faciliter la saisie au doigt */
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #1e293b;
}

/* Boutons */
button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    margin-top: 10px;
}

button:active {
    transform: scale(0.98); /* Effet d'appui */
}

button:hover {
    background: var(--primary-hover);
}

/* Messages de statut */
.error, .success {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
}

.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Optimisation spécifique mobile */
@media (max-width: 480px) {
    body {
        padding: 15px;
        align-items: flex-start; /* Évite que le clavier cache le bouton sur petits écrans */
        padding-top: 10vh;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 12px;
    }
}