﻿.gf-cem {
    --bg: #faf8f5;
    --surface: #ffffff;
    --ink: #2a2826;
    --muted: #6f6a64;
    --line: #e6e1da;
    --accent: #4f6b55;
    --accent-hover: #3d5643;
    --accent-soft: #eaf0eb;
    --accent-ink: #ffffff;
    --off: #e7e2db;
    --off-hover: #d6d0c7;
    --mark: #f6e7b8;
    --radius: 10px;
    /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;*/
    color: var(--ink);
    background: var(--bg);
    line-height: 1.45;
    max-width: 1570px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    box-sizing: border-box;
}

    .gf-cem *, .gf-cem *::before, .gf-cem *::after {
        box-sizing: border-box;
    }

    .gf-cem h1 {
        font-size: 1.5rem;
        font-weight: 400;
        text-align: center;
        text-transform: uppercase;
        margin: 0 0 4px;
        letter-spacing: -0.01em;
    }
        .gf-cem h1:before {
            display: block;
            content: '';
            width: 85px;
            height: 4px;
            background: #dc161f;
            margin: auto;
            margin-bottom: 10px;
        }

    .gf-cem .sub {
        color: var(--muted);
        margin: 0 0 20px;
        font-size: .95rem;
        text-align: center;
    }

/* Etapas */
.gf-cem .steps {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    font-size: .85rem;
    color: var(--muted);
    flex-wrap: wrap;
}

    .gf-cem .steps span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .gf-cem .steps b {
        display: inline-grid;
        place-items: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 1px solid var(--line);
        background: var(--surface);
        font-weight: 600;
        font-size: .75rem;
    }

    .gf-cem .steps .on {
        color: var(--ink);
    }

        .gf-cem .steps .on b {
            background: var(--accent);
            border-color: var(--accent);
            color: var(--accent-ink);
        }

    .gf-cem .steps i {
        font-style: normal;
        opacity: .5;
    }

.gf-cem button:focus-visible, .gf-cem input:focus-visible, .gf-cem select:focus-visible, .gf-cem a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Etapa 1: mapa do Brasil + estados ---------- */
.gf-cem .pick {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 28px;
    align-items: start;
}

.gf-cem .brmap {
    position: sticky;
    top: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}

    .gf-cem .brmap svg {
        display: block;
        width: 100%;
        height: auto;
    }

    .gf-cem .brmap path {
        fill: var(--off);
        stroke: #fff;
        stroke-width: 1.4;
        stroke-linejoin: round;
        vector-effect: non-scaling-stroke;
        cursor: pointer;
        transition: fill .15s;
    }

        .gf-cem .brmap path.has {
            fill: var(--accent);
        }

        .gf-cem .brmap path:hover, .gf-cem .brmap path.hl {
            fill: var(--off-hover);
        }

        .gf-cem .brmap path.has:hover, .gf-cem .brmap path.has.hl {
            fill: var(--accent-hover);
        }

        .gf-cem .brmap path:focus {
            outline: none;
        }

        .gf-cem .brmap path:focus-visible {
            stroke: var(--ink);
            stroke-width: 2.5;
        }

.gf-cem .legend {
    display: flex;
    gap: 16px;
    font-size: .78rem;
    color: var(--muted);
    margin-top: 10px;
    flex-wrap: wrap;
}

    .gf-cem .legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .gf-cem .legend i {
        width: 12px;
        height: 12px;
        border-radius: 3px;
        background: var(--accent);
    }

        .gf-cem .legend i.off {
            background: var(--off);
        }

.gf-cem .tip {
    position: absolute;
    pointer-events: none;
    background: var(--ink);
    color: #fff;
    font-size: .8rem;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    transform: translate(-50%, -130%);
    opacity: 0;
    transition: opacity .1s;
}

    .gf-cem .tip.show {
        opacity: 1;
    }

.gf-cem .states {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 8px;
}

.gf-cem .state {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}

    .gf-cem .state:hover, .gf-cem .state.hl {
        border-color: var(--accent);
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
    }

.gf-cem .shape {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
}

    .gf-cem .shape svg {
        width: 36px;
        height: 36px;
        display: block;
    }

    .gf-cem .shape path {
        fill: var(--accent);
    }

.gf-cem .state.empty .shape {
    background: #f3f0ec;
}

    .gf-cem .state.empty .shape path {
        fill: #c3bcb3;
    }

.gf-cem .state .nm {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.2;
}

.gf-cem .state .ct {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    margin-top: 2px;
}

.gf-cem .state.empty .nm {
    color: var(--muted);
}

.gf-cem .region {
    grid-column: 1 / -1;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 14px 0 2px;
    font-weight: 600;
}

    .gf-cem .region:first-child {
        margin-top: 0;
    }

/* ---------- Etapa 2: lista + mapa ---------- */
.gf-cem .head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

    .gf-cem .head .ttl {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .gf-cem .head h2 {
        font-size: 1.25rem;
        margin: 0;
        font-weight: 600;
    }

        .gf-cem .head h2 small {
            font-weight: 400;
            color: var(--muted);
            font-size: .9rem;
            margin-left: 6px;
        }

.gf-cem .back {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: 999px;
    font: inherit;
    font-size: .875rem;
    cursor: pointer;
}

    .gf-cem .back:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.gf-cem .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 20px;
    align-items: start;
}

.gf-cem .filters {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 8px;
    margin-bottom: 8px;
}

.gf-cem .field {
    position: relative;
}

    .gf-cem .field svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        pointer-events: none;
    }

.gf-cem input[type=search], .gf-cem select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    padding: 0 12px;
}

.gf-cem input[type=search] {
    padding-left: 40px;
}

    .gf-cem input[type=search]:focus, .gf-cem select:focus {
        border-color: var(--accent);
    }

.gf-cem .count {
    font-size: .85rem;
    color: var(--muted);
    margin: 10px 0 12px;
}

.gf-cem .city {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
    margin: 18px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .gf-cem .city::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

    .gf-cem .city:first-child {
        margin-top: 0;
    }

.gf-cem .list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.gf-cem .card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

    .gf-cem .card:hover {
        border-color: var(--accent);
    }

    .gf-cem .card[aria-checked=true] {
        border-color: var(--accent);
        background: var(--accent-soft);
        box-shadow: inset 0 0 0 1px var(--accent);
    }

.gf-cem .radio {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #bdb6ae;
    margin-top: 2px;
    display: grid;
    place-items: center;
}

.gf-cem .card[aria-checked=true] .radio {
    border-color: var(--accent);
}

    .gf-cem .card[aria-checked=true] .radio::after {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
    }

.gf-cem .card .t {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.3;
}

.gf-cem .card .a {
    display: block;
    font-size: .83rem;
    color: var(--muted);
    margin-top: 3px;
}

.gf-cem mark {
    background: var(--mark);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.gf-cem .none {
    text-align: center;
    padding: 40px 16px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

    .gf-cem .none strong {
        display: block;
        color: var(--ink);
        margin-bottom: 4px;
        font-size: 1rem;
    }

/* Painel do mapa */
.gf-cem .aside {
    position: sticky;
    top: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

    .gf-cem .aside .ph {
        padding: 28px 24px;
        text-align: center;
        color: var(--muted);
        font-size: .9rem;
    }

        .gf-cem .aside .ph svg {
            width: 100%;
            max-width: 240px;
            height: auto;
            margin: 0 auto 16px;
            display: block;
        }

        .gf-cem .aside .ph path {
            fill: var(--accent-soft);
            stroke: var(--accent);
            stroke-width: 1.5;
            vector-effect: non-scaling-stroke;
            stroke-linejoin: round;
        }

.gf-cem .mapbox iframe {
    display: block;
    width: 100%;
    height: 300px;
    border: 0;
    background: #eef0ec;
}

.gf-cem .mapbox .info {
    padding: 14px 16px 16px;
}

.gf-cem .mapbox .t {
    font-weight: 600;
    line-height: 1.3;
}

.gf-cem .mapbox .a {
    font-size: .85rem;
    color: var(--muted);
    margin-top: 4px;
}

.gf-cem .mapbox .links {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

    .gf-cem .mapbox .links a {
        flex: 1;
        min-width: 130px;
        text-align: center;
        text-decoration: none;
        font-size: .85rem;
        font-weight: 600;
        padding: 9px 12px;
        border-radius: 8px;
        border: 1px solid var(--accent);
        color: var(--accent);
    }

        .gf-cem .mapbox .links a:first-child {
            background: var(--accent);
            color: var(--accent-ink);
        }

.gf-cem .inline-map {
    grid-column: 1 / -1;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    margin-top: -4px;
}

    .gf-cem .inline-map iframe {
        height: 240px;
    }

.gf-cem .mapbox .confirm {
    display: block;
    width: 100%;
    margin-top: 8px;
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

    .gf-cem .mapbox .confirm:hover {
        background: var(--accent-hover);
    }

    .gf-cem .mapbox .confirm.ok {
        background: var(--accent-hover);
    }

.gf-cem [hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .gf-cem .pick {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gf-cem .brmap {
        position: relative;
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }

    .gf-cem .split {
        grid-template-columns: 1fr;
    }

    .gf-cem .aside {
        display: none;
    }
}

@media (max-width: 600px) {
    .gf-cem {
        padding-top: 16px;
    }

        .gf-cem .filters {
            grid-template-columns: 1fr;
        }

        .gf-cem .states {
            grid-template-columns: repeat(2, 1fr);
        }

        .gf-cem .list {
            grid-template-columns: 1fr;
        }

        .gf-cem .mapbox .links a {
            min-width: 0;
            padding: 9px 6px;
            font-size: .8rem;
            white-space: nowrap;
        }
}
