/* Aparência de aplicativo nativo para o acesso do motorista (e para a tela de login):
   sem zoom, sem seleção de texto na interface, sem "puxar para atualizar", respeito às áreas seguras
   (notch e barra inferior), barra de título e abas fixas, e sem barras de rolagem visíveis. */

html.app-nativo, body.app-nativo {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;              /* sem zoom por toque duplo */
    overscroll-behavior: none;               /* sem efeito elástico nem "puxar para atualizar" */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
body.app-nativo {
    -webkit-user-select: none;
    user-select: none;                        /* a interface não é selecionável; campos de texto continuam */
    background: #edf1f7;
}
.app-nativo input, .app-nativo textarea, .app-nativo select {
    -webkit-user-select: text;
    user-select: text;
    font-size: 16px !important;               /* 16px ou mais: o iPhone não dá zoom ao focar o campo */
}
.app-nativo a, .app-nativo button, .app-nativo [role="button"], .app-nativo label { touch-action: manipulation; }
.app-nativo img { -webkit-user-drag: none; user-drag: none; }

/* Sem barras de rolagem visíveis (a rolagem por toque continua funcionando) */
.app-nativo, .app-nativo * { scrollbar-width: none; }
.app-nativo::-webkit-scrollbar, .app-nativo *::-webkit-scrollbar { display: none; width: 0; height: 0; }
html.app-nativo { scrollbar-gutter: auto !important; }

/* Estrutura do aplicativo do motorista */
.app-nativo .app-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px) 10px calc(env(safe-area-inset-left) + 16px);
    background: #0e1a33; color: #fff; min-height: 56px;
}
.app-nativo .app-bar .marca {
    width: 34px; height: 34px; border-radius: 10px; background: #2f7df6; flex: none;
    display: flex; align-items: center; justify-content: center; font-weight: 900; letter-spacing: -.05em;
}
.app-nativo .app-bar .nome { font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.app-nativo .app-bar .empresa { font-size: 12px; color: #94a3b8; line-height: 1.1; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-nativo main { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }

.app-nativo .app-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 6px calc(env(safe-area-inset-right) + 6px) calc(env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 6px);
    background: rgba(255,255,255,.96); border-top: 1px solid #e3e9f3;
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.app-nativo .app-tabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; border-radius: 14px; color: #64748b; font-size: 11px; font-weight: 700; text-decoration: none;
}
.app-nativo .app-tabs a svg { width: 24px; height: 24px; }
.app-nativo .app-tabs a.ativa { color: #2f7df6; background: rgba(47,125,246,.10); }
.app-nativo .app-tabs a:active { transform: scale(.96); }

/* Alvos de toque confortáveis */
.app-nativo main a.btn, .app-nativo main button { min-height: 44px; }

/* Tela de login: cabe exatamente na tela e nunca mostra barra de rolagem */
html.login-fixo, html.login-fixo body { height: 100%; overflow: hidden; }
html.login-fixo .login-raiz { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
html.login-fixo .login-raiz main { min-height: 0; overflow-y: auto; padding-top: max(1.25rem, env(safe-area-inset-top)); padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
@media (max-height: 700px) {
    html.login-fixo .login-raiz main { padding-top: .75rem; padding-bottom: .75rem; }
    html.login-fixo .login-raiz main h2 { font-size: 1.6rem; line-height: 1.15; }
    html.login-fixo .login-raiz main form { margin-top: 1.25rem; gap: .75rem; }
    html.login-fixo .login-raiz main .lg\:hidden { margin-bottom: 1.25rem; }
}
@media (max-height: 560px) {
    html.login-fixo .login-raiz main .lg\:hidden { display: none; }
}
