/* ==========================================================================
   Mobile install gate (phones outside the installed app). Everything else on
   the page is hidden, so it can't be used until Arviga Tasks is installed.
   ========================================================================== */
.pwa-gate-root { display: none; }
html.pwa-gate, html.pwa-gate body { overflow: hidden !important; height: 100%; }
html.pwa-gate body > :not(#pwa-gate) { display: none !important; }
html.pwa-gate .pwa-gate-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: left;
}
.pwa-gate-card { width: 100%; max-width: 420px; margin: auto 0; outline: none; }
.pwa-gate-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.pwa-gate-brand .brand-lockup { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.pwa-gate-brand .brand-lockup-img { display: block; height: 52px; width: auto; max-width: 240px; object-fit: contain; }
.pwa-gate-brand .brand-lockup-sub { margin-top: 3px; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: #2563eb; }
.pwa-gate-name { font-size: 1.6rem; font-weight: 800; color: #2563eb; }
.pwa-gate-title { margin: 0 0 8px; font-size: 1.45rem; font-weight: 750; line-height: 1.25; text-align: center; color: #0f172a; }
.pwa-gate-lead { margin: 0 0 22px; font-size: 0.97rem; line-height: 1.5; text-align: center; color: #475569; }

.pwa-gate-section { display: none; }
html.pwa-mode-android .pwa-gate-section[data-pwa="android"],
html.pwa-mode-ios .pwa-gate-section[data-pwa="ios"],
html.pwa-mode-inapp .pwa-gate-section[data-pwa="inapp"] { display: block; }
.pwa-only-ios-other { display: none; }
html.pwa-ios-other .pwa-only-ios-other { display: inline; }
html.pwa-ios-other p.pwa-only-ios-other { display: block; }
html.pwa-ios-other .pwa-only-safari { display: none; }

.pwa-gate-install {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  margin: 0 0 14px;
  border: 0;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.32);
}
.pwa-gate-install[hidden], .pwa-gate-installed[hidden], .js-pwa-install-steps[hidden], .pwa-gate-foot[hidden] { display: none; }
a.pwa-gate-install { text-decoration: none; }
a.pwa-gate-install:hover, a.pwa-gate-install:focus { color: #fff; }
.pwa-gate-open-hint { margin: 0 2px; text-align: center; }
.pwa-gate-install svg { width: 22px; height: 22px; }
.pwa-gate-install:active { transform: translateY(1px); background: #1d4ed8; }
.pwa-gate-or { margin: 4px 0 10px; font-size: 0.85rem; color: #64748b; text-align: center; }

.pwa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pwa-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  font-size: 0.97rem;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.pwa-step-n {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}
.pwa-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  margin: 0 2px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #2563eb;
  font-weight: 700;
  vertical-align: middle;
}
.pwa-key svg { width: 17px; height: 17px; }
.pwa-gate-note { margin: 12px 2px 0; font-size: 0.85rem; color: #64748b; }
.pwa-gate-warn {
  padding: 16px;
  border: 1px solid #fcd34d;
  border-radius: 14px;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.97rem;
  line-height: 1.55;
}
.pwa-gate-warn b:first-child { display: block; margin-bottom: 4px; color: #92400e; }
.pwa-gate-done {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.97rem;
  line-height: 1.5;
}
.pwa-gate-done[hidden] { display: none; }
.pwa-gate-foot { margin: 20px 0 0; font-size: 0.85rem; text-align: center; color: #64748b; }

/* ==========================================================================
   GPS gate (logged-in pages, users with "Require GPS"). Blocks the app until a
   position is received.
   ========================================================================== */
.gps-gate-root[hidden] { display: none !important; }
html.gps-blocked, html.gps-blocked body { overflow: hidden !important; }
html.gps-blocked body > :not(#gps-gate):not(#pwa-gate) { visibility: hidden !important; }
.gps-gate-root {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  visibility: visible;
}
.gps-gate-card { width: 100%; max-width: 460px; margin: auto 0; padding: 26px 22px 20px; border-radius: 18px; background: #fff; color: #0f172a; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35); }
.gps-gate-icon { width: 56px; height: 56px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fee2e2; color: #dc2626; }
.gps-gate-icon svg { width: 30px; height: 30px; }
.gps-gate-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 750; text-align: center; color: #0f172a; }
.gps-gate-msg { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.5; text-align: center; color: #334155; }
.gps-gate-reason { min-height: 1.2em; margin: 0 0 14px; font-size: 0.85rem; font-weight: 600; text-align: center; color: #b91c1c; }
.gps-steps { display: none; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; font-size: 0.88rem; line-height: 1.5; }
.gps-steps > b { display: block; margin-bottom: 4px; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: #64748b; }
.gps-steps ol { margin: 0; padding-left: 1.15rem; }
.gps-steps li + li { margin-top: 4px; }
html.gps-platform-android .gps-steps[data-gps="android"],
html.gps-platform-ios .gps-steps[data-gps="ios"],
html.gps-platform-desktop .gps-steps[data-gps="desktop"] { display: block; }
.gps-gate-retry { display: block; width: 100%; height: 50px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font-size: 1rem; font-weight: 700; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); }
.gps-gate-retry:active { background: #1d4ed8; }
.gps-gate-privacy { margin: 12px 0 0; font-size: 0.76rem; line-height: 1.45; text-align: center; color: #64748b; }
