:root{
    --mapa-blue-900:#0D47A1;
    --mapa-blue-700:#1976D2;
    --mapa-gold-500:#FFC107;
    --mapa-gold-600:#FFB300;
    --mapa-black:#111827;
    --mapa-white:#ffffff;
    --mapa-soft:#eaf1fb;
    --mapa-border:rgba(255,255,255,.16);
    --mapa-shadow:0 18px 55px rgba(6,24,44,.18);
    --mapa-shadow-soft:0 10px 30px rgba(15,23,42,.10);
    --mapa-radius-xl:26px;
    --mapa-radius-lg:20px;
    --mapa-radius-md:16px;
}

*{box-sizing:border-box}
body.mapa-exp-body{
    margin:0;
    font-family:Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(255,193,7,.18), transparent 24%),
        radial-gradient(circle at left center, rgba(25,118,210,.18), transparent 26%),
        linear-gradient(180deg,#eef4ff 0%,#f7f8fc 100%);
    color:var(--mapa-black);
}

.mapa-shell{min-height:100vh}

.hero-premium{
    position:relative;
    overflow:hidden;
    padding:34px 0 30px;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,193,7,.25), transparent 20%),
        linear-gradient(135deg, #07142b 0%, #0d2a58 45%, #1459aa 76%, #0d47a1 100%);
    color:#fff;
}

.hero-overlay{
    position:absolute;
    inset:0;
    background:
        linear-gradient(transparent 0%, rgba(255,255,255,.04) 100%),
        repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 70px);
    pointer-events:none;
}

.hero-content{
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:1.4fr .9fr;
    gap:28px;
    align-items:center;
}

.hero-badge{
    display:inline-flex;
    padding:8px 14px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.25);
    background:rgba(255,255,255,.10);
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-size:12px;
    margin-bottom:16px;
}

.hero-left h1{
    margin:0;
    font-size:clamp(2rem,4vw,3.3rem);
    line-height:1;
    font-weight:800;
}

.hero-left p{
    margin:12px 0 0;
    max-width:760px;
    color:rgba(255,255,255,.84);
    font-size:1rem;
}

.hero-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:24px;
}

.hero-stat-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.hero-stat-card,.glass-card{
    background:rgba(255,255,255,.16);
    border:1px solid var(--mapa-border);
    box-shadow:var(--mapa-shadow);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-radius:var(--mapa-radius-xl);
}

.hero-stat-card{
    padding:18px;
}

.hero-stat-card span{
    display:block;
    color:rgba(255,255,255,.76);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.hero-stat-card strong{
    display:block;
    margin-top:8px;
    font-size:1.5rem;
    color:#fff;
}

.public-hero-panel{
    padding:22px;
    background:linear-gradient(180deg,rgba(255,193,7,.14),rgba(255,255,255,.08));
}

.public-hero-kicker{
    display:inline-flex;
    margin-bottom:10px;
    color:#ffe082;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.14em;
    font-weight:800;
}

.public-hero-panel strong{
    display:block;
    font-size:1.45rem;
    line-height:1.2;
    color:#fff6d5;
}

.public-hero-panel p{
    margin:10px 0 0;
    color:rgba(255,255,255,.8);
}

.module-nav{
    position:sticky;
    top:0;
    z-index:10;
    background:rgba(255,255,255,.88);
    backdrop-filter:blur(18px);
    border-bottom:1px solid rgba(13,71,161,.10);
}

.module-nav ul{
    display:flex;
    gap:10px;
    list-style:none;
    margin:0;
    padding:14px 0;
    overflow:auto;
}

.module-nav li a{
    display:flex;
    align-items:center;
    gap:8px;
    padding:12px 16px;
    border-radius:999px;
    text-decoration:none;
    color:#163057;
    font-weight:700;
    white-space:nowrap;
}

.module-nav li.active a{
    background:linear-gradient(135deg,var(--mapa-blue-900),var(--mapa-blue-700));
    color:#fff;
    box-shadow:0 10px 25px rgba(13,71,161,.18);
}

.module-content{padding:22px 0 36px}

.filter-panel{
    padding:18px;
    background:rgba(255,255,255,.76);
    color:var(--mapa-black);
}

.filter-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:14px;
}

.filter-grid label{
    display:block;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin-bottom:8px;
    color:#4b5563;
}

.filter-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:16px;
}

.btn-premium,.btn-gold,.btn-premium-outline{
    border-radius:14px;
    padding:11px 16px;
    font-weight:700;
    border:0;
    text-decoration:none;
}

.btn-premium{
    background:linear-gradient(135deg,var(--mapa-blue-900),var(--mapa-blue-700));
    color:#fff;
}

.btn-gold{
    background:linear-gradient(135deg,var(--mapa-gold-500),var(--mapa-gold-600));
    color:#1b2430;
}

.btn-premium-outline{
    background:rgba(255,255,255,.70);
    border:1px solid rgba(13,71,161,.15);
    color:#173762;
}

.dashboard-cards{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:14px;
    margin-top:18px;
}

.metric-card{
    padding:18px;
    background:rgba(255,255,255,.82);
}

.metric-card span{
    display:block;
    color:#64748b;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.07em;
}

.metric-card strong{
    display:block;
    margin-top:10px;
    font-size:1.6rem;
    color:#0f172a;
}

.content-grid{
    display:grid;
    grid-template-columns:1.6fr .8fr;
    gap:16px;
    margin-top:18px;
}

.public-content-grid{
    grid-template-columns:1fr;
}

.map-card,.side-panel,.chart-card,.timeline-section,.report-card{
    padding:18px;
    background:rgba(255,255,255,.82);
    color:var(--mapa-black);
    box-shadow:var(--mapa-shadow-soft);
}

.map-card-xl .mapa-exp-canvas{height:68vh}

.section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:14px;
}

.section-head small{
    display:block;
    color:#64748b;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-weight:800;
}

.section-head h2{
    margin:3px 0 0;
    font-size:1.25rem;
    font-weight:800;
}

.section-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.mapa-exp-canvas{
    width:100%;
    height:56vh;
    border-radius:20px;
    overflow:hidden;
    background:linear-gradient(180deg,#dae8ff,#f7f9ff);
    border:1px solid rgba(13,71,161,.08);
}

.insight-list,.ranking-list{display:grid;gap:12px}

.insight-item,.ranking-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 16px;
    border-radius:16px;
    background:linear-gradient(180deg,#fff,#f8fbff);
    border:1px solid rgba(13,71,161,.08);
}

.insight-item span,.ranking-item span{display:block;color:#64748b;font-size:13px}
.insight-item strong,.ranking-item strong,.ranking-item b{font-size:1rem}

.charts-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    margin-top:18px;
}

.chart-card canvas{width:100%!important;min-height:300px!important;max-height:340px!important}

.timeline-section{margin-top:18px}

.timeline-premium{
    position:relative;
    display:grid;
    gap:16px;
    padding-left:26px;
}

.timeline-premium::before{
    content:'';
    position:absolute;
    left:10px;
    top:4px;
    bottom:4px;
    width:3px;
    background:linear-gradient(180deg,var(--mapa-gold-500),rgba(13,71,161,.25));
    border-radius:999px;
}

.timeline-item{position:relative}

.timeline-dot{
    position:absolute;
    left:-24px;
    top:24px;
    width:14px;
    height:14px;
    border-radius:50%;
    background:var(--mapa-gold-500);
    box-shadow:0 0 0 6px rgba(255,193,7,.18);
}

.timeline-card{
    padding:18px;
    border-radius:20px;
    background:linear-gradient(180deg,#fff,#f8fbff);
    border:1px solid rgba(13,71,161,.08);
}

.timeline-card span{
    color:#0d47a1;
    font-weight:700;
    font-size:13px;
}

.timeline-card h3{
    margin:8px 0 6px;
    font-size:1.1rem;
    font-weight:800;
}

.timeline-card p{margin:0;color:#475569}

.reports-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    margin-top:18px;
}

.report-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.premium-modal{
    border:0;
    background:#0e2446;
    color:#fff;
    border-radius:24px;
}

.premium-modal .modal-header,
.premium-modal .modal-footer{
    border-color:rgba(255,255,255,.10);
}

.premium-modal .modal-body{
    background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));
}

.premium-modal label{
    display:block;
    margin-bottom:8px;
    font-size:12px;
    text-transform:uppercase;
    font-weight:700;
    letter-spacing:.06em;
}

.premium-modal .form-control,
.premium-modal .form-select{
    border-radius:14px;
    border:1px solid rgba(255,255,255,.14);
    background:rgba(255,255,255,.92);
}

.modo-publico .module-nav{display:none}
.modo-publico .hero-premium{padding-bottom:36px}
.modo-publico{
    background:
        radial-gradient(circle at top right, rgba(255,193,7,.18), transparent 18%),
        radial-gradient(circle at 15% 20%, rgba(25,118,210,.2), transparent 24%),
        linear-gradient(180deg,#07101d 0%,#0f172a 100%) !important;
    color:#f8fafc;
}

.modo-publico .filter-panel,
.modo-publico .timeline-section,
.modo-publico .report-card{
    background:rgba(15,23,42,.72);
    border:1px solid rgba(255,193,7,.14);
    color:#f8fafc;
    box-shadow:0 20px 50px rgba(0,0,0,.28);
}

.modo-publico .map-card{
    padding:0;
    background:transparent;
    border:0;
    box-shadow:none;
}

.modo-publico .filter-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
}

.modo-publico .filter-grid label,
.modo-publico .section-head small,
.modo-publico .timeline-card span{
    color:#cbd5e1;
}

.modo-publico .section-head h2,
.modo-publico .timeline-card h3{
    color:#fff;
}

.modo-publico .timeline-card,
.modo-publico .public-copy-card{
    background:linear-gradient(180deg,rgba(15,23,42,.86),rgba(30,41,59,.78));
    border:1px solid rgba(255,193,7,.12);
}

.modo-publico .timeline-card p{
    color:#d8e0ea;
}

.modo-publico .form-control,
.modo-publico .form-select{
    background:rgba(255,255,255,.92);
}

.modo-publico .mapa-exp-canvas{
    background:transparent;
    border:0;
}

.public-summary-cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
    margin-top:18px;
    margin-bottom:22px;
}

.public-summary-card{
    min-height:126px;
    border-radius:22px;
    padding:0;
    overflow:hidden;
    position:relative;
    background:linear-gradient(180deg,#fffdf6 0%,#f8fbff 100%);
    border:1px solid rgba(255,193,7,.45);
    box-shadow:0 18px 42px rgba(0,0,0,.20);
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    color:#07142f;
}

.public-summary-card::before{
    content:'';
    display:block;
    height:44px;
    background:linear-gradient(135deg,#ffe58a 0%,#f8d66d 100%);
    border-bottom:1px solid rgba(255,193,7,.38);
}

.public-summary-card::after{
    content:'';
    position:absolute;
    right:-34px;
    bottom:-42px;
    width:132px;
    height:132px;
    border-radius:50%;
    background:rgba(191,84,18,.10);
}

.public-summary-card:nth-child(1) .public-summary-icon::before{content:'\f57d'}
.public-summary-card:nth-child(2) .public-summary-icon::before{content:'\f3c5'}
.public-summary-card:nth-child(3) .public-summary-icon::before{content:'\f64f'}
.public-summary-card:nth-child(4) .public-summary-icon::before{content:'\f1ad'}

.public-summary-card span,
.public-summary-card strong{
    position:relative;
    z-index:1;
}

.public-summary-card span{
    position:absolute;
    top:14px;
    left:18px;
    right:56px;
    color:#1e1609;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.06em;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.public-summary-card strong{
    color:#07142f;
    font-size:2.15rem;
    line-height:1;
    font-weight:900;
    padding:24px 18px 22px;
}

.public-summary-card .public-summary-icon{
    position:absolute;
    right:18px;
    top:11px;
    z-index:1;
    width:24px;
    height:24px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#3b2608;
}

.public-summary-card .public-summary-icon::before{
    font-family:"Font Awesome 6 Free";
    font-weight:900;
    font-size:15px;
}

.public-chip-list{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
}

.public-chip{
    display:inline-flex;
    align-items:center;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.08);
    color:#e2e8f0;
    font-size:13px;
    line-height:1.2;
}

.public-chip-gold{
    background:rgba(255,193,7,.14);
    border-color:rgba(255,193,7,.26);
    color:#ffe082;
}

.public-marker-shell{
    opacity:0;
    transform:scale(.35);
    transition:transform .55s ease, opacity .55s ease;
}

.public-marker-shell.is-visible{
    opacity:1;
    transform:scale(1);
}

.public-marker-core{
    display:block;
    width:24px;
    height:24px;
    border-radius:50%;
    background:radial-gradient(circle at 35% 35%, #ffe082 0%, #FFC107 55%, #FFB300 100%);
    box-shadow:0 0 0 6px rgba(255,193,7,.16), 0 0 26px rgba(255,193,7,.58);
    animation:publicMarkerPulse 2.8s ease-in-out infinite;
}

.public-marker-core.public-marker-mission{
    background:radial-gradient(circle at 35% 35%, #fff3c4 0%, #ffd54f 46%, #f59e0b 100%);
    box-shadow:0 0 0 7px rgba(255,193,7,.18), 0 0 32px rgba(255,179,0,.7);
}

.public-tooltip-wrap{
    background:transparent;
    border:0;
    box-shadow:none;
}

.public-tooltip-wrap .leaflet-tooltip-content{
    margin:0;
}

.public-hover-card{
    min-width:180px;
    padding:12px 14px;
    border-radius:16px;
    background:rgba(15,23,42,.94);
    border:1px solid rgba(255,193,7,.24);
    box-shadow:0 16px 35px rgba(0,0,0,.28);
    color:#fff;
}

.public-hover-card strong{
    display:block;
    color:#ffe082;
    font-size:14px;
    margin-bottom:4px;
}

.public-hover-card span{
    display:block;
    color:#e2e8f0;
    font-size:12px;
}

.public-state-point.is-reached{
    filter:drop-shadow(0 0 10px rgba(255,193,7,.8));
}

@keyframes publicMarkerPulse{
    0%,100%{transform:scale(1);box-shadow:0 0 0 6px rgba(255,193,7,.16), 0 0 26px rgba(255,193,7,.55)}
    50%{transform:scale(1.12);box-shadow:0 0 0 11px rgba(255,193,7,.10), 0 0 36px rgba(255,193,7,.7)}
}

.leaflet-popup-content-wrapper{
    border-radius:18px;
    box-shadow:0 20px 50px rgba(15,23,42,.24);
}

.popup-card{min-width:250px}
.popup-card h5{font-size:1rem;margin:0 0 8px;font-weight:800}
.popup-meta{font-size:13px;color:#475569;margin-bottom:4px}
.popup-badges{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.popup-badge{
    display:inline-flex;
    padding:5px 10px;
    border-radius:999px;
    background:#eff6ff;
    color:#0d47a1;
    font-weight:700;
    font-size:12px;
}
.popup-btn{
    display:inline-flex;
    margin-top:10px;
    padding:10px 12px;
    border-radius:12px;
    background:linear-gradient(135deg,var(--mapa-blue-900),var(--mapa-blue-700));
    color:#fff;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
}

@media (max-width: 1200px){
    .filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .dashboard-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media (max-width: 992px){
    .hero-content,.content-grid,.charts-grid,.reports-grid{grid-template-columns:1fr}
    .hero-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .public-summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 768px){
    .filter-grid,.dashboard-cards,.hero-stat-grid{grid-template-columns:1fr}
    .public-summary-cards{grid-template-columns:1fr}
    .hero-left h1{font-size:2rem}
    .mapa-exp-canvas,.map-card-xl .mapa-exp-canvas{height:52vh}
    .module-content{padding-top:16px}
    .modo-publico .filter-grid{grid-template-columns:1fr}
}
/* Estilos para modo Embedded (Injetado na Home) */
html.modo-embed,
body.modo-embed {
    overflow: hidden !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
}

.modo-embed .mapa-shell {
    min-height: auto !important;
    height: 100vh !important;
}

.modo-embed .hero-premium,
.modo-embed .module-nav,
.modo-embed .manifesto-premium,
.modo-embed .public-manifesto,
.modo-embed .public-manifesto-grid,
.modo-embed .filter-panel,
.modo-embed .dashboard-cards,
.modo-embed .charts-grid,
.modo-embed .timeline-section,
.modo-embed .reports-grid,
.modo-embed .side-panel {
    display: none !important;
}

.modo-embed .module-content {
    padding: 0 !important;
    height: 100vh !important;
}

.modo-embed .content-grid {
    margin: 0 !important;
    height: 100vh !important;
    display: block !important;
}

.modo-embed .map-card,
.modo-embed .metric-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
}

.modo-embed .map-card .section-head {
    display: none !important;
}

.modo-embed .mapa-exp-canvas {
    height: 100vh !important;
    border-radius: 0 !important;
}

@media (max-width: 768px) {
    .modo-embed .mapa-exp-canvas {
        height: 400px !important;
    }
}

/* Estilos Premium para o Card Público (Baseado na Imagem 2) */
.public-popup-wrap .leaflet-popup-content-wrapper {
    background: #fff;
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
}

.public-popup-wrap .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.public-popup-card {
    padding: 24px 20px;
    text-align: center;
    color: #1f2937;
}

.public-card-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.public-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-card-status {
    display: inline-block;
    padding: 6px 14px;
    background: #fff3e0;
    color: #ef6c00;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 99px;
    margin-bottom: 12px;
}

.public-card-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}

.public-card-congregacao-bold {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.public-card-local-bold {
    font-size: 1rem;
    color: #475569;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.public-card-address {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}

.public-btn-route {
    display: block;
    width: 100%;
    padding: 12px;
    background: #FFC107;
    color: #000;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
    transition: 0.3s;
}

.public-btn-route:hover {
    background: #FFB300;
    transform: translateY(-2px);
    color: #000;
}

.public-popup-wrap .leaflet-popup-tip {
    background: #fff;
}
