:root {
  --pwa-theme: #003087;
  --pwa-theme-light: #1a4fa8;
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

@media (display-mode: standalone) {
  body.hold-transition {
    padding-top: var(--pwa-safe-top);
    padding-bottom: var(--pwa-safe-bottom);
  }

  .main-header.navbar {
    padding-top: calc(0.5rem + var(--pwa-safe-top));
  }

  .main-footer {
    padding-bottom: calc(0.75rem + var(--pwa-safe-bottom));
  }
}

.pwa-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: calc(0.55rem + var(--pwa-safe-top)) 1rem 0.55rem;
  background: #b45309;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pwa-offline-banner.is-visible {
  display: flex;
}

body.pwa-is-offline .main-header.navbar {
  margin-top: 2.5rem;
}

.pwa-offline-banner i {
  font-size: 1rem;
}

.pwa-install-banner {
  position: fixed;
  bottom: calc(1rem + var(--pwa-safe-bottom));
  right: 1rem;
  z-index: 9999;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(92vw, 320px);
  padding: 1rem;
  border-radius: 14px;
  background: #fff;
  color: #222;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 48, 135, 0.12);
}

.pwa-install-banner.is-visible {
  display: flex;
}

.pwa-install-banner strong {
  color: var(--pwa-theme);
}

.pwa-install-actions {
  display: flex;
  gap: 0.5rem;
}

.pwa-install-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-actions .pwa-install-btn {
  background: var(--pwa-theme);
  color: #fff;
}

.pwa-install-actions .pwa-dismiss-btn {
  background: #eef2fb;
  color: var(--pwa-theme);
}

@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .login-btn {
    min-height: 44px;
  }

  .input-group input,
  .form-control {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .content-wrapper {
    min-height: calc(100vh - 120px);
  }

  .login-container {
    width: 94%;
  }

  .login-card {
    flex-direction: column;
  }

  .left-panel {
    padding: 1.25rem;
  }

  .right-panel {
    padding: 2rem 1.5rem;
  }
}
