﻿/* ============================================================
   MeuPequenoGrupo — app.css (v2)
   Identidade visual jovem 2026: base clara e leve + Capri Blue
   (azul cerúleo vibrante, tendência 2026) como cor primária +
   Coral energético como accent de destaque/CTA. Toque de lima
   usado com muita moderação, só em highlights pontuais.
   Construído sobre Bootstrap 5 — mantém as classes já usadas
   nos .razor (form-control, btn-dark, bg-primary-subtle, etc.).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* --- Paleta --- */
    --mpg-primary: #1AA6DE; /* Capri Blue — cor primária, confiança + energia */
    --mpg-primary-dark: #0E84B8; /* variação escura, hover/active */
    --mpg-primary-soft: #E4F5FC; /* fundo suave para realces/badges */
    --mpg-accent: #FF6B5B; /* coral — CTAs, destaque, energia jovem */
    --mpg-accent-dark: #E8503F;
    --mpg-accent-soft: #FFE7E3;
    --mpg-pop: #C6F135; /* lima — só para micro-highlights pontuais */
    --mpg-success: #2FA66B;
    --mpg-danger: #E5484D;
    --mpg-text: #232837; /* texto principal — carvão, não navy pesado */
    --mpg-text-muted: #6B7280;
    --mpg-bg: #F7F8FB; /* fundo geral — claro e leve */
    --mpg-surface: #FFFFFF;
    --mpg-border: #E7E9F1;
    /* --- Forma --- */
    --mpg-radius-sm: 10px;
    --mpg-radius-md: 14px;
    --mpg-radius-lg: 22px;
    --mpg-radius-pill: 999px;
    --mpg-shadow-sm: 0 1px 3px rgba(35, 40, 55, 0.06);
    --mpg-shadow-md: 0 10px 26px rgba(26, 166, 222, 0.10);
    --mpg-shadow-lg: 0 24px 52px rgba(35, 40, 55, 0.16);
    /* --- Escala de fonte — fonte única de verdade, usar em vez de rem soltos --- */
    --mpg-fs-xs: 0.8rem; /* badges, legendas, uppercase labels */
    --mpg-fs-sm: 0.875rem; /* labels de form, nav mobile, itens secundários */
    --mpg-fs-base: 0.95rem; /* texto padrão, inputs, corpo */
    --mpg-fs-md: 1.05rem; /* subtítulos, brand */
    --mpg-fs-lg: 1.3rem; /* títulos de seção/página */
    /* --- Sobrescreve tokens do Bootstrap --- */
    --bs-primary: var(--mpg-primary);
    --bs-primary-rgb: 26, 166, 222;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--mpg-text);
    --bs-border-radius: var(--mpg-radius-sm);
}

/* ============================================================
   Base
   ============================================================ */

body {
    background-color: var(--mpg-bg);
    color: var(--mpg-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    color: var(--mpg-text);
    letter-spacing: -0.01em;
}

/* Assinatura visual: traço em degradê Capri→Coral sob os títulos de página */
.d-flex.align-items-center.justify-content-between.mb-4 h3 {
    position: relative;
    padding-bottom: 10px;
}

    .d-flex.align-items-center.justify-content-between.mb-4 h3::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 56px;
        height: 4px;
        border-radius: var(--mpg-radius-pill);
        background: linear-gradient(90deg, var(--mpg-primary) 0%, var(--mpg-accent) 100%);
    }

a {
    color: var(--mpg-primary-dark);
    text-decoration: none;
}

    a:hover {
        color: var(--mpg-accent);
    }

    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 2px solid var(--mpg-accent);
        outline-offset: 2px;
    }

/* ============================================================
   Cards
   ============================================================ */

.card {
    background-color: var(--mpg-surface);
    border: 1px solid var(--mpg-border);
    box-shadow: var(--mpg-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* ============================================================
   Botões
   ============================================================ */

.btn {
    border-radius: var(--mpg-radius-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-dark {
    background-color: var(--mpg-primary);
    border-color: var(--mpg-primary);
    color: #fff;
}

    .btn-dark:hover,
    .btn-dark:focus {
        background-color: var(--mpg-primary-dark);
        border-color: var(--mpg-primary-dark);
        box-shadow: 0 6px 16px rgba(26, 166, 222, 0.3);
    }

.btn-danger {
    background-color: var(--mpg-danger);
    border-color: var(--mpg-danger);
}

.btn-light.border {
    background-color: var(--mpg-surface);
    border-color: var(--mpg-border) !important;
    color: var(--mpg-text);
}

    .btn-light.border:hover {
        background-color: var(--mpg-primary-soft);
        border-color: var(--mpg-primary) !important;
        color: var(--mpg-primary-dark);
    }

/* ============================================================
   Formulários
   ============================================================ */

.form-control,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: var(--mpg-radius-sm) !important;
    border: 1px solid var(--mpg-border);
    padding: 0.55rem 0.85rem;
    font-size: var(--mpg-fs-base);
    color: var(--mpg-text);
    background-color: var(--mpg-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--mpg-accent);
        box-shadow: 0 0 0 3px rgba(255, 107, 91, 0.16);
    }

.form-select {
    background-position: right 0.85rem center;
}

.form-label {
    color: var(--mpg-text);
    font-weight: 600;
    font-size: var(--mpg-fs-sm);
    margin-bottom: 0.35rem;
}

/* ============================================================
   Tabela de listagem
   ============================================================ */

.table thead.table-light th {
    background-color: var(--mpg-bg);
    color: var(--mpg-text-muted);
    font-size: var(--mpg-fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--mpg-border);
}

.table-hover tbody tr {
    transition: background-color 0.12s ease;
}

    .table-hover tbody tr:hover {
        background-color: var(--mpg-primary-soft);
    }

.table td {
    border-color: var(--mpg-border);
    vertical-align: middle;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    font-weight: 600;
    font-size: var(--mpg-fs-xs);
    padding: 0.4em 0.75em;
    border-radius: var(--mpg-radius-pill);
}

.bg-primary-subtle {
    background-color: var(--mpg-primary-soft) !important;
}

.text-primary {
    color: var(--mpg-primary-dark) !important;
}

.bg-warning-subtle {
    background-color: var(--mpg-accent-soft) !important;
}

.text-warning {
    color: var(--mpg-accent-dark) !important;
}

.bg-success-subtle {
    background-color: rgba(47, 166, 107, 0.12) !important;
}

.text-success {
    color: var(--mpg-success) !important;
}

/* ============================================================
   Modal / overlay
   ============================================================ */

.position-fixed[style*="z-index: 99999"] > .card {
    box-shadow: var(--mpg-shadow-lg);
    border: none;
}

/* ============================================================
   Barra de rolagem
   ============================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(26, 166, 222, 0.25);
    border-radius: var(--mpg-radius-pill);
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: rgba(26, 166, 222, 0.4);
    }

/* ============================================================
   Spinners
   ============================================================ */

.spinner-border.text-primary {
    color: var(--mpg-primary) !important;
}



















/* ============================================================
   MENU LATERAL (MainLayout.razor: app-shell / app-sidebar /
   app-bottomnav) — versão clara e jovem: fundo branco, ícones
   e link ativo em Capri Blue → Coral, nada de navy escuro.
   OBS: os tamanhos de ícone (sidebar-brand i, sidebar-link i,
   bottomnav-link i) foram MOVIDOS para a seção única "SISTEMA
   DE TAMANHO DE ÍCONES", lá embaixo — não duplicar aqui de novo.
   ============================================================ */


.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--mpg-surface);
    border-right: 1px solid var(--mpg-border);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: var(--mpg-fs-md);
    color: var(--mpg-text);
    padding: 0.5rem 0.75rem 1rem;
    flex-shrink: 0;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--mpg-radius-md);
    color: var(--mpg-text-muted);
    font-weight: 600;
    font-size: var(--mpg-fs-sm);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

    .sidebar-link i {
        width: 1.3rem;
        text-align: center;
    }

    .sidebar-link:hover {
        background-color: var(--mpg-primary-soft);
        color: var(--mpg-primary-dark);
    }

    .sidebar-link.active {
        background: linear-gradient(90deg, var(--mpg-primary) 0%, #33C2E8 100%);
        color: #fff;
        box-shadow: 0 6px 16px rgba(26, 166, 222, 0.35);
    }

        .sidebar-link.active i {
            color: #fff;
        }


.sidebar-footer {
    flex-shrink: 0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--mpg-border);
}

    .sidebar-footer .btn-outline-light {
        color: var(--mpg-accent-dark);
        border-color: var(--mpg-accent-soft);
        background-color: var(--mpg-accent-soft);
        border-radius: var(--mpg-radius-md);
        font-weight: 700;
    }

        .sidebar-footer .btn-outline-light:hover {
            background-color: var(--mpg-accent);
            border-color: var(--mpg-accent);
            color: #fff;
        }



    .sidebar-footer .btn-outline-light {
        color: var(--mpg-accent-dark);
        border-color: var(--mpg-accent-soft);
        background-color: var(--mpg-accent-soft);
        border-radius: var(--mpg-radius-md);
        font-weight: 700;
    }

        .sidebar-footer .btn-outline-light:hover {
            background-color: var(--mpg-accent);
            border-color: var(--mpg-accent);
            color: #fff;
        }

.app-main {
    flex: 1;
    min-width: 0;
}

.app-content {
    min-height: 100vh;
}

/* Menu inferior (mobile) */
.app-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--mpg-surface);
    border-top: 1px solid var(--mpg-border);
    box-shadow: 0 -4px 16px rgba(35, 40, 55, 0.06);
    justify-content: space-around;
    padding: 0.5rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 1000;
}

.bottomnav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 0.15rem;
    font-size: var(--mpg-fs-xs);
    font-weight: 600;
    color: var(--mpg-text-muted);
    background: none;
    border: none;
    padding: 0.35rem 0.4rem;
    border-radius: var(--mpg-radius-md);
    text-align: center;
}

    .bottomnav-link.active {
        color: var(--mpg-primary-dark);
    }

        .bottomnav-link.active i {
            color: var(--mpg-primary);
        }

.bottomnav-button {
    color: var(--mpg-accent-dark);
}

/* ============================================================
   Responsivo
   ============================================================ */

@media (max-width: 576px) {
    .container-fluid.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .card.p-4 {
        padding: 1.25rem !important;
    }

    .app-content {
        padding-bottom: 5.5rem; /* espaço pro bottomnav fixo */
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}


/* ============================================================
   ESTILO PARA A MENSAGEM DE RECONEXÃO (padrão do Blazor)
   ============================================================ */
.components-reconnect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    z-index: 99999;
    backdrop-filter: blur(4px);
}

    .components-reconnect-modal.show {
        display: flex;
    }

    .components-reconnect-modal > div {
        background: #ffffff;
        padding: 2rem 2.5rem;
        border-radius: 20px;
        text-align: center;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        max-width: 400px;
        width: 90%;
    }

    .components-reconnect-modal .spinner {
        width: 2.5rem;
        height: 2.5rem;
        border: 4px solid rgba(26, 166, 222, 0.2);
        border-top-color: #1AA6DE;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 0 auto 1rem auto;
    }

    .components-reconnect-modal h5 {
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 0.25rem;
    }

    .components-reconnect-modal p {
        color: #64748b;
        font-size: 0.95rem;
        margin: 0;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#components-reconnect-modal #components-reconnect-show,
#components-reconnect-modal #components-reconnect-failed,
#components-reconnect-modal #components-reconnect-rejected {
    display: none;
}

#components-reconnect-modal.components-reconnect-show #components-reconnect-show {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed #components-reconnect-failed {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected #components-reconnect-rejected {
    display: block;
}

/* Classe única compartilhada — usar em QUALQUER ícone de navegação
   (bottomnav fechado e menu "Mais" expandido) pra garantir tamanho
   idêntico sempre, sem depender de dois seletores diferentes. */
.mpg-nav-icon {
    font-size: 14px !important;
    line-height: 1 !important;
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================================================
   SISTEMA DE TAMANHO DE ÍCONES — FONTE ÚNICA DE VERDADE.
   Não duplicar estas regras em nenhuma outra seção do arquivo.
   Valores abaixo já são 40% menores do que os que estavam
   valendo antes (ex.: bottomnav-link i estava em 1.5rem, virou
   0.9rem — 1.5 * 0.6 = 0.9).
   ============================================================ */

/* Ícone de navegação avulso (uso genérico) */
.icon-nav {
    font-size: 0.9rem; /* era 1.5rem */
}

/* Ícone de destaque dentro de card (dashboard, listas) */
.icon-card {
    font-size: 1.02rem; /* era 1.7rem */
}

/* Ícone "hero" — logo grande de splash, login, telas de boas-vindas */
.icon-hero {
    font-size: 2.73rem; /* era 4.55rem */
}

/* Logo do cabeçalho do menu lateral (marca "Meu Pequeno Grupo") */
.sidebar-brand i {
    font-size: 1.02rem; /* era 1.7rem */
    color: var(--mpg-primary);
}

/* Ícones do menu lateral (desktop) */
.sidebar-link i {
    font-size: 0.9rem; /* era 1.5rem */
}

/* Ícones do menu inferior (celular) */
.bottomnav-link i {
    font-size: 0.9rem; /* era 1.5rem */
    width: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   PAINEL "MAIS" (bottom nav mobile) — abre por cima do bottomnav
   quando o 5º item ("Mais") é tocado.
   ============================================================ */

.bottomnav-mais-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1001; /* acima do app-bottomnav (1000) */
}

.bottomnav-mais-painel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(4.75rem + env(safe-area-inset-bottom)); /* logo acima do bottomnav */
    background-color: var(--mpg-surface);
    border-radius: var(--mpg-radius-lg);
    box-shadow: var(--mpg-shadow-lg);
    padding: 0.5rem;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bottomnav-mais-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--mpg-radius-md);
    color: var(--mpg-text);
    font-weight: 600;
    font-size: var(--mpg-fs-base);
    background: none;
    border: none;
    text-align: left;
    width: 100%;
}

    .bottomnav-mais-item i {
        font-size: 0.78rem; /* era 1.3rem */
        width: 1.5rem;
        text-align: center;
        color: var(--mpg-primary);
    }

    .bottomnav-mais-item:active {
        background-color: var(--mpg-primary-soft);
    }

.bottomnav-mais-button i {
    transition: transform 0.15s ease;
}

.pwa-install-card {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    z-index: 99999;
    text-align: center;
    box-shadow: 0 10px 35px rgba(0,0,0,.25);
    animation: subir .4s ease;
}

@keyframes subir {

    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   ESCALA DE FONTE — mobile mais legível, desktop inalterado.
   Como o app usa rem quase em toda parte, subir o font-size da
   raiz só no mobile escala tudo proporcionalmente (~9%), sem
   precisar editar font-size em cada .razor individualmente.
   ============================================================ */
@media (max-width: 576px) {
    html {
        font-size: 17.5px; /* padrão do navegador é 16px */
    }
}
/* ============================================================
   UTILITÁRIAS DE TEXTO — para substituir os style="font-size:...
   inline repetidos nas páginas *Consulta.razor (título, tabela,
   badges). Só adiciona; não altera nada existente. Aplicar aos
   .razor depois, um arquivo por vez.
   ============================================================ */
.mpg-page-title {
    font-size: var(--mpg-fs-lg);
}

.mpg-page-subtitle {
    font-size: var(--mpg-fs-sm);
}

.mpg-table-th {
    font-size: var(--mpg-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mpg-text-muted);
}

.mpg-cell-primary {
    font-size: var(--mpg-fs-base);
}

.mpg-cell-secondary {
    font-size: var(--mpg-fs-sm);
}

.mpg-badge-sm {
    font-weight: 500;
    font-size: var(--mpg-fs-xs);
}

/* ============================================================
   Desativa o "puxar pra atualizar" nativo do navegador/Android.
   Esse gesto estava navegando pra uma página inexistente em vez
   de recarregar corretamente — mais seguro simplesmente não
   fazer nada quando o usuário desliza o dedo.
   ============================================================ */
html, body {
    overscroll-behavior-y: contain;
}
