/* ── Página inicial — referência UNPIX → SAASCOM Morador ── */

:root {
    --index-wave-height: 48px;
}

.index-page .page-content {
    background: var(--bg-body);
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    border: none !important;
}

.index-content {
    min-height: 100%;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}

.index-page .page-content::before,
.index-page .page-content::after {
    display: none !important;
    content: none !important;
}

/* ── Hero azul com onda ── */
.index-hero {
    position: relative;
    z-index: 2;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) clamp(16px, 4vw, 22px) calc(var(--index-wave-height) + clamp(56px, 12vw, 72px));
    background: var(--blue-primary);
    overflow: visible;
}

.index-hero__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        #45B0F0 0%,
        #3DAAEB 30%,
        #38A4E8 55%,
        #2E96D6 80%,
        #2590CC 100%
    );
    pointer-events: none;
}

.index-hero__texture {
    position: absolute;
    inset: 0;
    background-image: url('../img/water-texture.svg');
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.55;
    pointer-events: none;
}

.index-hero__inner {
    position: relative;
    z-index: 2;
}

.index-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: var(--index-wave-height);
    line-height: 0;
    pointer-events: none;
}

.index-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

.index-wave path {
    fill: var(--bg-body);
    shape-rendering: geometricPrecision;
}

/* Topbar — status e notificações nas laterais */
.index-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(8px, 2vh, 14px);
}

.index-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
    flex-shrink: 0;
}

/* Marca central */
.index-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: clamp(18px, 4vh, 26px);
    padding: 0 clamp(8px, 3vw, 16px);
}

.index-brand__logo {
    width: clamp(88px, 26vw, 118px);
    height: clamp(88px, 26vw, 118px);
    object-fit: contain;
    margin-bottom: clamp(10px, 2.5vh, 14px);
    filter:
        drop-shadow(0 10px 22px rgba(0, 0, 0, 0.2))
        drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
}

.index-brand__name {
    margin: 0;
    color: #fff;
    font-size: clamp(22px, 6.2vw, 28px);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.1;
}

.index-brand__condo {
    margin: clamp(6px, 1.5vh, 10px) 0 0;
    max-width: 92%;
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(13px, 3.6vw, 16px);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.2px;
}

.index-notify {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.index-notify__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #EF4444;
    border: 2px solid var(--blue-primary);
}

/* Unidade — pill arredondada abaixo da marca */
.index-unit {
    text-align: center;
}

.index-unit__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 10px 18px 10px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.index-unit__value {
    color: #fff;
    font-family: 'Quicksand', var(--font);
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 600;
    letter-spacing: 0.35px;
    line-height: 1.2;
}

.index-unit__value.is-hidden {
    letter-spacing: 4px;
    font-family: var(--font);
}

.index-unit__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.95);
    font-size: 17px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.index-unit__switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    height: 38px;
    padding: 0 22px;
    border: 1.5px solid rgba(255, 255, 255, 0.78);
    border-radius: 22px;
    background: transparent;
    color: #fff;
    font-family: 'Quicksand', var(--font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.25px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.index-unit__switch:active {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Card flutuante de atalhos ── */
.index-quick-card {
    position: relative;
    z-index: 4;
    margin: calc(-1 * (var(--index-wave-height) + clamp(36px, 9vw, 52px))) clamp(14px, 4vw, 18px) clamp(20px, 4vh, 28px);
    padding: clamp(18px, 4.5vw, 24px) clamp(10px, 3vw, 14px) clamp(16px, 4vw, 20px);
    border-radius: 22px;
    background: #fff;
    box-shadow:
        0 14px 36px rgba(30, 90, 142, 0.14),
        0 4px 14px rgba(61, 170, 235, 0.1);
}

.index-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 3vw, 16px) clamp(4px, 1.5vw, 8px);
}

.index-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.8vw, 8px);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.index-quick-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(50px, 15vw, 62px);
    height: clamp(50px, 15vw, 62px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #E8F4FD 0%, var(--blue-icon-bg) 55%, #C5E3F8 100%);
    box-shadow:
        0 4px 14px var(--blue-icon-glow),
        0 2px 6px rgba(61, 170, 235, 0.18);
    transition: transform 0.15s ease;
}

.index-quick-item__icon img {
    width: clamp(34px, 11vw, 44px);
    height: clamp(34px, 11vw, 44px);
    display: block;
    object-fit: contain;
}

.index-quick-item:active .index-quick-item__icon {
    transform: scale(0.93);
}

.index-quick-item__label {
    color: var(--text-label);
    font-size: clamp(9px, 2.6vw, 11px);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    max-width: 100%;
}

/* ── Seções inferiores ── */
.index-section {
    padding: 0 clamp(14px, 4vw, 18px);
    margin-bottom: clamp(20px, 4vh, 28px);
}

.index-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.index-section__header h2 {
    margin: 0;
    color: var(--blue-title);
    font-size: clamp(14px, 3.8vw, 16px);
    font-weight: 700;
}

.index-section__link {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--blue-primary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Serviços digitais — cards horizontais estilo Dompet Digital */
.index-scroll-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.index-scroll-cards::-webkit-scrollbar {
    display: none;
}

.index-service-card {
    flex: 0 0 clamp(210px, 62vw, 250px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(30, 90, 142, 0.1);
}

.index-service-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.index-service-card__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.index-service-card__body {
    min-width: 0;
    flex: 1;
}

.index-service-card__name {
    margin: 0 0 4px;
    color: var(--text-label);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.index-service-card__link {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--blue-primary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Resumo financeiro — estilo Catatan Keuangan */
.index-finance-card {
    padding: 18px 16px 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(30, 90, 142, 0.1);
}

.index-finance-card__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.index-finance-card__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.index-finance-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 17px;
}

.index-finance-card__icon--paid {
    background: rgba(74, 222, 128, 0.2);
    color: #16A34A;
}

.index-finance-card__icon--pending {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

.index-finance-card__label {
    color: var(--text-label);
    font-size: 12px;
    font-weight: 600;
}

.index-finance-card__value {
    color: var(--blue-title);
    font-size: clamp(15px, 4.2vw, 17px);
    font-weight: 800;
}

.index-finance-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(61, 170, 235, 0.14);
}

.index-finance-card__footer-label {
    color: rgba(107, 143, 163, 0.85);
    font-size: 13px;
    font-weight: 600;
}

.index-finance-card__footer-value {
    color: #16A34A;
    font-size: clamp(15px, 4.2vw, 17px);
    font-weight: 800;
}

@media (max-height: 640px) {
    :root {
        --index-wave-height: 40px;
    }

    .index-hero {
        padding-bottom: calc(var(--index-wave-height) + 48px);
    }

    .index-quick-card {
        margin-top: calc(-1 * (var(--index-wave-height) + 32px));
        padding-top: 16px;
        padding-bottom: 14px;
    }
}

@media (max-width: 360px) {
    .index-quick-grid {
        gap: 8px 2px;
    }

    .index-quick-item__icon {
        width: 46px;
        height: 46px;
    }

    .index-quick-item__icon img {
        width: 32px;
        height: 32px;
    }
}

/* ── Seletor "Mais" (bottom sheet) ── */
.index-mais-sheet {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.index-mais-sheet.is-open {
    display: flex !important;
    pointer-events: auto;
}

.index-mais-sheet[hidden] {
    display: none !important;
    pointer-events: none;
}

.index-mais-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.index-mais-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body, #F0F7FF);
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    animation: index-mais-slide-up 0.28s ease;
}

@keyframes index-mais-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.index-mais-sheet__handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 4px;
    background: #D6EBFA;
}

.index-mais-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 4px;
}

.index-mais-sheet__title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #1E3A5F;
}

.index-mais-sheet__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #D6EBFA;
    color: #1E5A8E;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.index-mais-sheet__sub {
    margin: 0 16px 12px;
    font-size: 13px;
    color: #64748B;
}

.index-mais-sheet__list {
    overflow-y: auto;
    padding: 0 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.index-mais-sheet__empty {
    text-align: center;
    color: #64748B;
    font-size: 14px;
    padding: 20px 8px;
}

.index-mais-option {
    width: 100%;
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(30, 58, 95, 0.08);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.index-mais-option:active {
    transform: scale(0.98);
}

.index-mais-option__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: radial-gradient(circle at 35% 30%, #E8F4FD 0%, #D6EBFA 55%, #C5E3F8 100%);
    color: #2E96D6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.index-mais-option__body {
    flex: 1;
    min-width: 0;
}

.index-mais-option__title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #1E3A5F;
    margin-bottom: 2px;
}

.index-mais-option__desc {
    display: block;
    font-size: 12px;
    color: #64748B;
}

.index-mais-option__chevron {
    color: #94A3B8;
    font-size: 22px;
    flex-shrink: 0;
}

body.index-mais-open {
    overflow: hidden;
}
