@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600&family=Lora:ital,wght@0,400;1,400&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root { --vh: 1vh; }

body {
    background: #f7f5f0;
    color: #1a1a1a;
    font-family: 'Sora', sans-serif;
    overflow-x: hidden;
}

body.chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#app {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f7f5f0;
    display: flex;
    flex-direction: column;
}

/* TELAS */
.screen {
    display: none;
    flex-direction: column;
    width: 100%;
}

#screen-home {
    display: flex;
    padding: 2.5rem 1.5rem;
    flex-direction: column;
}

/* LOGO E HOME */
.logo-area { text-align: center; margin-bottom: 2.5rem; }
.logo-badge {
    display: inline-block;
    background: #1a3a2a;
    color: #c8e6c0;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
    text-transform: uppercase;
}
.logo-title { font-family: 'Lora', serif; font-size: 38px; color: #1a3a2a; }
.logo-title span { color: #3a7a50; }
.logo-sub { font-size: 13.5px; color: #5a6a5a; margin-top: 8px; }

.areas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.area-btn {
    background: #fff;
    border: 1.5px solid #d4e4d4;
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.area-btn:hover { border-color: #3a7a50; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(58,122,80,0.1); }
.area-name { font-size: 15px; font-weight: 600; color: #1a3a2a; }
.area-desc { font-size: 11px; color: #6a8070; line-height: 1.4; }

/* CHAT v2.0 */
#screen-chat {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: #f7f5f0;
    z-index: 2000;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #1a3a2a;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.back-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 10px;
    cursor: pointer;
}

/* NOVO BOTÃO NO HEADER */
.header-priority-btn {
    background: #3a7a50;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

/* BALÕES DE CHAT */
.msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.msg-ai { background: #fff; border: 1.5px solid #e0eae0; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: #1a3a2a; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-label { font-size: 10px; font-weight: 700; color: #3a7a50; margin-bottom: 4px; text-transform: uppercase; }

/* QUICK OPTIONS */
.options-flow { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; width: 100%; }
.opt-btn {
    background: #fff; border: 1.5px solid #d4e4d4; border-radius: 12px;
    padding: 14px; font-size: 13.5px; color: #1a3a2a; font-weight: 600; text-align: left;
}
.opt-btn:hover { border-color: #3a7a50; background: #f0f8f0; }

/* INPUT */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #e0eae0;
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
}

.chat-input {
    flex: 1;
    border: 1.5px solid #d4e4d4;
    border-radius: 12px;
    padding: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    background: #f7f5f0;
    max-height: 100px;
}

.send-btn {
    background: #1a3a2a;
    color: #fff;
    border: none;
    width: 44px; height: 44px;
    border-radius: 12px;
    cursor: pointer;
}

/* FOOTER */
.footer-note { font-size: 11px; color: #8a9a8a; text-align: center; padding: 2rem 1.5rem; }

/* TYPING */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.dot { width: 6px; height: 6px; background: #3a7a50; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* LEAD FORM */
.lead-card { background: #fff; padding: 24px; border-radius: 24px; width: 90%; margin: 20px auto; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.lead-input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1.5px solid #d4e4d4; border-radius: 10px; }
.lead-submit { width: 100%; background: #1a3a2a; color: #fff; padding: 14px; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; }
