/* VARIÁVEIS DE COR E ESTILOS GERAIS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;900&display=swap');
:root {
    --purple-primary: #8A19D6;
    --purple-dark: #6900B8;
    --purple-light: #FDF9FF;
    --text-main: #6E6875;
    --text-muted: #A098A8;
    --background-color: #FFF7FD;
    --background-sidebar: #F6EAF9;
    --background-main-content: #FCF0FF;
    --border-color: #EFEAF4;
    --border-bottom: #D0C2D7;
    --poppins-font: "Poppins", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #FFF7FD; min-height: 100vh; font-family: var(--poppins-font); display: flex; flex-direction: column; }

/* POPPINS FONTS UTILS */
.poppins-regular { font-weight: 400; }
.poppins-medium { font-weight: 500; }
.poppins-semibold { font-weight: 600; }
.poppins-bold { font-weight: 700; }
.poppins-black { font-weight: 900; }
.text-purple-primary { color: var(--purple-primary); }
.text-purple-dark { color: var(--purple-dark); }
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }

/* HEADER */
.logo-link { text-decoration: none; }
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; background-color: var(--background-main-content); padding: 24px 40px; height: 70px; border-bottom: 1px solid var(--border-color); }
.topbar-left { display: flex; align-items: center; gap: 40px; }
.topbar-title { color: var(--purple-dark); font-size: 24px; }
.topbar-tabs { display: flex; gap: 24px; }
.tab-item { text-decoration: none; font-size: 14px; color: var(--text-muted); position: relative; padding: 4px 0; transition: color 0.2s ease; }
.tab-item:hover { color: var(--text-main); }
.tab-item.active { color: var(--purple-primary); }
.tab-item.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 3px; background-color: var(--purple-primary); border-radius: 2px; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.btn-confirm-donation { background-color: var(--purple-primary); color: #FFFFFF; border: none; padding: 10px 24px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: background-color 0.2s ease; }
.btn-confirm-donation:hover { background-color: var(--purple-dark); }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s ease; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* CONTAINER */
.vitrine-container { flex-grow: 1; padding: 40px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* HERO SECTION */
.hero-section { display: flex; gap: 64px; align-items: center; margin-bottom: 64px; }
.hero-content { flex: 1; }
.hero-content h1 { font-size: 36px; color: #1A1323; margin-bottom: 16px; line-height: 1.3; }
.hero-content p { font-size: 15px; color: var(--text-main); margin-bottom: 24px; line-height: 1.6; }
.hero-badges { display: flex; gap: 24px; }
.img-hero { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.badge-item { display: flex; align-items: center; gap: 8px; background-color: var(--purple-light); color: var(--purple-dark); font-size: 12px; padding: 6px 16px; border-radius: 20px; border: 1px solid #EFE0F7; letter-spacing: 0.3px; }
.hero-image { flex: 1; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.hero-image img { width: 100%; height: auto; display: block; object-fit: cover; aspect-ratio: 16/10; }

/* FAQ */
.section-title { text-align: center; font-size: 20px; color: #1A1323; margin-bottom: 32px; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 64px; }
.faq-card { background: #F6EAF9; padding: 24px; border-radius: 12px; border: 1px solid var(--border-color); }
.faq-card h4 { color: var(--purple-dark); font-size: 15px; margin-bottom: 12px; }
.faq-card p { color: var(--text-main); font-size: 13px; line-height: 1.6; }

/* METRICS */
.metrics-banner { background: linear-gradient(90deg, #EBE2F0 0%, #F6EAF9 100%); padding: 48px; border-radius: 16px; display: flex; justify-content: space-around; text-align: center; margin-bottom: 24px; }
.metric h2 { font-size: 40px; color: var(--purple-dark); margin-bottom: 4px; }
.metric p { color: var(--text-main); font-size: 13px; }

/* FOOTER */
.main-footer { background-color: #EBE2F0; padding: 32px 40px; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); margin-top: auto; }
.footer-left h4 { font-size: 16px; margin-bottom: 8px; color: var(--purple-primary); }
.footer-left p { font-size: 12px; }
.footer-right { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.footer-right a { color: var(--text-main); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-right a:hover { color: var(--purple-primary); }
.footer-right a.active { font-weight: 700; color: var(--purple-dark); text-decoration: underline; }

/* FAB */
.fab-button { position: fixed; bottom: 32px; right: 32px; width: 56px; height: 56px; border-radius: 50%; background-color: var(--purple-primary); border: none; box-shadow: 0 4px 12px rgba(138, 25, 214, 0.4); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.2s ease, opacity 0.3s; z-index: 100; opacity: 0; pointer-events: none; }
.fab-button.visible { opacity: 1; pointer-events: auto; }
.fab-button:hover { transform: scale(1.05); background-color: var(--purple-dark); }
.arrow-top { width: 30px; height: 30px; display: block; }

/* ==================== MODAL PIX - CSS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 19, 35, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* TRAVAR O SCROLL DO BODY QUANDO MODAL ABERTO */
body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px); /* evita salto de layout (opcional) */
}

/* MODAL CONTAINER - SCROLL INTERNO */
.modal-container {
    background-color: #FFFFFF;
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;          /* altura máxima */
    overflow-y: auto;          /* scroll vertical interno */
    position: relative;
    box-shadow: 0 24px 64px rgba(105, 0, 184, 0.25);
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Remove as propriedades problemáticas */
    padding-right: 0;
    scrollbar-gutter: auto;
}

/* ESTILIZAÇÃO DA BARRA DE ROLAGEM (DENTRO DO MODAL) */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: #EFEAF4;
    border-radius: 10px;
    margin-block: 8px;        /* espaço no topo/fundo */
}

.modal-container::-webkit-scrollbar-thumb {
    background: #8A19D6;
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: #6900B8;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: sticky;
    top: 16px;
    left: 100%;
    transform: translateX(-16px);
    margin-bottom: -56px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #F6EAF9;
    color: #6900B8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background-color: #EFE4F4;
    transform: translateX(-16px) rotate(90deg); 
}

.modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

.modal-header {
    text-align: center;
    padding: 40px 32px 8px;
}

.modal-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A19D6, #6900B8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon-circle svg {
    width: 28px;
    height: 28px;
    display: block;
}

.modal-header h2 {
    font-size: 24px;
    color: #1A1323;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 14px;
    color: #6E6875;
    max-width: 420px;
    margin: 0 auto;
}

.modal-body {
    display: flex;
    gap: 32px;
    padding: 24px 32px;
}

.modal-qr-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qr-wrapper {
    position: relative;
    background-color: #FFF7FD;
    border: 3px solid #EFEAF4;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.92);
    color: #6900B8;
    font-size: 18px;
    padding: 6px 14px;
    border-radius: 6px;
    letter-spacing: 2px;
    pointer-events: none;
}

.qr-wrapper img {
    width: 180px;
    height: 180px;
    display: block;
}

.qr-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #F6EAF9;
    color: #6900B8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
}

.qr-badge-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
}

.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-info-section h3 {
    font-size: 16px;
    color: #1A1323;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.copy-box {
    background-color: #FCF0FF;
    border: 1px solid #EFEAF4;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.copy-label-row {
    margin-bottom: 6px;
}

.copy-label {
    font-size: 11px;
    color: #A098A8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-value-row {
    margin-bottom: 12px;
}

.copy-value {
    font-size: 18px;
    color: #1A1323;
    word-break: break-all;
}

.btn-copy-pix {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #8A19D6;
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-copy-pix:hover {
    background-color: #6900B8;
}

.btn-copy-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.copy-feedback {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    color: #16A34A;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.copy-feedback.show {
    opacity: 1;
}

.institution-info {
    font-size: 12px;
    color: #A098A8;
    line-height: 1.6;
    padding-top: 8px;
    border-top: 1px solid #EFEAF4;
}

.institution-info strong {
    color: #6E6875;
}

.security-seal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #16A34A;
    background-color: #F0FDF4;
    padding: 10px 14px;
    border-radius: 8px;
}

.security-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.modal-footer {
    padding: 16px 32px 28px;
    text-align: center;
    border-top: 1px solid #EFEAF4;
}

.modal-footer p {
    font-size: 12px;
    color: #A098A8;
}

/* ==================== BOTÃO DOAR ITENS NO MODAL ==================== */
.modal-donate-items {
    margin: 0 32px 28px;
    text-align: center;
}

.divider-modal {
    height: 1px;
    background-color: #EFEAF4;
    margin: 0 0 20px 0;
}

.donate-items-text {
    font-size: 14px;
    color: #4D4354;
    margin-bottom: 16px;
}

.btn-donate-items {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #FFFFFF;
    color: #6900B8;
    border: 2px solid #6900B8;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-donate-items:hover {
    background-color: #F6EAF9;
    border-color: #8A19D6;
    color: #8A19D6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(138, 25, 214, 0.15);
}

.btn-donate-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 640px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
        padding: 16px 24px;
        gap: 24px;
    }

    .modal-header {
        padding: 32px 20px 8px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-container {
        max-width: 95%;
        border-radius: 16px;
    }

    .copy-value {
        font-size: 15px;
    }

    .qr-wrapper img {
        width: 140px;
        height: 140px;
    }
}

/* ==================== SEÇÃO PONTO DE COLETA NO MODAL ==================== */
.modal-collection-point {
    margin: 0 32px 20px;
    padding: 20px;
    background-color: #FDF9FF;
    border: 1px solid #EFEAF4;
    border-radius: 12px;
    text-align: center;
}

.collection-icon {
    margin-bottom: 12px;
}

.collection-icon svg {
    width: 24px;
    height: 24px;
    display: block;
    margin: 0 auto;
}

.collection-text {
    font-size: 14px;
    color: #4D4354;
    margin-bottom: 8px;
    line-height: 1.5;
}

.collection-address {
    font-size: 16px;
    color: #1A1323;
    background-color: #FFFFFF;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #D0C2D7;
}

/* ==================== SEÇÃO INSTITUCIONAL ==================== */
.institute-banner {
    display: flex;
    gap: 48px;
    align-items: center;
    background: linear-gradient(135deg, #FDF9FF 0%, #FFFFFF 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 48px;
    box-shadow: 0 4px 24px rgba(138, 25, 214, 0.04);
    position: relative;
    overflow: hidden;
}

/* Detalhe decorativo sutil no fundo */
.institute-banner::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(138, 25, 214, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.institute-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.institute-badge {
    display: inline-block;
    background-color: var(--purple-light);
    color: var(--purple-dark);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid #EFE0F7;
    letter-spacing: 0.3px;
}

.institute-content h2 {
    font-size: 32px;
    color: #1A1323;
    margin-bottom: 16px;
    line-height: 1.35;
}

.institute-content p {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 24px;
    line-height: 1.7;
    max-width: 520px;
}

.institute-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item span:first-child {
    font-size: 28px;
    color: var(--purple-primary);
    line-height: 1.1;
}

.stat-item span:last-child {
    font-size: 12px;
    color: var(--text-muted);
}

.institute-image {
    flex: 0 0 340px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(105, 0, 184, 0.1);
}

.institute-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.institute-image:hover img {
    transform: scale(1.03);
}

.institute-image-caption {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--purple-dark);
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ========== BARRA DE NAVEGAÇÃO MOBILE (BOTTOM) ========== */
.mobile-bottom-nav {
    display: none; /* oculta por padrão (desktop) */
}

.admin-login-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--purple-primary);
    font-size: 12px;
    text-decoration: none;
}

.admin-login-link:hover {
    opacity: 1;
    color: var(--purple-primary);
}

/* Responsivo da seção institucional */
@media (max-width: 768px) {
    /* Oculta navegação do topo e botão Doar do header */
    .topbar-tabs,
    .btn-confirm-donation {
        display: none;
    }

    .topbar {
        padding: 16px 20px;
        height: auto;
    }

    .topbar-title {
        font-size: 20px;
    }

    /* ===== BARRA INFERIOR MOBILE ===== */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        padding: 10px 0;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        height: 70px; /* altura fixa para cálculo */
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 13px; /* label maior */
        font-weight: 500;
        background: none;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        padding: 6px 12px;
        border-radius: 12px;
        min-width: 72px;
    }

    /* Estado ativo: fundo roxo escuro, texto branco */
    .mobile-nav-item.active {
        background-color: var(--purple-dark); /* #6900B8 */
        color: #FFFFFF;
        font-weight: 600;
    }

    /* Estado ativo temporário do botão Doar (modal aberto) */
    .mobile-doar-btn.doar-active {
        background-color: var(--purple-dark);
        color: #FFFFFF;
    }
    .mobile-doar-btn.doar-active .nav-label {
        color: #FFFFFF;
    }

    .nav-icon {
        width: 28px;
        height: 28px;
        display: block;
    }

    .nav-label {
        font-size: 13px;
        font-weight: 500;
        line-height: 1;
    }

    /* Ajustes para o conteúdo não ficar atrás da barra */
    body {
        min-height: 100vh;
        padding-bottom: 70px; /* altura da barra */
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    .vitrine-container {
        padding-bottom: 20px;
    }

    /* FAB reposicionado */
    .fab-button {
        bottom: 90px;
        bottom: calc(90px + env(safe-area-inset-bottom));
        right: 24px;
    }

    /* ===== OUTROS AJUSTES RESPONSIVOS ===== */
    .hero-section {
        flex-direction: column;
        gap: 32px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-badges {
        flex-direction: column;
        gap: 12px;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .metrics-banner {
        flex-direction: column;
        gap: 32px;
        padding: 32px;
    }

    .metric h2 {
        font-size: 32px;
    }

    .institute-banner {
        flex-direction: column-reverse;
        padding: 24px;
        gap: 24px;
    }

    .institute-image {
        flex: 0 0 auto;
        width: 100%;
        max-height: 280px;
    }

    .institute-content h2 {
        font-size: 26px;
    }

    .institute-stats {
        gap: 24px;
    }

    .main-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 24px 20px;
    }
}