:root {
    --detran-green: #009b4a;
    --detran-green-dark: #007a3a;
    --detran-orange: #ea680b;
    --detran-orange-hover: #e05e00;
    --chat-bg: #004d26; /* Dark greenish for chat widget mimicking cagece dark blue */
    --text-color: #333333;
    --bg-light: #f4f7f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
}

/* Header matching Detran style */
.main-header {
    background-color: var(--detran-green);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    border-bottom: 5px solid var(--detran-orange);
}

.logo-container h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-container p {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #c4f0d5;
}

/* Content Area */
.hero-section {
    padding: 100px 5%;
    text-align: center;
}

.hero-section h2 {
    font-size: 2.5rem;
    color: var(--detran-green-dark);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Chat Widget Sub-system */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Launcher Style (Cagece Replica) */
#chat-launcher {
    display: flex;
    align-items: center;
    background-color: transparent;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease;
    margin-bottom: 5px;
}

#chat-launcher:hover {
    transform: scale(1.03);
}

.launcher-message {
    background-color: #004322;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 15px 60px 15px 25px; /* Padding gigante na direita para o texto não ficar coberto */
    border-radius: 25px; /* Totalmente arredondado como uma pílula */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1;
    margin-right: -45px; /* Empurra a caixa fundo na barriga do mascote */
    margin-bottom: 5px;
}

.launcher-avatar {
    z-index: 2;
    width: 110px; /* Tamanho generoso para o mascote */
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.launcher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Renderiza a imagem perfeitamente sem cortes */
    filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.3)); /* Sombra lindíssima que contorna o corpo do mascote */
}

/* Chat Window */
#chat-window {
    width: 380px;
    height: 550px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 20px;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-window.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    position: absolute;
    bottom: 0;
    right: 0;
}

.chat-header {
    background-color: var(--detran-green);
    color: var(--white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.chat-header-info h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.chat-header-info p {
    font-size: 0.75rem;
    opacity: 0.8;
}

.close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f9f9f9;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bot-message {
    background-color: var(--white);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-message {
    background-color: var(--detran-green);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-footer {
    padding: 15px;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-footer input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.chat-footer input:focus {
    border-color: var(--detran-green);
}

.chat-footer button {
    background-color: var(--detran-orange);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-footer button:hover {
    background-color: var(--detran-orange-hover);
}

@media (max-width: 480px) {
    #chat-window {
        width: calc(100vw - 40px);
        height: 80vh;
    }
}
