/**
 * ========================================================================
 * CSS PRINCIPAL - CUSTOBR CORRETORA DE SEGUROS
 * ========================================================================
 * Estilo moderno, profissional e responsivo.
 * Paleta: Verde profissional + fundo branco
 * Texto justificado | Destaques com fundo verde clarinho
 * Formulários conforme especificação do cliente
 * Comentários em Português do Brasil
 * ========================================================================
 */

/* =====================================================
   VARIÁVEIS CSS (facilita manutenção e futura edição via admin)
   ===================================================== */
:root {
    --cor-primaria: #1B5E20;
    --cor-secundaria: #2E7D32;
    --cor-destaque: #4CAF50;
    --cor-fundo-claro: #E8F5E9;
    --cor-fundo-branco: #FFFFFF;
    --cor-fundo-geral: #F5F7F5;
    --cor-texto: #333333;
    --cor-texto-claro: #555555;
    --cor-borda: #1B5E20;
    --fonte-principal: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --line-height: 1.6;
    --radius: 15px;
    --sombra: 0 4px 15px rgba(0, 0, 0, 0.08);
    --sombra-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --transicao: all 0.3s ease;
}

/* =====================================================
   RESET E BASE
   ===================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fonte-principal);
    font-size: 16px;
    line-height: var(--line-height); /* Distância de linhas equilibrada */
    color: var(--cor-texto);
    background-color: var(--cor-fundo-geral);
    -webkit-font-smoothing: antialiased;
}

/* Texto justificado em parágrafos */
p {
    text-align: justify;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--cor-primaria);
    transition: var(--transicao);
}

a:hover {
    color: var(--cor-destaque);
}

ul, ol {
    list-style: none;
}

/* =====================================================
   CONTAINER E LAYOUT GERAL
   ===================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cor-primaria);
    text-align: center;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--cor-texto-claro);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: justify;
}

/* =====================================================
   HEADER / MENU
   ===================================================== */
.header {
    background-color: var(--cor-fundo-branco);
    box-shadow: var(--sombra);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    position: relative; /* necessário para o menu mobile absoluto */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cor-primaria);
}

.logo-text span {
    color: var(--cor-destaque);
}

/* Menu de navegação */
.nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav a {
    padding: 10px 16px;
    font-weight: 500;
    color: var(--cor-texto);
    border-radius: 8px;
    transition: var(--transicao);
}

.nav a:hover,
.nav a.active {
    background-color: var(--cor-fundo-claro);
    color: var(--cor-primaria);
}

/* Botão do menu mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--cor-primaria);
    cursor: pointer;
    position: relative;
    z-index: 1003;
    padding: 12px;
    margin: -12px -8px -12px 0;
    min-width: 48px;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

/* =====================================================
   HERO (BANNER PRINCIPAL)
   ===================================================== */
.hero {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: #fff;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="20" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
}

.hero-content {
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 30px;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* =====================================================
   BOTÕES
   ===================================================== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transicao);
    text-align: center;
}

.btn-primary {
    background-color: var(--cor-destaque);
    color: #fff;
    border-color: var(--cor-destaque);
}

.btn-primary:hover {
    background-color: #43A047;
    border-color: #43A047;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

.btn-outline {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-outline:hover {
    background-color: #fff;
    color: var(--cor-primaria);
}

.btn-green {
    background-color: var(--cor-primaria);
    color: #fff;
}

.btn-green:hover {
    background-color: var(--cor-secundaria);
    color: #fff;
}

/* =====================================================
   SEÇÕES DE DESTAQUE (fundo verde clarinho)
   ===================================================== */
.destaque-verde {
    background-color: var(--cor-fundo-claro);
    border-radius: 12px;
    padding: 40px 30px;
}

/* =====================================================
   CARDS
   ===================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background-color: var(--cor-fundo-branco);
    border-radius: 12px;
    padding: 30px 25px;
    box-shadow: var(--sombra);
    transition: var(--transicao);
    border-top: 4px solid var(--cor-destaque);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: var(--cor-fundo-claro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--cor-primaria);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.25rem;
    color: var(--cor-primaria);
    margin-bottom: 12px;
}

.card p {
    color: var(--cor-texto-claro);
    font-size: 0.95rem;
}

/* =====================================================
   NÚMEROS / ESTATÍSTICAS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cor-primaria);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1rem;
    color: var(--cor-texto-claro);
}


/* =====================================================
   PLANOS DE SAÚDE NO MENU — lista vertical no mobile
   ===================================================== */

/* Desktop: esconde links .nav-op (lista plana) */
@media (min-width: 993px) {
    .nav-op { display: none !important; }
    .nav-details { position: relative; }
    .nav-summary {
        list-style: none;
        cursor: pointer;
        padding: 10px 14px;
        font-weight: 500;
        color: var(--cor-primaria);
    }
    .nav-summary::-webkit-details-marker { display: none; }
    .nav-item { position: relative; display: flex; align-items: center; }
    .nav-sub {
        display: none;
        flex-direction: column !important;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: #fff;
        box-shadow: var(--sombra);
        border-radius: 10px;
        padding: 8px 0;
        z-index: 1005;
    }
    .nav-details[open] > .nav-sub,
    .nav-item:hover .nav-sub {
        display: flex !important;
        flex-direction: column !important;
    }
    .nav-sub a {
        display: block !important;
        width: 100% !important;
        padding: 10px 16px !important;
        white-space: nowrap;
    }
}

/* Mobile: SEMPRE coluna — corrige o bug das operadoras em linha */
@media (max-width: 992px) {
    .nav-planos-main,
    .nav-planos-link {
        font-weight: 700 !important;
        color: var(--cor-primaria) !important;
        background: #e8f5e9 !important;
        width: 100% !important;
        display: block !important;
    }

    .nav-item,
    .nav-details,
    .nav-sub,
    .nav-parent {
        display: block !important;
        width: 100% !important;
        float: none !important;
        position: static !important;
        box-shadow: none !important;
        min-width: 0 !important;
    }

    .nav-summary {
        display: block !important;
        width: 100% !important;
        padding: 10.5px 20px !important;
        background: #f3f8f3 !important;
        border-bottom: 1px solid #eee !important;
        box-sizing: border-box !important;
        list-style: none !important;
        cursor: pointer;
        font-weight: 600;
        color: var(--cor-primaria);
    }
    .nav-summary::-webkit-details-marker { display: none; }
    .nav-summary::marker { content: '' !important; }

    /* CORREÇÃO PRINCIPAL: operadoras em coluna, não em linha */
    .nav-sub {
        display: none !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        background: #eef6ee !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .nav-details[open] > .nav-sub,
    .nav-item.open > .nav-sub {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .nav-sub a,
    .nav .nav-sub a,
    #mainNav .nav-sub a {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        flex: none !important;
        padding: 10.5px 20px 10.5px 36px !important;
        margin: 0 !important;
        border-bottom: 1px solid #e0ebe0 !important;
        border-radius: 0 !important;
        white-space: normal !important;
        box-sizing: border-box !important;
        background: #eef6ee !important;
    }

    /* Lista plana (.nav-op) */
    .nav-op {
        display: block !important;
        width: 100% !important;
        padding: 10.5px 20px 10.5px 32px !important;
        font-size: 0.95rem !important;
        background: #f7faf7 !important;
        box-sizing: border-box !important;
    }
}

/* =====================================================
   FORMULÁRIOS — centralizados
   Desktop 60% | Mobile 90%
   Fundo verde clarinho | raio 10px | espaçamento reduzido
   ===================================================== */
form {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    background-color: #F1F8F1 !important; /* verde bem clarinho */
    border-radius: 12px !important;
    padding: 18px 12px 14px !important;
    box-sizing: border-box !important;
}

.form-group {
    width: 100% !important;
    margin-bottom: 6px !important; /* espaçamento em altura reduzido */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.form-group label {
    display: block !important;
    width: 60% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
    font-weight: 600;
    margin-bottom: 2px !important;
    font-size: 13px !important; /* fonte levemente menor */
    color: var(--cor-texto);
}

.form-control {
    display: block !important;
    width: 60% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    padding: 6px 12px !important; /* altura mais compacta */
    font-size: 13px !important; /* fonte levemente menor */
    line-height: 16px !important;
    border: 1px solid var(--cor-borda) !important;
    border-radius: 10px !important; /* raio máximo 10 */
    background: #fff !important;
    color: var(--cor-texto);
    text-align: left !important;
}

.form-control:focus {
    outline: none;
    border-color: var(--cor-destaque) !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
    line-height: 1.4;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231B5E20' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px !important;
}

/* Botão do formulário acompanha a largura dos campos */
form .btn,
form button[type="submit"] {
    font-size: 13px !important;
    border-radius: 10px !important;
    padding: 10px 22px !important;
}

@media (max-width: 768px) {
    .form-group label,
    .form-control {
        width: 90% !important; /* mobile 90% */
    }
    form {
        padding: 14px 8px 12px !important;
    }
}



/* =====================================================
   REFORÇO GLOBAL — TODOS OS FORMULÁRIOS DO SITE
   Desktop 60% | Mobile 90% | raio 10 | verde clarinho
   ===================================================== */
form.form,
form[method],
form[action],
#formAutoMulti,
.content-box form,
section form {
    background-color: #F1F8F1 !important; /* verde bem clarinho */
    border-radius: 12px !important;
    padding: 16px 10px 12px !important;
    box-sizing: border-box !important;
}

form .form-group,
#formAutoMulti .form-group,
.content-box .form-group {
    margin-bottom: 5px !important;
}

form .form-group label,
#formAutoMulti .form-group label {
    width: 60% !important;
    max-width: 100% !important;
    margin-bottom: 2px !important;
    font-size: 13px !important;
}

form .form-control,
#formAutoMulti .form-control,
.content-box .form-control,
input.form-control,
select.form-control,
textarea.form-control {
    width: 60% !important;
    max-width: 100% !important;
    font-size: 13px !important;
    line-height: 16px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    border: 1px solid var(--cor-borda, #A5D6A7) !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    form .form-group label,
    #formAutoMulti .form-group label,
    form .form-control,
    #formAutoMulti .form-control,
    .content-box .form-control,
    input.form-control,
    select.form-control,
    textarea.form-control {
        width: 90% !important;
    }
}

/* =====================================================
   PÁGINAS INTERNAS
   ===================================================== */
.page-header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: #fff;
    padding: 50px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.content-box {
    background-color: var(--cor-fundo-branco);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--sombra);
    margin-bottom: 30px;
}

.content-box h2 {
    color: var(--cor-primaria);
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cor-fundo-claro);
}

.content-box h3 {
    color: var(--cor-secundaria);
    font-size: 1.2rem;
    margin: 25px 0 12px;
}

.content-box ul {
    margin: 15px 0 15px 20px;
}

.content-box ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    text-align: justify;
}

.content-box ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--cor-destaque);
    font-weight: bold;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background-color: var(--cor-primaria);
    color: #fff;
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #A5D6A7;
}

.footer p,
.footer a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: block;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.1rem;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        box-shadow: var(--sombra);
        z-index: 1001;
        border-radius: 0 0 12px 12px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav a,
    .nav .nav-parent > span,
    .nav .nav-sub a {
        padding: 10.5px 20px; /* distância vertical reduzida em 1/4 (era 14px) */
        border-bottom: 1px solid #eee;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .nav.active {
        display: flex;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 1003 !important;
        pointer-events: auto !important;
    }

    .nav.active {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }

    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .content-box {
        padding: 25px 20px;
    }

    .section-title {
        font-size: 1.6rem;
    }
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.bg-branco { background-color: var(--cor-fundo-branco); }
.bg-verde-claro { background-color: var(--cor-fundo-claro); }

body.menu-open { overflow: hidden; }

/* Reforço mobile: todos os links do menu em coluna */
@media (max-width: 992px) {
    #mainNav.nav.active {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
    }
    #mainNav.nav.active > a,
    #mainNav.nav.active .nav-item,
    #mainNav.nav.active .nav-details,
    #mainNav.nav.active .nav-sub,
    #mainNav.nav.active .nav-sub > a {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        flex: 0 0 auto !important;
        box-sizing: border-box !important;
    }
    #mainNav.nav.active .nav-sub {
        display: none !important;
    }
    #mainNav.nav.active details[open] > .nav-sub {
        display: block !important;
        width: 100% !important;
    }
}


/* =====================================================
   CARDS OPERADORAS — Planos de Saúde (imagem de fundo)
   ===================================================== */
.op-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin: 10px 0 20px;
}
.op-card {
    position: relative;
    display: block;
    min-height: 280px;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none !important;
    box-shadow: 0 12px 28px rgba(0,0,0,.14);
    transition: transform .25s ease, box-shadow .25s ease;
    isolation: isolate;
}
.op-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(0,0,0,.2);
}
.op-card-bg {
    position: absolute;
    inset: 0;
    background-image: var(--op-img);
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    transition: transform .4s ease;
    z-index: 0;
}
.op-card:hover .op-card-bg {
    transform: scale(1.08);
}
.op-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.55) 40%, rgba(0,0,0,.88) 100%);
}
.op-card-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--op-accent) 0%, transparent 60%);
    opacity: 0.35;
}
.op-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    min-height: 280px;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff !important;
}
.op-card-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--op-accent, #1B5E20);
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.op-card h3 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
    border: none !important;
    padding: 0 !important;
}
.op-card p {
    margin: 0 0 16px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(255,255,255,.92) !important;
    text-align: left !important;
    max-width: 32ch;
}
.op-card-cta {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff !important;
    border-bottom: 2px solid #A5D6A7;
    align-self: flex-start;
    padding-bottom: 2px;
}

@media (max-width: 992px) {
    .op-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .op-card,
    .op-card-content { min-height: 240px; }
}
@media (max-width: 600px) {
    .op-grid {
        grid-template-columns: 1fr;
    }
    .op-card,
    .op-card-content { min-height: 220px; }
}

/* Fallback browsers sem color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .op-card-badge { background: rgba(27, 94, 32, 0.9); }
    .op-card-overlay {
        background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.75) 100%);
    }
}
