* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    overflow-x: clip;
}
#hero-section {
    scroll-snap-align: start;
}
#app-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    overflow: hidden;
}
html.no-snap { scroll-snap-type: none; }
body.detail-open { overflow: hidden; position: fixed; width: 100%; }
body.detail-open #hero-section { display: none; }

/* ============ DARK MODE (default) ============ */
body:not(.light-mode) { background: #0f0f1e; color: #e2e8f0; }
body:not(.light-mode) #app-wrapper { background: #0f0f1e; }

/* Topbar */
body:not(.light-mode) .topbar { background: #1a1a2e; }
body:not(.light-mode) .topbar .search-box { background: rgba(255,255,255,0.1); color: #fff; }
body:not(.light-mode) .topbar .search-box::placeholder { color: rgba(255,255,255,0.4); }

/* Light mode topbar */
body.light-mode .topbar { background: #fff; color: #1a1a2e; border-bottom: 1px solid #e2e8f0; }
body.light-mode .topbar .search-box { background: #f5f7fa; color: #1a1a2e; }
body.light-mode .topbar .search-box::placeholder { color: #a0aec0; }
body.light-mode .topbar select { background: #f5f7fa; color: #1a1a2e; }
body.light-mode .topbar select option { background: #fff; color: #1a1a2e; }
body.light-mode .topbar .result-count { color: #3182ce; }
body.light-mode .topbar-filter-btn { background: #f5f7fa; color: #4a5568; }
body.light-mode .mobile-filter-dropdown { background: #fff; border-top-color: #e2e8f0; }
body.light-mode .mobile-filter-dropdown select { background: #f5f7fa; color: #1a1a2e; }

/* Mobile filter dropdown */
body:not(.light-mode) .mobile-filter-dropdown { background: #1a1a2e; }

/* Sidebar */
body:not(.light-mode) .sidebar { background: #16162e; border-right-color: #2a2a4a; }
body:not(.light-mode) .sidebar-header { border-bottom-color: #2a2a4a; }
body:not(.light-mode) .sidebar-close { color: #718096; }
body:not(.light-mode) .sidebar-close:hover { background: #2a2a4a; color: #e2e8f0; }
body:not(.light-mode) .sidebar-open-btn { background: #1e1e3a; border-color: #2a2a4a; color: #a0aec0; }

/* List items */
body:not(.light-mode) .list-item { border-bottom-color: #2a2a4a; }
body:not(.light-mode) .list-item:hover { background: rgba(49,130,206,0.1); }
body:not(.light-mode) .list-item.active { background: rgba(49,130,206,0.2); }
body:not(.light-mode) .list-item-name { color: #e2e8f0; }
body:not(.light-mode) .list-item-detail { color: #718096; }
body:not(.light-mode) .distance-badge { color: #63b3ed; }
body:not(.light-mode) .badge-assoc { background: rgba(49,130,206,0.15); color: #63b3ed; }
body:not(.light-mode) .badge-centro { background: rgba(56,161,105,0.15); color: #68d391; }
body:not(.light-mode) .badge-misericordia { background: rgba(128,90,213,0.15); color: #b794f4; }
body:not(.light-mode) .badge-fundacao { background: rgba(214,158,46,0.15); color: #f6e05e; }
body:not(.light-mode) .badge-religioso { background: rgba(229,62,62,0.15); color: #fc8181; }
body:not(.light-mode) .badge-other { background: rgba(255,255,255,0.06); color: #a0aec0; }
body:not(.light-mode) .badge-accuracy { background: rgba(255,255,255,0.06); color: #718096; }
body:not(.light-mode) .load-more { background: #1e1e3a; color: #a0aec0; }
body:not(.light-mode) .load-more:hover { background: #2a2a4a; }
body:not(.light-mode) .list-empty { color: #718096; }
body:not(.light-mode) .sort-info { color: #718096; }

/* Detail panel */
body:not(.light-mode) .detail-panel { background: #16162e; box-shadow: -4px 0 20px rgba(0,0,0,0.4); }
body:not(.light-mode) .detail-close { background: #1e1e3a; border-color: #2a2a4a; color: #a0aec0; }
body:not(.light-mode) .detail-close:hover { background: #2a2a4a; color: #e2e8f0; }
body:not(.light-mode) .detail-basic h3 { color: #e2e8f0; }
body:not(.light-mode) .detail-basic p { color: #a0aec0; }
body:not(.light-mode) .detail-basic .detail-meta { color: #718096; }
body:not(.light-mode) .detail-basic .detail-links a { background: rgba(49,130,206,0.15); color: #63b3ed; }
body:not(.light-mode) .detail-basic .detail-links a:hover { background: rgba(49,130,206,0.25); }
body:not(.light-mode) .detail-cs { border-top-color: #2a2a4a; }
body:not(.light-mode) .cs-capacity { background: rgba(49,130,206,0.15); color: #63b3ed; }
body:not(.light-mode) .cs-service { color: #a0aec0; border-bottom-color: #1e1e3a; }
body:not(.light-mode) .cs-service-cap { color: #63b3ed; }
body:not(.light-mode) .detail-places { border-top-color: #2a2a4a; }
body:not(.light-mode) .detail-places-title { color: #718096; }
body:not(.light-mode) .places-loading { color: #718096; }
body:not(.light-mode) .places-empty { color: #718096; }
body:not(.light-mode) .places-addr { color: #a0aec0; }
body:not(.light-mode) .places-phone a { color: #63b3ed; }
body:not(.light-mode) .places-hours { color: #718096; }
body:not(.light-mode) .places-hours summary { color: #a0aec0; }
body:not(.light-mode) .places-links a { background: rgba(49,130,206,0.15); color: #63b3ed; }
body:not(.light-mode) .places-links a:hover { background: rgba(49,130,206,0.25); }

/* Mobile tabs */
body:not(.light-mode) .mobile-tabs { background: #1a1a2e; border-top-color: #2a2a4a; }
body:not(.light-mode) .mobile-tabs button { color: #718096; }
body:not(.light-mode) .mobile-tabs button.active { color: #63b3ed; border-top-color: #63b3ed; }

/* Map FAB */
body:not(.light-mode) .map-locate-fab { background: #1e1e3a; color: #63b3ed; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
body:not(.light-mode) .map-locate-fab:hover { background: #2a2a4a; }
body:not(.light-mode) .map-locate-fab.active { background: #38a169; color: #fff; }

/* Modals */
body:not(.light-mode) .modal { background: #1e1e3a; }
body:not(.light-mode) .modal h2 { color: #e2e8f0; }
body:not(.light-mode) .modal h3 { color: #e2e8f0; }
body:not(.light-mode) .modal p, body:not(.light-mode) .modal li { color: #a0aec0; }
body:not(.light-mode) .modal-close { color: #718096; }
body:not(.light-mode) .modal-close:hover { color: #e2e8f0; }
body:not(.light-mode) .modal a { color: #63b3ed; }
body:not(.light-mode) .suggestion-form input,
body:not(.light-mode) .suggestion-form textarea {
    background: #16162e; border-color: #2a2a4a; color: #e2e8f0;
}
body:not(.light-mode) .suggestion-form input:focus,
body:not(.light-mode) .suggestion-form textarea:focus { border-color: #667eea; }

/* Toast */
body:not(.light-mode) .toast { background: #38a169; }

/* Top bar */
.topbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    z-index: 1000;
}
.topbar h1 {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}
.topbar-title-short { display: none; }
.topbar-title-full { display: inline; }
.topbar .search-box {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.12);
    color: #fff;
    outline: none;
}
.topbar .search-concelho { flex: 0 1 160px; min-width: 100px; }
.topbar .search-box::placeholder { color: rgba(255,255,255,0.5); }
.topbar .search-box:focus { background: rgba(255,255,255,0.2); }
.topbar select {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.12);
    color: #fff;
    outline: none;
    cursor: pointer;
    max-width: 150px;
}
.topbar select option { color: #1a1a2e; background: #fff; }
.topbar .result-count {
    font-size: 0.8rem;
    color: #63b3ed;
    white-space: nowrap;
}

/* Mobile filter toggle button */
.topbar-filter-btn {
    display: none;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Mobile filter dropdown */
.mobile-filter-dropdown {
    display: none;
    background: #1a1a2e;
    padding: 0.5rem 1rem 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.mobile-filter-dropdown.open {
    display: flex;
}
.mobile-filter-dropdown select {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.12);
    color: #fff;
    outline: none;
    cursor: pointer;
    flex: 1;
    min-width: 140px;
}
.mobile-filter-dropdown select option { color: #1a1a2e; background: #fff; }

/* Main layout */
.main {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    transition: width 0.2s, opacity 0.2s;
}
.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}
.sidebar-header {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.sidebar-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: #718096;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.sidebar-close:hover { background: #edf2f7; color: #2d3748; }
.sidebar-open-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 500;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #2d3748;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: none;
}
.sidebar-open-btn:hover { background: #edf2f7; }

/* Mobile tabs */
.mobile-tabs {
    display: none;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
.mobile-tabs button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a0aec0;
    cursor: pointer;
}
.mobile-tabs button.active {
    color: #3182ce;
    border-top: 2px solid #3182ce;
}

@media (max-width: 768px) {
    .topbar { flex-wrap: nowrap; padding: 0.5rem; gap: 0.4rem; }
    .topbar h1 { font-size: 0.95rem; }
    .topbar-title-full { display: none !important; }
    .topbar-title-short { display: inline !important; }
    .topbar select { display: none; }
    .topbar .search-concelho { display: none; }
    .topbar-filter-btn { display: flex; align-items: center; justify-content: center; }
    .main { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: none;
        flex: 1;
        min-height: 0;
    }
    #map { flex: 1; min-height: 0; width: 100%; }
    .sidebar-close { display: none; }
    .mobile-tabs { display: flex; }
    .mobile-tabs button[data-view="filters"] { display: none; }
    .main.view-map .sidebar { display: none; }
    .main.view-map #map { display: block; }
    .main.view-list .sidebar { display: flex; }
    .main.view-list #map { display: none; }
    .main.view-filters .sidebar { display: none; }
    .main.view-filters #map { display: none; }

    /* Detail panel as bottom sheet on mobile */
    .detail-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60vh;
        max-height: calc(100dvh - 3rem);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
        border-radius: 16px 16px 0 0;
        z-index: 2000;
        transition: transform 0.3s ease;
        transform: translateY(0);
        overflow-x: hidden;
    }
    .detail-panel.hidden {
        transform: translateY(100%) !important;
    }
}

.btn {
    padding: 0.45rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-locate {
    background: #3182ce;
    color: #fff;
}
.btn-locate:hover { background: #2c5282; }
.btn-locate.active {
    background: #38a169;
}
.btn-locate.loading {
    background: #ecc94b;
    color: #1a1a2e;
}
.radius-select {
    padding: 0.45rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
    outline: none;
}
.sort-info {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-left: auto;
}

.list {
    flex: 1;
    overflow-y: auto;
}
.list-item {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.list-item:hover { background: #ebf8ff; }
.list-item.active { background: #bee3f8; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item-detail {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.15rem;
}
.list-item-badges {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}
.distance-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3182ce;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 55px;
    text-align: right;
}
.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-assoc { background: #ebf8ff; color: #2b6cb0; }
.badge-centro { background: #f0fff4; color: #276749; }
.badge-misericordia { background: #faf5ff; color: #6b46c1; }
.badge-fundacao { background: #fffbeb; color: #975a16; }
.badge-religioso { background: #fff5f5; color: #c53030; }
.badge-other { background: #f7fafc; color: #4a5568; }
.badge-accuracy {
    font-size: 0.6rem;
    padding: 0.08rem 0.35rem;
    border-radius: 3px;
    background: #edf2f7;
    color: #a0aec0;
}

.load-more {
    display: block;
    width: 100%;
    padding: 0.6rem;
    background: #edf2f7;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    color: #4a5568;
    font-weight: 600;
}
.load-more:hover { background: #e2e8f0; }

.list-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: #38a169;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.88rem;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#map {
    flex: 1;
    min-width: 0;
}

/* Marker colors */
.marker-assoc { filter: hue-rotate(200deg); }
.marker-centro { filter: hue-rotate(100deg); }
.marker-misericordia { filter: hue-rotate(270deg); }
.marker-fundacao { filter: hue-rotate(40deg); }
.marker-religioso { filter: hue-rotate(340deg); }

/* Map pins */
.ipss-pin {
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.32));
    transition: filter 0.15s;
}
.ipss-pin-selected {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
}

/* Map locate FAB */
.map-locate-fab {
    position: absolute;
    bottom: 2rem;
    right: 1rem;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #3182ce;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.map-locate-fab:hover { background: #ebf8ff; transform: scale(1.05); }
.map-locate-fab.active { background: #38a169; color: #fff; }

@media (max-width: 768px) {
    .leaflet-control-zoom { display: none; }
}

/* Custom user location marker */
.user-marker {
    background: #3182ce;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #3182ce, 0 2px 8px rgba(0,0,0,0.3);
}

/* Detail panel */
.detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.detail-panel.hidden {
    transform: translateX(100%);
    pointer-events: none;
}
.detail-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s;
}
.detail-close:hover { background: #edf2f7; color: #1a1a2e; }
#detail-content {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 1rem;
    word-break: break-word;
}
.detail-basic {
    padding-right: 2rem;
}
.detail-basic h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.detail-basic p {
    font-size: 0.82rem;
    color: #4a5568;
    margin: 0.2rem 0;
}
.detail-basic .detail-meta {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.4rem;
}
.detail-basic .detail-links {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.detail-basic .detail-links a {
    font-size: 0.8rem;
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: #ebf8ff;
    border-radius: 5px;
}
.detail-basic .detail-links a:hover { background: #bee3f8; }
.detail-cs {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}
.cs-capacity {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2b6cb0;
    background: #ebf8ff;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.cs-services {
    margin-top: 0.4rem;
}
.cs-service {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.75rem;
    color: #4a5568;
    padding: 0.18rem 0;
    border-bottom: 1px solid #f7fafc;
}
.cs-service:last-child { border-bottom: none; }
.cs-service-name { flex: 1; margin-right: 0.5rem; }
.cs-service-cap {
    font-weight: 600;
    color: #2b6cb0;
    white-space: nowrap;
    font-size: 0.72rem;
}
.cs-service-users { font-size: 0.7rem; color: #a0aec0; margin-left: 0.3rem; }
.cs-vacancy {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.3rem;
}
.cs-vacancy.has-vacancy { background: #f0fff4; color: #276749; }
.cs-vacancy.full { background: #fff5f5; color: #c53030; }
.cs-service-date { display: block; font-size: 0.68rem; color: #a0aec0; font-weight: 400; }
.detail-places {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}
.detail-places-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.places-loading {
    font-size: 0.8rem;
    color: #a0aec0;
}
.places-empty { font-style: italic; font-size: 0.8rem; color: #a0aec0; }
.places-details { }
.places-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.6rem;
}
.places-open {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #38a169;
    background: #f0fff4;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.4rem;
}
.places-closed {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e53e3e;
    background: #fff5f5;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.4rem;
}
.places-rating {
    font-size: 0.8rem;
    color: #d69e2e;
}
.places-rating small { color: #a0aec0; }
.places-addr {
    font-size: 0.78rem;
    color: #4a5568;
    margin: 0.35rem 0;
}
.places-phone { font-size: 0.78rem; margin: 0.25rem 0; }
.places-phone a { color: #3182ce; text-decoration: none; }
.places-hours {
    font-size: 0.72rem;
    color: #718096;
    margin: 0.35rem 0;
}
.places-hours summary {
    cursor: pointer;
    font-weight: 600;
    color: #4a5568;
}
.places-hours ul {
    list-style: none;
    padding: 0.2rem 0 0 0;
}
.places-hours li { padding: 0.08rem 0; }
.places-links {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.places-links a {
    font-size: 0.78rem;
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: #ebf8ff;
    border-radius: 5px;
}
.places-links a:hover { background: #bee3f8; }

/* Privacy policy modal */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 1rem; color: #1a1a2e; }
.modal h3 { font-size: 0.95rem; margin: 1.25rem 0 0.4rem; color: #1a1a2e; }
.modal p, .modal li { font-size: 0.85rem; color: #4a5568; line-height: 1.6; margin-bottom: 0.5rem; }
.modal ul { padding-left: 1.25rem; }
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.4rem; cursor: pointer;
    color: #718096;
    line-height: 1;
}
.modal-close:hover { color: #1a1a2e; }
.suggestion-form { display: flex; flex-direction: column; gap: 0.75rem; }
.suggestion-form input,
.suggestion-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.suggestion-form textarea { min-height: 120px; }
.suggestion-form input:focus,
.suggestion-form textarea:focus { outline: none; border-color: #667eea; }
.suggestion-btn {
    padding: 0.65rem 1.5rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    align-self: flex-end;
}
.suggestion-btn:hover { background: #5a6fd6; }
.suggestion-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.suggestion-status { font-size: 0.82rem; text-align: center; }
.suggestion-status.error { color: #e53e3e; }

/* Pricing modal */
.modal-wide { max-width: 680px; }
.pricing-calculator {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}
.pricing-calc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
}
.pricing-calc-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.pricing-calc-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.pricing-calc-fields label > span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
}
.pricing-calc-fields select,
.pricing-calc-fields input {
    padding: 0.5rem 0.6rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
}
.pricing-calc-fields select:focus,
.pricing-calc-fields input:focus { outline: none; border-color: #667eea; }
.pricing-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pricing-input-wrap input { flex: 1; }
.pricing-input-suffix {
    font-size: 0.8rem;
    color: #718096;
    white-space: nowrap;
}
.pricing-calc-result {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #ebf8ff;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #2b6cb0;
    font-weight: 600;
    text-align: center;
    min-height: 1.5em;
}
.pricing-calc-result:empty { display: none; }
.pricing-sections { margin-top: 1.25rem; }
.pricing-sections details {
    border-bottom: 1px solid #edf2f7;
    padding: 0.5rem 0;
}
.pricing-sections summary {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    padding: 0.3rem 0;
}
.pricing-sections details p { margin: 0.4rem 0; }
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}
.pricing-table th {
    text-align: left;
    padding: 0.35rem 0.5rem;
    background: #edf2f7;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.75rem;
}
.pricing-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #f7fafc;
    color: #4a5568;
}
.pricing-note {
    font-size: 0.75rem !important;
    color: #a0aec0 !important;
    font-style: italic;
}
.pricing-disclaimer {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #975a16;
}
.pricing-legislation {
    font-size: 0.72rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}

/* ============ HERO SECTION ============ */
body.has-query-params #hero-section { display: none !important; }
body.has-query-params #app-anchor { display: none !important; }

#hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #12122a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}
/* Rotating background gradients */
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 1s ease;
    opacity: 0;
}
.hero-bg.active { opacity: 1; }
.hero-bg-creche {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(232, 104, 54, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(255, 184, 0, 0.30) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(249, 115, 22, 0.20) 0%, transparent 60%);
}
.hero-bg-idosos {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(49, 130, 206, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(56, 161, 105, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(49, 130, 206, 0.20) 0%, transparent 60%);
}
.hero-bg-residencia {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(56, 161, 105, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(74, 222, 128, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(56, 161, 105, 0.20) 0%, transparent 60%);
}
/* Dot grid */
#hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none; z-index: 0;
}
.hero-inner {
    position: relative; z-index: 1;
    max-width: 820px; width: 100%;
    padding: 3rem 2rem 6rem;
    text-align: center;
}
.hero-logo {
    margin-bottom: 1rem;
    animation: hero-fade-up 0.55s ease both;
}
.hero-logo img {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 24px rgba(217, 131, 52, 0.35));
}
.hero-headline {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 700; line-height: 1.1;
    color: #fff; letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    animation: hero-fade-up 0.65s ease both;
    animation-delay: 0.15s;
}
.hero-headline em { font-style: italic; color: #f97316; }

/* Rotating headline */
.hero-rotate-headline {
    display: block;
    height: 1.15em;
    overflow: hidden;
    position: relative;
}
.hero-rotate-headline span {
    display: block;
    position: absolute;
    width: 100%;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s, transform 0.5s;
}
.hero-rotate-headline span.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

/* Rotating subtitle */
.hero-subtitle-rotate {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: rgba(255,255,255,0.55);
    line-height: 1.65;
    max-width: 600px;
    margin: 0 auto 2rem;
    display: grid;
    animation: hero-fade-up 0.65s ease both;
    animation-delay: 0.25s;
}
.hero-subtitle-rotate span {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}
.hero-subtitle-rotate span.active {
    opacity: 1;
    transform: translateY(0);
}

/* Action block */
.hero-action-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    animation: hero-fade-up 0.65s ease both;
    animation-delay: 0.35s;
}
.hero-action-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

/* Cards inside action block */
.hero-cards {
    display: flex; gap: 0.6rem;
    margin-bottom: 1rem;
}
.hero-card {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.35rem;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 0.85rem 1rem;
    cursor: pointer; flex: 1; min-width: 0;
    transition: all 0.25s;
    text-align: center;
}
.hero-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.hero-card.selected { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.5); }
.hero-card-icon {
    display: flex; align-items: center; justify-content: center;
    line-height: 0;
}
.hero-card-icon svg { stroke: var(--card-accent, rgba(255,255,255,0.6)); }
.hero-card:nth-child(1) { --card-accent: #fb923c; }
.hero-card:nth-child(2) { --card-accent: #60a5fa; }
.hero-card:nth-child(3) { --card-accent: #a78bfa; }
.hero-card-label {
    font-size: 0.78rem; font-weight: 600;
    color: rgba(255,255,255,0.85); line-height: 1.3;
}
.hero-card-count {
    font-size: 0.65rem; color: rgba(255,255,255,0.4); font-weight: 500;
}

/* CTAs inside action block */
.hero-ctas {
    display: flex; gap: 0.6rem;
    flex-wrap: wrap;
}
.hero-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.3rem; border-radius: 10px;
    font-size: 0.9rem; font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer; border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    text-decoration: none; white-space: nowrap;
    flex: 1; justify-content: center;
}
.hero-btn:active { transform: scale(0.97) !important; }
.hero-btn-primary {
    background: #f97316; color: #fff;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}
.hero-btn-primary:hover {
    background: #ea6c0c; transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(249, 115, 22, 0.55);
}
.hero-btn-secondary {
    background: rgba(255,255,255,0.08); color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
}
.hero-btn-secondary:hover {
    background: rgba(255,255,255,0.14); transform: translateY(-2px);
    border-color: rgba(255,255,255,0.3);
}
.hero-btn-pricing {
    background: rgba(255,255,255,0.08); color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
}
.hero-btn-pricing:hover {
    background: rgba(255,255,255,0.14); transform: translateY(-2px);
    border-color: rgba(255,255,255,0.3);
}

.hero-stats {
    font-size: 0.8rem; color: rgba(255,255,255,0.35);
    letter-spacing: 0.04em; font-weight: 500;
    animation: hero-fade-up 0.65s ease both;
    animation-delay: 0.45s;
}
.hero-stats span { color: rgba(255,255,255,0.55); font-weight: 600; }
.hero-scroll {
    position: absolute; bottom: 3rem;
    left: 0; right: 0;
    display: flex; flex-direction: column;
    align-items: center; gap: 0.4rem;
    cursor: pointer; z-index: 1;
    animation: hero-fade-up 0.65s ease both;
    animation-delay: 0.7s;
    opacity: 0.5; transition: opacity 0.2s;
    text-decoration: none;
}
.hero-scroll:hover { opacity: 0.9; }
.hero-scroll-label {
    font-size: 0.7rem; color: rgba(255,255,255,0.6);
    letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.hero-scroll-arrow {
    width: 28px; height: 28px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    animation: hero-bob 1.8s ease-in-out infinite;
}
.hero-scroll-arrow svg {
    width: 14px; height: 14px;
    stroke: rgba(255,255,255,0.6); fill: none;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
@keyframes hero-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Hero footer */
.hero-footer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    z-index: 2;
}
.hero-footer a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
}
.hero-footer a:hover { color: #fff; }
.hero-footer-links { display: flex; gap: 1.25rem; }

/* Hamburger menu button */
.hero-menu-btn {
    position: absolute;
    top: 1rem; right: 1.2rem;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    transition: background 0.2s, color 0.2s;
}
.hero-menu-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
body.light-mode .hero-menu-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.4);
}
body.light-mode .hero-menu-btn:hover { background: rgba(0,0,0,0.08); color: #1a1a2e; }

/* Menu overlay */
.hero-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0.75rem;
}
.hero-menu-overlay.open { display: flex; }
.hero-menu {
    background: #1e1e3a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 260px;
    max-width: 320px;
    position: relative;
}
.hero-menu-close {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    background: none; border: none;
    font-size: 1.4rem; cursor: pointer;
    color: rgba(255,255,255,0.5);
    line-height: 1;
}
.hero-menu-close:hover { color: #fff; }
.hero-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hero-menu-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}
.hero-menu-links a:hover { color: #fff; }
.hero-menu-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.hero-menu-theme > span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.hero-menu-theme-btn {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
}
.hero-menu-theme-btn:hover { background: rgba(255,255,255,0.15); }
.hero-menu-theme-btn .theme-icon-moon { display: none; }
body.light-mode .hero-menu-theme-btn .theme-icon-sun { display: none; }
body.light-mode .hero-menu-theme-btn .theme-icon-moon { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-menu-theme-btn .theme-icon-sun { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Light mode menu overrides */
body.light-mode .hero-menu {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}
body.light-mode .hero-menu-close { color: rgba(0,0,0,0.4); }
body.light-mode .hero-menu-close:hover { color: #1a1a2e; }
body.light-mode .hero-menu-links { border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .hero-menu-links a { color: #4a5568; }
body.light-mode .hero-menu-links a:hover { color: #1a1a2e; }
body.light-mode .hero-menu-theme > span { color: #8896a6; }
body.light-mode .hero-menu-theme-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #4a5568;
}
body.light-mode .hero-menu-theme-btn:hover { background: rgba(0,0,0,0.1); }

/* ============ LIGHT MODE ============ */
body.light-mode #hero-section { background: #f8f6f3; }
body.light-mode #hero-section::after {
    background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
}
body.light-mode .hero-bg-creche {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(232, 104, 54, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(255, 184, 0, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(249, 115, 22, 0.08) 0%, transparent 60%);
}
body.light-mode .hero-bg-idosos {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(49, 130, 206, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(56, 161, 105, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(49, 130, 206, 0.08) 0%, transparent 60%);
}
body.light-mode .hero-bg-residencia {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(56, 161, 105, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(74, 222, 128, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(56, 161, 105, 0.08) 0%, transparent 60%);
}
body.light-mode .hero-headline { color: #1a1a2e; }
body.light-mode .hero-headline em { color: #e8630a; }
body.light-mode .hero-subtitle-rotate { color: #5a6474; }
body.light-mode .hero-action-block {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .hero-action-label { color: #8896a6; }
body.light-mode .hero-card {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .hero-card:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.15);
}
body.light-mode .hero-card.selected {
    background: rgba(249,115,22,0.08);
    border-color: rgba(249,115,22,0.45);
}
body.light-mode .hero-card-label { color: #2d3748; }
body.light-mode .hero-card-count { color: #8896a6; }
body.light-mode .hero-btn-primary { background: #f97316; color: #fff; }
body.light-mode .hero-btn-secondary,
body.light-mode .hero-btn-pricing {
    background: #fff;
    color: #2d3748;
    border-color: rgba(0,0,0,0.12);
}
body.light-mode .hero-stats { color: #a0aec0; }
body.light-mode .hero-stats span { color: #4a5568; }
body.light-mode .hero-scroll-label { color: #8896a6; }
body.light-mode .hero-scroll-arrow { border-color: rgba(0,0,0,0.15); }
body.light-mode .hero-scroll-arrow svg { stroke: #8896a6; }
body.light-mode .hero-footer { color: rgba(0,0,0,0.35); }
body.light-mode .hero-footer a { color: rgba(0,0,0,0.45); }
body.light-mode .hero-footer a:hover { color: #1a1a2e; }
body.light-mode .theme-toggle {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.4);
}
body.light-mode .theme-toggle:hover {
    background: rgba(0,0,0,0.1);
    color: #1a1a2e;
}
body.light-mode .hero-rotate-headline span { color: #1a1a2e; }

@media (max-width: 768px) {
    #hero-section { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
    .hero-inner {
        padding: 3rem 1.25rem 4rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .hero-logo { margin-bottom: 1.5rem; }
    .hero-logo img { width: 120px; height: 120px; }
    .hero-headline { font-size: clamp(2.2rem, 8.5vw, 3rem); margin-bottom: 0.75rem; }
    .hero-subtitle-rotate { font-size: 1rem; margin-bottom: 2rem; }
    .hero-action-block { padding: 1.25rem; width: 100%; }
    .hero-cards { gap: 0.5rem; }
    .hero-card { padding: 0.75rem 0.6rem; }
    .hero-card-icon svg { width: 26px; height: 26px; }
    .hero-card-label { font-size: 0.72rem; }
    .hero-card-count { font-size: 0.58rem; }
    .hero-ctas { gap: 0.5rem; }
    .hero-btn { font-size: 0.85rem; padding: 0.7rem 1rem; }
    .hero-stats { font-size: 0.72rem; margin-top: 0.5rem; }
    .hero-scroll { bottom: 1rem; }
}
