﻿body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f6fa;
    transition: background-color 0.3s, color 0.3s;
}

.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

    .login-container input {
        padding: 0.75rem 1rem;
        border: 1px solid #ccc;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.2s ease;
    }

        .login-container input:focus {
            outline: none;
            border-color: #003b5c;
            box-shadow: 0 0 0 2px rgba(0, 59, 92, 0.15);
        }

    .login-container button {
        background-color: #003b5c;
        color: white;
        font-weight: bold;
        border: none;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        .login-container button:hover {
            background-color: #002a42;
        }

.dark-mode .login-container {
    background-color: #2a2a2a;
}

    .dark-mode .login-container input {
        background-color: #1a1a1a;
        color: white;
        border-color: #555;
    }

        .dark-mode .login-container input:focus {
            border-color: #007bff;
            box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
        }

    .dark-mode .login-container button {
        background-color: #0056b3;
    }

.dark-mode a {
    color: #9999ff;
}

.dark-mode {
    background-color: #1f1f2f;
    color: #f0f0f0;
}

.top-logo {
    background-color: white;
    padding: 0.5rem 2rem;
}

    .top-logo img {
        height: 36px;
    }

.header {
    background-color: #003b5c;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 500;
}

.header-icons {
    display: flex;
    gap: 0.75rem;
}

    .header-icons button {
        background: white;
        border: none;
        border-radius: 8px;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .header-icons svg {
        width: 20px;
        height: 20px;
        stroke: #003b5c;
    }

.header-subbar {
    background-color: #00558c;
    color: white;
    padding: 0.5rem 2rem;
    font-size: 0.95rem;
}

.chat-container {
    flex: 1;
    max-width: 960px;
    margin: 1rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 80vh;
    overflow: hidden;
    transition: background 0.3s;
    width: 100%;
}

.dark-mode .chat-container {
    background: #2d2d3a;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    word-wrap: break-word; /* força quebra de palavra longa */
    overflow-wrap: break-word; /* alternativa moderna */
    box-sizing: border-box;
}

.sent {
    align-self: flex-end;
    background-color: #d0eaff;
    text-align: right;
}

.dark-mode .sent {
    background-color: #3b4a5a;
    color: #f0f0f0;
}

.received {
    align-self: flex-start;
    background-color: #f1f1f1;
}

.dark-mode .received {
    background-color: #44485c;
    color: #f0f0f0;
}

.timestamp {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.dark-mode .timestamp {
    color: #ccc;
}

.chat-footer {
    display: flex;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    border-top: 1px solid #ddd;
    align-items: center;
}

    .chat-footer input[type="text"] {
        flex: 1;
        padding: 0.6rem 1rem;
        border-radius: 25px;
        border: 1px solid #ccc;
        font-size: 1rem;
        transition: border-color 0.2s ease;
        border-color: #ccc;
    }

        .chat-footer input[type="text"]:focus {
            outline: none;
            border-color: #003b5c;
            box-shadow: 0 0 0 2px rgba(0, 59, 92, 0.15);
        }



.dark-mode .chat-footer input[type="text"] {
    background-color: #3b3b4a;
    color: white;
    border: 1px solid #666;
}

.chat-footer button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background-color: #003b5c;
    color: white;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

    .chat-footer button:hover {
        background-color: #00558c;
    }

.footer-logo {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: #555;
}

.dark-mode .footer-logo {
    color: #ccc;
}

.footer-logo img {
    width: 35%;
    max-width: 100%;
    vertical-align: middle;
    margin-left: 0.5rem;
}

#popup-overlay button {
    background-color: #003b5c;
    color: white;
    font-weight: bold;
    border: none;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    #popup-overlay button:hover {
        background-color: #002a42;
    }

.dark-mode #popup-overlay button {
    background-color: #0056b3;
}

.popup-content {
    background: white;
    color: #000;
    padding: 24px 32px;
    border-radius: 8px;
    max-width: 90%;
    text-align: center;
    transition: background 0.3s, color 0.3s;
}

.dark-mode .popup-content {
    background: #2a2a2a;
    color: #f0f0f0;
}


* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

@media (max-width: 600px) {
    .login-container {
        padding: 1rem;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
        justify-content: center;
    }

    .chat-container {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .message-container {
        max-height: 60vh;
        overflow-y: auto;
    }

    .input-area {
        flex-direction: column;
        gap: 0.5rem;
    }

        .input-area textarea {
            width: 100%;
            resize: none;
            height: 80px;
        }

        .input-area button {
            width: 100%;
            min-height: 44px;
            font-size: 1rem;
        }

    .header {
        padding: 1rem;
        font-size: 1.2rem;
        text-align: center;
    }
}


body {
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.message-container {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 160px); /* ajusta conforme header/footer */
    padding-right: 8px;
}

#form-dinamico p {
    font-weight: bold;
    color: inherit;
}

#form-dinamico label {
    cursor: pointer;
}

/* Botão igual ao de enviar mensagem */
#form-dinamico .chat-send-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #003b5c;
    color: white;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

    #form-dinamico .chat-send-btn:hover {
        background-color: #00558c;
    }

.chat-message button.chat-send-btn {
    display: inline-block;
    margin: 10px auto;
}

.chat-message.received p {
    color: inherit;
    font-weight: 500;
    text-align: center;
}

.chat-message.received button.chat-send-btn {
    width: auto;
    min-width: 150px;
}

.chat-message .chat-reset-btn {
    width: auto;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #003b5c;
    color: white;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

    .chat-message .chat-reset-btn:hover {
        background-color: #00558c;
    }
