/* Comunidades Terapêuticas - Estilo limpo e responsivo */
:root {
    --verde: #2e7d32;
    --verde-escuro: #1b5e20;
    --fundo: #fafcff;
    --texto: #1a1a1a;
    --cinza: #555;
    --borda: #e0e8e0;
    --branco: #ffffff;
    --sombra: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--fundo);
    color: var(--texto);
    line-height: 1.65;
    font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: var(--branco);
    border-bottom: 1px solid var(--borda);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sombra);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--verde-escuro);
}
.logo-icon { font-size: 28px; }
.logo-text { font-size: 14px; line-height: 1.2; }
.logo-text strong { font-size: 16px; color: var(--verde); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--verde-escuro);
    transition: 0.3s;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
}
.main-nav a {
    text-decoration: none;
    color: var(--texto);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 15px;
}
.main-nav a:hover { background: #e8f5e9; color: var(--verde-escuro); }

.has-submenu { position: relative; }
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--branco);
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    min-width: 200px;
    padding: 8px 0;
    z-index: 100;
}
.has-submenu:hover .submenu { display: block; }
.submenu a { display: block; padding: 8px 16px; white-space: nowrap; }

/* Submenu mobile - recolhe/expande corretamente */
@media (max-width: 768px) {
    .has-submenu .submenu {
        display: none !important;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 12px;
        background: #f5faf5;
        min-width: auto;
    }
    .has-submenu.open .submenu {
        display: block !important;
    }
    .has-submenu > a::after {
        content: ' ▾';
        font-size: 0.75em;
        opacity: 0.7;
    }
    .has-submenu.open > a::after {
        content: ' ▴';
    }
}

/* Hero / Home */
.hero {
    text-align: center;
    padding: 40px 16px 30px;
}
.hero h1 {
    font-size: 2.2rem;
    color: var(--verde-escuro);
    margin-bottom: 12px;
    font-weight: 700;
}
.hero .subtitle {
    font-size: 1.15rem;
    color: var(--cinza);
    max-width: 700px;
    margin: 0 auto 24px;
}
.doctor-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--verde);
    margin: 0 auto 24px;
    display: block;
    box-shadow: var(--sombra);
}

/* Banner rotativo */
.banner-slider {
    position: relative;
    max-width: 1000px;
    margin: 0 auto 30px;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    height: 320px;
}
.banner-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.banner-slider img.active { display: block; }
.banner-dots {
    text-align: center;
    margin-top: 10px;
}
.banner-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 4px;
    cursor: pointer;
}
.banner-dots span.active { background: var(--verde); }

/* CTAs */
.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 24px 0 40px;
}
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary {
    background: var(--verde);
    color: #fff;
}
.btn-primary:hover { background: var(--verde-escuro); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--verde);
    color: var(--verde);
}
.btn-outline:hover { background: var(--verde); color: #fff; }
.btn-whatsapp {
    background: #25d366;
    color: #fff;
}
.btn-whatsapp:hover { background: #1da851; }

/* Conteúdo */
.content-section {
    padding: 30px 0 50px;
}
.content-section h2 {
    color: var(--verde-escuro);
    margin: 28px 0 12px;
    font-size: 1.5rem;
}
.content-section p {
    margin-bottom: 14px;
    color: #333;
}
.content-section ul, .content-section ol {
    margin: 12px 0 16px 24px;
}
.featured-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 16px 0 24px;
    box-shadow: var(--sombra);
}

/* Classificados */
.clinicas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.clinica-card {
    background: var(--branco);
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
}
.clinica-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.clinica-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.clinica-card h3 {
    font-size: 1.05rem;
    color: var(--verde-escuro);
    margin-bottom: 8px;
}
.clinica-card p {
    font-size: 0.9rem;
    color: var(--cinza);
    flex: 1;
    margin-bottom: 12px;
}
.card-actions {
    display: flex;
    gap: 8px;
}
.card-actions .btn { flex: 1; text-align: center; padding: 8px 12px; font-size: 13px; }

/* Blog */
.blog-list { display: grid; gap: 24px; margin-top: 20px; }
.blog-item {
    background: var(--branco);
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--sombra);
}
.blog-item h2 { margin-top: 0; font-size: 1.25rem; }
.blog-item h2 a { color: var(--verde-escuro); text-decoration: none; }
.blog-item .meta { font-size: 0.85rem; color: #888; margin-bottom: 10px; }

/* Agente IA */
.chat-container {
    max-width: 720px;
    margin: 20px auto;
    background: var(--branco);
    border: 1px solid var(--borda);
    border-radius: 12px;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 480px;
}
.chat-header {
    background: var(--verde);
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}
.chat-status { font-size: 0.8rem; opacity: 0.9; }
.chat-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 6px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7faf7;
}
.msg {
    max-width: 85%;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}
.msg.bot {
    background: #fff;
    border: 1px solid var(--borda);
    align-self: flex-start;
}
.msg.user {
    background: var(--verde);
    color: #fff;
    margin-left: auto;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--borda);
    background: #fff;
}
.chip {
    background: #e8f5e9;
    color: var(--verde-escuro);
    border: 1px solid #c8e6c9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}
.chip:hover { background: var(--verde); color: #fff; }
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--borda);
    background: #fff;
    border-radius: 0 0 12px 12px;
}
.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    font-size: 15px;
}
.chat-footer-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 12px;
    background: #f0f7f0;
}

/* Formulário */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    font-size: 15px;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-error { color: #c62828; font-size: 0.85rem; margin-top: 4px; }

/* Footer - clean & light */
.site-footer {
    background: #f0f5f0;
    color: #333;
    padding: 40px 0 20px;
    margin-top: 40px;
    border-top: 1px solid var(--borda);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    margin-bottom: 24px;
}
.footer-col h3 { color: var(--verde-escuro); margin-bottom: 12px; font-size: 1.1rem; }
.footer-col a { color: var(--verde); text-decoration: none; }
.footer-col a:hover { color: var(--verde-escuro); text-decoration: underline; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col p { color: #555; font-size: 0.95rem; }
.footer-bottom {
    border-top: 1px solid var(--borda);
    padding-top: 16px;
    font-size: 0.85rem;
    text-align: center;
    color: #666;
}

/* WhatsApp flutuante - esquerda, pulse forte */
.whatsapp-float {
    position: fixed;
    left: 14px;
    bottom: 22px;
    background: #25d366;
    color: #fff;
    padding: 12px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37,211,102,0.55);
    z-index: 9999;
    font-weight: 700;
    font-size: 14px;
    animation: pulse-wa 1.4s ease-in-out infinite;
}
.whatsapp-float .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: #25d366;
    opacity: 0.55;
    animation: ping 1.2s ease-out infinite;
    left: 0; top: 0;
    z-index: 0;
}
.whatsapp-float .pulse2 {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: #25d366;
    opacity: 0.35;
    animation: ping 1.2s ease-out infinite 0.4s;
    left: 0; top: 0;
    z-index: 0;
}
@keyframes ping {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.55); opacity: 0; }
}
@keyframes pulse-wa {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(37,211,102,0.55); }
    50% { transform: scale(1.07); box-shadow: 0 6px 28px rgba(37,211,102,0.75); }
}
.wa-icon { font-size: 22px; position: relative; z-index: 1; }
.wa-text { position: relative; z-index: 1; white-space: nowrap; }

/* Responsivo */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--branco);
        border-bottom: 1px solid var(--borda);
        box-shadow: var(--sombra);
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; padding: 12px 0; }
    .main-nav a { display: block; padding: 12px 20px; }
    .hero h1 { font-size: 1.6rem; }
    .banner-slider { height: 200px; }
    .doctor-circle { width: 110px; height: 110px; }
    .whatsapp-float {
        padding: 11px 14px;
        font-size: 13px;
    }
    .chat-container { height: 75vh; }
}

@media (max-width: 480px) {
    .cta-group { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}
