/*
 * OASIS — o app instalável (1.03.181): o aviso de versão nova, a folha da
 * ponte do iPhone, o cartão dos avisos no celular e o que some quando o
 * Oasis já está instalado. Usa as cores do tema (--t-*), com reserva para as
 * telas sem tema (login, cadastro).
 */
html[data-pwa="instalado"] [data-pwa-esconder] { display: none !important; }
html:not([data-pwa="instalado"]) [data-pwa-so-instalado] { display: none !important; }
html:not([data-pwa-pode]) [data-pwa-so-pode] { display: none !important; }

.pwa-bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 42px; padding: 0 18px;
  border: 0; border-radius: 12px; font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.pwa-bt--azul { background: var(--t-cor, #1D4ED8); color: var(--t-cor-tx, #FFFFFF); }
.pwa-bt--claro { background: var(--t-sup3, #EEF1F6); color: var(--t-tx, #101828); }
.pwa-bt:focus-visible { outline: 3px solid var(--t-cor, #1D4ED8); outline-offset: 2px; }
.pwa-bt[disabled] { opacity: .6; cursor: default; }

/* ── "Nova versão do Oasis · Toque para recarregar" ── */
.pwa-versao {
  position: fixed; left: 50%; bottom: calc(var(--m-baixo, 0px) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 2147483000;
  display: flex; align-items: center; gap: 12px; width: min(380px, calc(100vw - 24px)); min-width: 0; padding: 12px 16px 12px 12px;
  border: 0; border-radius: 16px; background: #101828; color: #FFFFFF; text-align: left; font: inherit; cursor: pointer;
  box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .45); transform: translateX(-50%);
  animation: pwa-sobe .28s cubic-bezier(.2, .8, .2, 1);
}
.pwa-versao__ic { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.pwa-versao__t { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.pwa-versao__t b { font-size: 14.5px; line-height: 19px; font-weight: 800; }
.pwa-versao__t small { font-size: 13px; line-height: 17px; color: rgba(255, 255, 255, .78); }
.pwa-versao:focus-visible { outline: 3px solid #7AA2FF; outline-offset: 2px; }
.pwa-versao[disabled] .pwa-versao__ic svg { animation: pwa-gira 1s linear infinite; }
@media (min-width: 1024px) { .pwa-versao { left: 24px; bottom: 24px; transform: none; } }

/* ── A folha da ponte (iPhone instalado) ── */
.pwa-folha { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .42); animation: pwa-aparece .2s ease-out; }
.pwa-folha__caixa {
  display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 480px; min-width: 0;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0;
  background: var(--t-sup, #FFFFFF); color: var(--t-tx, #101828); text-align: center; animation: pwa-sobe .28s cubic-bezier(.2, .8, .2, 1);
}
.pwa-folha__gira { width: 34px; height: 34px; margin-bottom: 14px; border: 3px solid var(--t-sup3, #EEF1F6); border-top-color: var(--t-cor, #1D4ED8); border-radius: 50%; animation: pwa-gira .9s linear infinite; }
.pwa-folha__t { margin: 0; font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -.3px; }
.pwa-folha__p { max-width: 380px; margin: 8px 0 0; font-size: 14.5px; line-height: 21px; color: var(--t-tx2, #475467); }
.pwa-folha__cod { margin: 12px 0 0; font-size: 13.5px; line-height: 20px; color: var(--t-tx2, #475467); }
.pwa-folha__cod b { display: inline-block; margin-left: 4px; padding: 3px 9px; border-radius: 8px; background: var(--t-sup3, #EEF1F6); color: var(--t-tx, #101828); font-size: 16px; letter-spacing: 3px; }
.pwa-folha__est { min-height: 20px; margin: 10px 0 0; font-size: 13.5px; font-weight: 700; color: var(--t-cor, #1D4ED8); }
.pwa-folha__bts { display: flex; gap: 10px; width: 100%; margin-top: 16px; }
.pwa-folha__bts .pwa-bt { flex: 1 1 0; min-width: 0; height: 46px; }

/* ── O cartão dos avisos no celular ([data-pwa-push]) ── */
[data-pwa-push][hidden] { display: none !important; }
.pwa-push {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 4px 14px; margin: 0 0 14px; padding: 14px 16px;
  border: 1px solid var(--t-linha, #E9ECF2); border-radius: 16px; background: var(--t-sup, #FFFFFF); color: var(--t-tx, #101828);
}
.pwa-push__ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--t-50, #EAF0FF); color: var(--t-cor, #1D4ED8); }
.pwa-push__tx { min-width: 0; }
.pwa-push__tx b { display: block; font-size: 15px; line-height: 20px; font-weight: 800; }
.pwa-push__tx p { margin: 2px 0 0; font-size: 13.5px; line-height: 19px; color: var(--t-tx2, #475467); }
.pwa-push .pwa-bt { grid-column: 2; justify-self: start; height: 38px; margin-top: 8px; padding: 0 16px; font-size: 14px; }
[data-estado="ligado"] .pwa-push__ic { background: rgba(18, 183, 106, .12); color: #079455; }
[data-estado="negado"] .pwa-push__ic { background: rgba(240, 68, 56, .1); color: #D92D20; }

@keyframes pwa-sobe { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pwa-folha__caixa { animation-name: pwa-sobe-folha; }
@keyframes pwa-sobe-folha { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pwa-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes pwa-gira { to { transform: rotate(360deg); } }
@media (min-width: 1024px) { @keyframes pwa-sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } } }
@media (prefers-reduced-motion: reduce) {
  .pwa-versao, .pwa-folha, .pwa-folha__caixa { animation: none; }
  .pwa-folha__gira { animation-duration: 3s; }
}
