h2 {
    text-align: center;
}

footer {
    background: #f1f3f5;
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}
main {
    max-width: 700px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

    body {
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            background: #f9f9f9;
            color: #333;
        }
        header {
            background: #ffffff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 999;
        }
        .logo {
            font-weight: bold;
            font-size: 24px;
            color: #154944;
                text-decoration: none;
        }
    
        nav ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            gap: 20px;
        }
        nav ul li a {
            text-decoration: none;
            color: #333;
            font-weight: 500;
            transition: color 0.3s;
        }
        nav ul li a:hover {
            color: #0073aa;
        }
        .mobile-menu {
            display: none;
            flex-direction: column;
            cursor: pointer;
        }
        .mobile-menu div {
            width: 25px;
            height: 3px;
            background: #333;
            margin: 4px 0;
        }
        @media (max-width: 768px) {
            nav ul {
                display: none;
                flex-direction: column;
                background: #fff;
                position: absolute;
                top: 60px;
                right: 30px;
                box-shadow: 0 4px 10px rgba(0,0,0,0.1);
                border-radius: 10px;
                padding: 15px;
            }
            nav ul.active {
                display: flex;
            }
            .mobile-menu {
                display: flex;
            }
        }
        
.chat-title {
    text-align: center;
    font-size: 28px;
    color: #000000;
    font-weight: 600;
    line-height: 1.2;
    max-width: 450px;
    padding: 0 20px;
    margin: 30px auto 30px;
}
.input-box {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
#messageInput {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
}
#sendMessage {
    padding: 10px 20px;
    font-size: 16px;
    background: #154944;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
#sendMessage:hover {
    background: #0d322f;
}    
.chat-box {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.message {
    margin-bottom: 20px;
    padding: 14px 20px;
    border-radius: 12px;
    max-width: 80%;
    word-break: break-word;
    font-size: 16px;
    line-height: 1.5;
}

.message.user {
    background: #e0f7fa;
    align-self: flex-end;
    border: 1px solid #b2ebf2;
}

.message.ai {
    background: #f1f3f5;
    align-self: flex-start;
    border: 1px solid #dde1e4;
    margin-left: 10%;
}

.input-box {
    display: flex;
    padding: 20px;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

.input-box input:focus {
    border-color: #154944;
    outline: none;
}

.input-box button {
    background: #154944;
    color: #fff;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.input-box button:hover {
    background: #123b3a;
}


.auth-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    background: #fff;
}
.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
}
.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.auth-container input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.auth-container button {
    padding: 10px;
    font-size: 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.auth-container button:hover {
    background: #005a87;
}
.auth-container .error {
    color: red;
    text-align: center;
}
.auth-switcher {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}
.auth-switcher a {
    color: #0073aa;
    cursor: pointer;
    text-decoration: none;
}

@media (max-width:650px) {
    
    main {
    max-width: 700px;
    margin: 15px 15px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);}
    
    
.auth-container {
    max-width: 500px;
    margin: 50px 10px 50px;}
    
    .input-box {
    flex-direction: column;}
    
    .messages {
       padding: 0;
    }
    
    .chat-title {

    font-size: 19px;
    margin: 15px auto 30px;
}
    
}