* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: #eef1f5;
    color: #222;
}

.conteneur {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 16px;
}

h1 {
    text-align: center;
    color: #2c3e50;
}

.carte {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.carte h2 {
    margin-top: 0;
    font-size: 18px;
    color: #34495e;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
}

.champ {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 15px;
}

.champ:focus {
    outline: none;
    border-color: #4a90e2;
}

.bouton {
    margin-top: 10px;
    padding: 10px 18px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.bouton:hover {
    background: #3a7bc8;
}

.bouton-petit {
    padding: 6px 12px;
    font-size: 13px;
}

.erreur {
    display: block;
    color: #d9534f;
    margin-top: 8px;
    font-size: 14px;
}

.liste-salons {
    list-style: none;
    margin: 0;
    padding: 0;
}

.liste-salons li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.liste-salons li:last-child {
    border-bottom: none;
}

.nom-salon {
    font-weight: 600;
    color: #2c3e50;
}

/* Page de chat */

.conteneur-chat {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.entete-salon {
    text-align: center;
    margin-bottom: 12px;
}

.info-utilisateur {
    color: #666;
    font-size: 14px;
}

.info-utilisateur a {
    color: #4a90e2;
}

.zone-messages {
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.erreur-envoi {
    background: #fdecea;
    color: #a94442;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 14px;
}

.message {
    max-width: 75%;
    background: #eef1f5;
    padding: 8px 12px;
    border-radius: 10px;
    align-self: flex-start;
}

.message-moi {
    align-self: flex-end;
    background: #d7e9ff;
}

.message-entete {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.message-auteur {
    font-weight: 700;
    color: #2c3e50;
}

.message-texte {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
}

.zone-saisie {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.zone-saisie .champ {
    flex: 1;
}

.zone-saisie .bouton {
    margin-top: 0;
}

.conteneur-emoji {
    position: relative;
}

.bouton-emoji {
    height: 100%;
    padding: 0 12px;
    font-size: 20px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

.bouton-emoji:hover {
    background: #eef1f5;
}

.panneau-emoji {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
    width: 280px;
}

.panneau-emoji button {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
}

.panneau-emoji button:hover {
    background: #eef1f5;
}
