/* ================================================================
   PASSAPORTE CULTURAL — prefixo .pp-*
   Compartilhado entre todas as páginas com header (mapa, início,
   eventos, observatório) e a seção "Meu Passaporte" de configurações
   — arquivo próprio em vez de map.css/settings.css porque o conteúdo
   é o mesmo (renderPassportInto, em js/passport.js) em todas elas.
   Tokens com fallback (var(--leaf-500, #2f9e52) etc.): map.css e
   settings.css redeclaram os mesmos valores verde/folha/terracota,
   mas os fallbacks garantem que a UI não quebre visualmente em
   páginas que não declaram esses tokens (eventos, observatório,
   início).
   ================================================================ */

/* ── Selo de nível (Iniciante → Lenda de Bueno) ─────────────────── */
.pp-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--leaf-500, #2f9e52), var(--leaf-900, #145c30));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2px;
}

.pp-level__icon {
    font-size: 14px;
}

.pp-progress {
    margin-bottom: 14px;
}

.pp-progress__bar {
    height: 10px;
    border-radius: 999px;
    background: var(--grey-100, #f3f4f6);
    overflow: hidden;
}

.pp-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--leaf-500, #2f9e52), var(--leaf-900, #145c30));
    transition: width .4s ease;
}

.pp-progress__label {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--grey-700, #374151);
}

.pp-progress__percent {
    font-weight: 500;
    color: var(--grey-400, #9ca3af);
}

/* ── "Faltam N para o próximo selo" — motiva a próxima visita ──── */
.pp-next {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px dashed var(--clay-400, #e08a52);
    background: #fff8f2;
}

.pp-next__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.pp-next__text {
    margin: 0;
    font-size: 12.5px;
    color: var(--grey-700, #374151);
    line-height: 1.4;
}

.pp-next__text strong {
    color: var(--clay-800, #96502a);
}

/* ── Selos por categoria (agrupados, com contagem) ───────────────── */
.pp-stamp-groups {
    margin-bottom: 18px;
}

.pp-category {
    margin-bottom: 14px;
}

.pp-category:last-child {
    margin-bottom: 0;
}

.pp-category__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.pp-category__icon {
    font-size: 14px;
}

.pp-category__label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--grey-700, #374151);
    flex: 1;
}

.pp-category__count {
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-400, #9ca3af);
}

.pp-stamp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
}

.pp-stamp {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1.5px dashed var(--grey-300, #d1d5db);
    color: transparent;
    font-weight: 800;
    font-size: 16px;
}

.pp-stamp.is-visited {
    border-style: solid;
    border-color: var(--leaf-700, #1f7a41);
    background: var(--green-50, #f4faf7);
    color: var(--leaf-700, #1f7a41);
}

/* ── Selos/conquistas ─────────────────────────────────────────── */
.pp-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.pp-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 12px;
    background: var(--grey-100, #f3f4f6);
    color: var(--grey-400, #9ca3af);
    text-align: center;
}

.pp-badge__icon {
    font-size: 22px;
    filter: grayscale(1);
    opacity: .5;
}

.pp-badge__label {
    font-size: 11px;
    font-weight: 700;
}

.pp-badge__progress {
    font-size: 10px;
    font-weight: 700;
    color: var(--grey-400, #9ca3af);
}

.pp-badge.is-unlocked {
    background: linear-gradient(135deg, var(--clay-400, #e08a52), var(--clay-800, #96502a));
    color: #fff;
}

.pp-badge.is-unlocked .pp-badge__icon {
    filter: none;
    opacity: 1;
}

/* ── Compartilhar progresso ──────────────────────────────────────── */
.pp-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--green-50, #f4faf7);
    color: var(--leaf-900, #145c30);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.pp-share:hover {
    background: var(--leaf-500, #2f9e52);
    color: #fff;
}

.pp-empty {
    color: var(--grey-500, #6b7280);
    font-size: 13px;
}

/* ── Modal (#passportModal), usado no mapa e demais páginas ─────── */
#passportModal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 15, 10, .5);
}

/* Mesma armadilha já corrigida em .rt-badge/.sb-tab-count: um
   "display" na regra base tem a mesma especificidade do seletor de
   atributo [hidden] — sem esta linha, o modal continuaria visível
   mesmo com o atributo hidden presente. */
#passportModal[hidden] { display: none; }

.pp-dialog {
    width: min(440px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 30px 70px rgba(12, 32, 20, .3);
}

.pp-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pp-dialog__head h3 {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.pp-dialog__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-size: 18px;
    cursor: pointer;
}

.pp-dialog__close:hover {
    background: #e5e7eb;
}

@media (max-width: 480px) {
    .pp-stamp-grid {
        grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    }
}
