* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #FFF9E6; /* Цвет мякоти банана */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4A2311; /* Темно-коричневый текст */
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
}

.hidden {
    display: none !important;
}

/* Авторизация */
.auth-box {
    margin: auto;
    background: #FFE135; /* Ярко-желтый банановый */
    padding: 40px;
    border-radius: 30px; /* Скругленные "банановые" углы */
    box-shadow: 0 10px 30px rgba(200, 150, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 380px;
    text-align: center;
    border: 4px solid #F4C430;
}

.auth-box h1 { font-size: 28px; margin-bottom: 5px; }
.subtitle { font-size: 15px; color: #6B3E1B; margin-bottom: 10px; font-weight: bold; }

.auth-box input, .search-bar input, .message-input input {
    padding: 14px;
    border: 2px solid #F4C430;
    border-radius: 20px;
    outline: none;
    font-size: 15px;
    background: #FFF;
    transition: 0.2s;
}

.auth-box input:focus, .message-input input:focus { border-color: #D4A017; box-shadow: 0 0 8px rgba(244, 196, 48, 0.5); }

button {
    padding: 14px;
    background: #4A2311;
    color: #FFE135;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: 0.2s;
}

button:hover { background: #30160A; transform: scale(1.02); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
button.secondary { background: #FFF9E6; color: #4A2311; border: 2px solid #4A2311; }
button.secondary:hover { background: #FDE8A5; }

.auth-status {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: bold;
    text-align: left;
}
.auth-status.error { background: #FFD9D9; color: #A12E2E; border: 2px solid #E08A8A; }
.auth-status.success { background: #DFF5D8; color: #2E6B2E; border: 2px solid #9BD48A; }
.auth-status.info { background: #FFF3C4; color: #6B3E1B; border: 2px solid #F4C430; }

.password-wrapper { position: relative; display: flex; }
.password-wrapper input { flex: 1; padding-right: 44px; }
.toggle-pw {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    background: transparent;
    color: #4A2311;
    padding: 0 10px;
    font-size: 16px;
    box-shadow: none;
}
.toggle-pw:hover { background: #FDE8A5; transform: none; }

/* Левая панель (Сайдбар) */
.sidebar {
    width: 320px;
    background: #FFE135;
    border-right: 3px solid #F4C430;
    display: flex;
    flex-direction: column;
}

.user-profile {
    padding: 20px;
    background: #F4C430;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    border-bottom: 2px solid #D4A017;
}

.user-profile img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid #4A2311;
    background: #FDE8A5;
}

.logout-btn { padding: 6px 12px; font-size: 12px; margin-left: auto; border-radius: 12px; }

.search-bar { padding: 15px; display: flex; gap: 8px; }
.search-bar input { flex: 1; border-radius: 25px; }
.search-bar button { border-radius: 50%; width: 48px; padding: 0; font-size: 18px; }

.actions { padding: 0 15px 15px 15px; display: flex; flex-direction: column; gap: 8px; border-bottom: 2px solid #F4C430;}
.group-btn { width: 100%; font-size: 14px; padding: 10px; }

.chat-list { flex: 1; overflow-y: auto; }

.chat-item {
    padding: 18px 20px;
    border-bottom: 1px solid #F4C430;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-item:hover { background: #FDE8A5; padding-left: 25px; }
.chat-item.active { background: #FDE8A5; border-left: 5px solid #4A2311; padding-left: 15px; }
.add-friend-btn { padding: 6px 12px; font-size: 12px; }

/* Правая панель (Окно чата) */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFF9E6;
}

.chat-header {
    padding: 20px;
    background: white;
    border-bottom: 3px solid #F4C430;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 65%;
    padding: 12px 18px;
    border-radius: 25px;
    background: white;
    align-self: flex-start;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border: 2px solid #FDE8A5;
    font-size: 15px;
}
.message.mine {
    background: #FFE135;
    color: #4A2311;
    align-self: flex-end;
    border: 2px solid #F4C430;
    border-bottom-right-radius: 5px;
}

.message:not(.mine) { border-bottom-left-radius: 5px; }
.message-sender { font-size: 12px; color: #D4A017; font-weight: bold; margin-bottom: 4px; }
.message.mine .message-sender { display: none; }
.message-time { font-size: 10px; color: #B08D57; margin-top: 4px; text-align: right; opacity: 0.8; }

.message-input {
    padding: 20px;
    background: white;
    border-top: 3px solid #F4C430;
    display: flex;
    gap: 10px;
}
.message-input input { flex: 1; border-radius: 25px; }