/* ================================================================
   Staaqui — Componentes comuns
   ----------------------------------------------------------------
   Só o que é verdadeiramente partilhado entre páginas:
     - Bottom navigation
     - Toast de feedback

   Depende das variáveis :root definidas por cada página
   (--teal, --border, --text-muted, ...). As que não existem em
   todas as páginas têm fallback.

   Versão: unificada (2024) — substitui os blocos duplicados em
   home.css, perfil.css e historico.css.
   ================================================================ */

/* ──────────────────────────────────────────────
   BLOQUEIO DE SELEÇÃO E ZOOM (global)
   ----------------------------------------------------------------
   Impede selecionar/copiar texto em todo o sistema e reforça o
   bloqueio de zoom (o <meta viewport> já o faz; isto cobre o
   iOS Safari, que ignora user-scalable=no).

   Os campos de formulário ficam isentos — sem isto não se
   conseguiria escrever nem editar valores.
   ────────────────────────────────────────────── */

html {
    -webkit-text-size-adjust: 100%;
    touch-action: pan-x pan-y;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Campos de formulário: seleção permitida. */
input,
textarea,
select,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ──────────────────────────────────────────────
   BOTTOM NAV
   ────────────────────────────────────────────── */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: rgba(0, 12, 38, .97);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-top: 1px solid var(--border, rgba(255, 255, 255, .10));
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 28px rgba(0, 0, 0, .45);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted, rgba(255, 255, 255, .40));
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color .18s;
    padding: 0 18px;
}

.nav-item.active {
    color: var(--teal, #00C9B1);
}

.nav-icon {
    width: 42px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    transition: background .18s;
}

.nav-item.active .nav-icon {
    background: rgba(0, 201, 177, .14);
}

/* Ícone do nav — padrão único para todas as páginas. */
.nav-item .svg-icon {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
    opacity: .45;
    transition: filter .18s, opacity .18s;
}

.nav-item.active .svg-icon {
    filter: invert(71%) sepia(52%) saturate(500%) hue-rotate(130deg) brightness(100%) contrast(101%);
    opacity: 1;
}

/* ──────────────────────────────────────────────
   TOAST
   ────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0D2B5E;
    border: 1px solid var(--border-2, rgba(255, 255, 255, .16));
    color: #fff;
    padding: 13px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1100;
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    max-width: calc(100vw - 40px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--teal-border, rgba(0, 201, 177, .28));
}

.toast.error {
    border-color: rgba(255, 59, 59, .4);
}

.toast .icon,
.toast .svg-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 420px) {
    .toast {
        white-space: normal;
        line-height: 1.4;
    }
}