:root { --primary: #4f46e5; --system-bg: #fef3c7; --system-text: #92400e; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #f3f4f6; height: 100vh; display: flex; justify-content: center; align-items: center; }
.hidden { display: none !important; }

/* Auth Card */
.auth-card { background: white; padding: 2rem; border-radius: 1rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); width: 350px; }
input { width: 100%; padding: 0.75rem; margin: 0.5rem 0; border: 1px solid #d1d5db; border-radius: 0.5rem; }
.btn { width: 100%; padding: 0.75rem; border: none; border-radius: 0.5rem; color: white; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--primary); }
.btn-success { background: #10b981; }
.link-text { color: var(--primary); font-size: 0.875rem; cursor: pointer; margin-top: 1rem; text-align: center; }

/* Chat Container */
#chat-container { width: 100%; max-width: 500px; height: 90vh; background: white; border-radius: 1rem; display: flex; flex-direction: column; overflow: hidden; }
header { padding: 1rem; background: var(--primary); color: white; display: flex; justify-content: space-between; align-items: center; }
.status-dot { font-size: 0.75rem; color: #34d399; margin-left: 0.5rem; }

#chat-box { flex: 1; overflow-y: auto; padding: 1rem; background: #f8fafc; display: flex; flex-direction: column; gap: 0.75rem; }

/* Tin nhắn */
.msg { max-width: 80%; padding: 0.75rem; border-radius: 0.75rem; font-size: 0.9rem; position: relative; }
.mine { align-self: flex-end; background: var(--primary); color: white; }
.others { align-self: flex-start; background: #e5e7eb; color: #1f2937; }
.user-tag { font-size: 0.7rem; font-weight: bold; margin-bottom: 0.25rem; opacity: 0.8; }

/* GLOBAL / SYSTEM MESSAGES */
.global-msg { 
    align-self: center; background: var(--system-bg); color: var(--system-text); 
    font-size: 0.8rem; padding: 0.4rem 1rem; border-radius: 2rem; font-weight: 600;
    border: 1px solid #fde68a; margin: 0.5rem 0;
}

/* BOT MESSAGES */
.bot-msg { align-self: flex-start; background: #ddd6fe; color: #5b21b6; border: 1px solid #c4b5fd; }

footer { padding: 1rem; border-top: 1px solid #e5e7eb; }
#chat-form { display: flex; gap: 0.5rem; }
#msg-input { flex: 1; border-radius: 9999px; }
#send-btn { background: var(--primary); color: white; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; }