@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --ios-bg: rgb(255, 255, 255);
    --ios-blur: blur(35px);
    --ios-border: rgba(255, 255, 255, 0.5);
    --ios-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

#panels-wrap {
    max-width: calc(80rem);
}

#admin-panel {
    min-width: 280px;
    max-width: 280px;
}

#landing-screen {
    z-index: 4000;
}

#login-bg {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 26%), radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.08), transparent 24%), radial-gradient(circle at 60% 80%, rgba(148, 163, 184, 0.09), transparent 28%);
}

#login-bg .bg-login-image {
    position: absolute;
    inset: 0;
    background-image: url('images/adventist-pt--denim.png');
    background-position: 10% 50%;
    background-repeat: no-repeat;
    background-size: 110%;
    opacity: 0.08;
    filter: blur(1px);
    animation: login-image-pan 30s ease-in-out infinite;
}

@keyframes login-image-pan {

    0%,
    100% {
        background-position: 10% 50%;
    }

    50% {
        background-position: 90% 45%;
    }
}

#login-bg .bg-map-ambient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(207, 232, 249, 0.95) 0%, rgba(226, 232, 240, 0.92) 100%);
}

#login-bg .bg-map-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.18) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.4;
    animation: login-grid-move 22s linear infinite;
    filter: blur(0.5px);
}

#login-bg .bg-map-lines {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 35%, rgba(56, 189, 248, 0.12), transparent 28%), radial-gradient(circle at 75% 18%, rgba(59, 130, 246, 0.10), transparent 20%), radial-gradient(circle at 78% 78%, rgba(148, 163, 184, 0.08), transparent 24%);
    opacity: 0.35;
}

@keyframes login-grid-move {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: -120px -120px, 120px 120px;
    }
}

body.login-active #panels-wrap {
    display: none;
}

body.login-active #map {
    filter: blur(1px);
    opacity: 0.45;
}

#landing-screen form input,
#landing-screen form button {
    font-family: inherit;
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f2f2f7;
    overflow: hidden;
}

body.settings-page,
body.users-page {
    overflow: auto;
}

body.login-page,
body.settings-page,
body.users-page {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 20%),
        radial-gradient(circle at 78% 22%, rgba(59, 130, 246, 0.1), transparent 16%),
        #f8fafc;
}

body.login-page .page-shell,
body.settings-page .page-shell,
body.users-page .page-shell {
    min-height: 100vh;
}

body.login-page .page-card,
body.settings-page .page-card,
body.users-page .page-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

body.login-page .page-hero,
body.settings-page .page-hero,
body.users-page .page-hero {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(243, 244, 246, 0.8) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 32px;
    padding: 2rem;
}

body.settings-page .page-hero,
body.users-page .page-hero {
    padding: 2rem;
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.12);
}

body.login-page .page-heading,
body.settings-page .page-heading,
body.users-page .page-heading {
    color: #0f172a;
}

body.login-page .page-copy,
body.settings-page .page-copy,
body.users-page .page-copy {
    color: #475569;
}

body.login-page .page-action-group,
body.settings-page .page-action-group,
body.users-page .page-action-group {
    display: grid;
    gap: 0.75rem;
}

body.settings-page .page-action-group,
body.users-page .page-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

body.settings-page .page-action-group button,
body.users-page .page-action-group button,
body.settings-page .page-action-group a,
body.users-page .page-action-group a {
    min-width: 0;
}

body.settings-page .page-card:hover,
body.users-page .page-card:hover,
body.login-page .page-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.login-page .auth-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 32px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

body.login-page .auth-panel {
    background-image:  url('https://wallpapers4screen.com/Uploads/2-3-2025/68340/thumb2-4k-communications-south-america-technology-social-networks-south-america.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 32px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.08);
}

body.users-page .user-panel {
    background: #ffffff;
    border-radius: 32px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

body.users-page .page-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

body.users-page .user-card {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 28px;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
}

body.users-page .user-card .user-card-meta {
    color: #475569;
    font-size: 0.92rem;
}

body.users-page .user-card .user-card-email {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

body.users-page .user-card .user-card-role {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
}

body.users-page .user-card .user-actions button {
    min-width: 0;
}

body.users-page .modal-form input,
body.users-page .modal-form select {
    border-radius: 18px;
    background: #f8fafc;
}

body.users-page .modal-card {
    max-height: 90vh;
    overflow-y: auto;
}

body.users-page .modal-card::-webkit-scrollbar {
    width: 6px;
}

body.users-page .modal-card::-webkit-scrollbar-track {
    background: transparent;
}

body.users-page .modal-card::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.14);
    border-radius: 10px;
}

#map {
    height: 100vh;
    width: 100%;
    position: absolute;
    z-index: 1;
    background: #e5e5ea;
}

.ios-panel {
    background: var(--ios-bg);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-border);
    box-shadow: var(--ios-shadow);
    border-radius: 20px;
    z-index: 1000;
}

.ios-button {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-button:active {
    transform: scale(0.96);
    opacity: 0.8;
}

.ios-scroll::-webkit-scrollbar {
    width: 3px;
}

.ios-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ios-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px;
    border-radius: 10px;
}

.segmented-item {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    color: #8e8e93;
}

.segmented-item.active {
    background: white;
    color: #007aff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.base-layer-switcher {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 1100;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.base-layer-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.base-layer-icon:hover,
.base-layer-switcher:focus-within .base-layer-icon {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.base-layer-options {
    display: none;
    position: absolute;
    left: calc(100% + 12px);
    bottom: 0;
    width: max-content;
    min-width: 200px;
    max-width: 320px;
    flex-direction: row;
    gap: 0.45rem;
    padding: 0.65rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 22px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
}

.base-layer-options::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    border-left: 1px solid rgba(15, 23, 42, 0.12);
}

.base-layer-switcher.open .base-layer-options {
    display: flex;
}

.base-layer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 60px;
    min-height: 60px;
    padding: 0.55rem 0.55rem;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #fafafa;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    color: #0f172a;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.base-layer-card:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.base-layer-card.active {
    background: #eff6ff;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.base-layer-card::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.base-layer-card.active::before {
    opacity: 0.1;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.base-layer-card .card-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.base-layer-card .card-label {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: #0f172a;
}

#base-light .card-icon {
    background: linear-gradient(180deg, #e2e8f0 0%, #f8fafc 100%);
}

#base-satellite .card-icon {
    background: linear-gradient(180deg, #4b5563 0%, #111827 100%);
}

#base-terrain .card-icon {
    background: linear-gradient(180deg, #8f9e7a 0%, #4f7a56 100%);
}

#base-dark .card-icon {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.base-layer-button:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

/* Hierarquia Estilizada (Árvore Compacta) */

/* Hierarquia Estilizada (Árvore Compacta) */
.tree-node {
    margin-top: 1px;
}

.tree-children {
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    margin-left: 8px;
    padding-left: 2px;
}

.tree-toggle-icon {
    transition: transform 0.2s ease;
}

.tree-collapsed .tree-children {
    display: none;
}

.tree-collapsed .tree-toggle-icon {
    transform: rotate(-90deg);
}

.church-item {
    font-size: 10px;
    padding: 3px 6px;
    margin: 1px 0;
    border-radius: 6px;
}

/* Estilo do Balão (Popup) */
.leaflet-popup-content-wrapper {
    border-radius: 18px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
}

.leaflet-popup-tip {
    box-shadow: none !important;
}

.church-popup {
    min-width: 220px;
}

.church-popup-header {
    background-color: hsl(215.49deg 39.23% 35.49%);
    padding: 12px;
    color: white;
}

.church-popup-title {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
}

.church-popup-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.church-popup-body {
    padding: 12px;
    background: white;
}

.church-popup-label {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;

}

.church-popup-label::after {
    margin-left: 4px;
}

.church-popup-association {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.church-popup-value {
    font-size: 12px;
    font-weight: 500;
    color: #330303;
    margin-bottom: 10px;
}

.church-popup-footer {
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    text-align: center;
}

.church-popup-button {
    width: 100%;
    background: #3d537d;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.church-icon {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
}

.church-action-btn,
.tree-action-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    transition: background 0.2s;
}

.tree-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.tree-action-btn {
    width: 22px;
    height: 22px;
}

.leaflet-popup-close-button {
    width: 22px;
    height: 22px;
    line-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #374151;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    padding: 0;
    top: 8px !important;
    right: 8px !important;
}

.leaflet-popup-close-button:hover {
    background: #f3f4f6;
    color: #111827;
}

.section-box {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 10px;
}

.section-label {
    font-size: 9px;
    font-weight: 800;
    color: #a1a1a6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    display: block;
}

/* Marcador Minimalista */
.minimal-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.minimal-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.minimal-dot:hover {
    transform: scale(1.3);
}

.church-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.church-marker-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.church-marker-pin svg {
    width: 14px;
    height: 14px;
}

.menu-center {
    align-items: center !important;
}