* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }

/* Login/Cadastro */
.auth-page {
    background: linear-gradient(135deg, #4a90d9, #7bb8e8);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-box {
    background: #fff; padding: 30px; border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%; max-width: 360px;
}
.auth-box h1 { color: #2b6cb0; font-size: 22px; margin-bottom: 5px; text-align: center; }
.auth-box h2 { color: #555; font-size: 16px; font-weight: normal; margin-bottom: 20px; text-align: center; }
.auth-box input {
    width: 100%; padding: 12px; margin-bottom: 10px;
    border: 1px solid #ccc; border-radius: 4px; font-size: 15px;
}
.auth-box button {
    width: 100%; padding: 12px; background: #2b6cb0; color: #fff;
    border: none; border-radius: 4px; font-size: 15px; cursor: pointer;
}
.auth-box button:hover { background: #1e4e85; }
.auth-box a { display: block; margin-top: 12px; color: #2b6cb0; font-size: 14px; text-align: center; text-decoration: none; }
.msg { color: #c00; font-size: 13px; min-height: 18px; margin-top: 6px; text-align: center; }
 
/* ===== Janela principal do MSN ===== */
.msn-app {
    background: #d9e8f5;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}
.msn-window {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.msn-header { background: linear-gradient(180deg, #cfe4f7, #a7c9e8); padding: 12px; }
.user-info { display: flex; gap: 10px; align-items: center; }
.avatar {
    width: 48px; height: 48px; border-radius: 4px;
    object-fit: cover; border: 2px solid #fff; background: #eee;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: #eee; }
.user-info .name { font-weight: bold; color: #1a3a5c; font-size: 14px; }
#statusSelect {
    font-size: 12px; border: none; background: transparent;
    color: #1a3a5c; cursor: pointer; margin-top: 2px;
}
.personal-msg { margin-top: 8px; }
.personal-msg input {
    width: 100%; padding: 6px; border: 1px solid #a7c9e8;
    border-radius: 3px; font-size: 12px; background: #fff;
}
.msn-search { display: flex; padding: 8px; background: #eaf3fb; border-bottom: 1px solid #cfe4f7; }
.msn-search input { flex: 1; padding: 8px; border: 1px solid #a7c9e8; border-radius: 3px; font-size: 13px; }
.msn-search button {
    width: 34px; margin-left: 5px; background: #2b6cb0; color: #fff;
    border: none; border-radius: 3px; cursor: pointer; font-size: 18px;
}
.msn-body { flex: 1; overflow-y: auto; background: #fff; }
.contacts-header {
    padding: 8px 12px; background: #eaf3fb; font-size: 12px;
    color: #2b6cb0; font-weight: bold; border-bottom: 1px solid #cfe4f7;
}
.contacts-list { list-style: none; }
.contacts-list li {
    display: flex; gap: 10px; align-items: center; padding: 10px 12px;
    cursor: pointer; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.contacts-list li:hover { background: #eaf3fb; }
.status-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.status-online    { background: #4caf50; }
.status-away      { background: #ffc107; }
.status-busy      { background: #f44336; }
.status-offline   { background: #aaa; }
.status-invisible { background: #aaa; }
.msn-footer {
    display: flex; justify-content: space-around; padding: 10px;
    background: #eaf3fb; border-top: 1px solid #cfe4f7; font-size: 12px;
}
.msn-footer a { color: #2b6cb0; text-decoration: none; }

/* ===== Janela de chat ===== */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #d9e8f5;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.chat-header {
    flex-shrink: 0;
    background: linear-gradient(180deg, #cfe4f7, #a7c9e8);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #1a3a5c;
    border-bottom: 1px solid #7ba7d9;
    z-index: 10;
}
.chat-header .back-btn {
    color: #1a3a5c;
    text-decoration: none;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
}
.chat-name { flex: 1; font-size: 15px; }

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.chat-emoticons {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 10px;
    background: #eaf3fb;
    border-top: 1px solid #cfe4f7;
}
.chat-emoticons span {
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.chat-emoticons span:hover { background: #cfe4f7; }

.chat-input {
    flex-shrink: 0;
    padding: 10px;
    background: #eaf3fb;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #cfe4f7;
}
.chat-input textarea {
    resize: none;
    height: 50px;
    padding: 10px;
    border: 1px solid #a7c9e8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.chat-input textarea:focus { border-color: #2b6cb0; }
.chat-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.chat-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    background: #2b6cb0;
    color: #fff;
    font-weight: 500;
}
.chat-buttons button:hover { background: #1e4e85; }
#nudgeBtn { background: #e67e22; }
#nudgeBtn:hover { background: #c2670f; }

/* ===== Animação do tremer a tela ===== */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-8px, 0); }
    20%, 40%, 60%, 80% { transform: translate(8px, 0); }
}
.shake { animation: shake 0.6s ease-in-out; }

/* ===== Perfil e Pasta Pública ===== */
.auth-box label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    margin-top: 10px;
    font-weight: 500;
}
.auth-box hr { border: none; border-top: 1px solid #eee; }

/* ===== Telas grandes (desktop) ===== */
@media (min-width: 600px) {
    .msn-app {
        padding: 20px;
        align-items: center;
    }
    .msn-window {
        max-width: 400px;
        height: 90vh;
        max-height: 700px;
        border: 1px solid #7ba7d9;
        border-radius: 6px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }
}