/* Public login page (map + modal) — token-driven */

body.page-public-login {
  /* Measured at runtime from the fixed navbar; fallback clears a typical simple banner. */
  --public-login-banner-height: 72px;
  padding-top: var(--public-login-banner-height);
  background: var(--app-bg, #f4f6f8);
  overflow: hidden;
}

body.page-public-login.login-fallback {
  background-image: url('/static/images/login_splash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: auto;
}

body.page-public-login:has(.public-login-shell) footer {
  display: none;
}

body.page-public-login .main-content-wrapper.public-login-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100dvh - var(--public-login-banner-height));
  max-height: calc(100dvh - var(--public-login-banner-height));
  padding-left: 0;
  padding-right: 0;
}

.public-login-shell {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

.public-map-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(75vw, 100%);
  height: 75%;
  max-height: 100%;
  min-height: 280px;
  gap: 0.65rem;
}

.public-map-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  padding: 0.15rem 0 0;
}

.public-map-toolbar .btn {
  font-weight: 600;
}

.public-map-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--card-border, var(--app-card-border));
  border-radius: var(--app-radius-md, 0.5rem);
  overflow: hidden;
  box-shadow: 0 0.35rem 1rem var(--app-shadow-soft, rgba(0, 0, 0, 0.08));
  background: var(--app-map-frame-bg, #dfe6ea);
}

#publicMapContainer {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.public-map-status {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1100;
  background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.88);
  border: 1px solid var(--card-border, var(--app-card-border));
  border-radius: 0.375rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  max-width: min(28rem, calc(100% - 1.5rem));
}

@media (max-width: 576px) {
  .public-login-shell {
    padding: 0.75rem;
  }
  .public-map-wrap {
    width: 100%;
    height: 78%;
    min-height: 240px;
  }
}

.public-login-open-btn {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.9rem;
  border-width: 2px;
  line-height: 1.25;
}

.public-login-theme-switch {
  display: flex;
  align-items: center;
  margin-right: 0.75rem;
  color: var(--app-navbar-text, #f8f9fa);
}

.public-login-theme-switch .form-check-label {
  color: inherit;
  cursor: pointer;
}

.public-login-modal .modal-dialog {
  max-width: 26rem;
}

.public-login-modal .modal-content {
  border: none;
  box-shadow: 0 1rem 2.5rem var(--app-shadow-medium, rgba(0, 0, 0, 0.28));
  background-color: var(--bs-card-bg, var(--app-dropdown-bg));
  color: var(--bs-card-color, var(--app-text));
}

.public-login-modal .modal-header {
  border-bottom: 1px solid var(--card-border, var(--app-card-border));
  padding: 1.25rem 1.5rem 1rem;
}

.public-login-modal .modal-title {
  font-size: 1.35rem;
  font-weight: 600;
}

.public-login-modal .modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.public-login-modal .form-control {
  min-height: 2.75rem;
  font-size: 1rem;
}

.public-login-modal .btn-login-submit {
  min-height: 2.85rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.login-fallback-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--public-login-banner-height));
}

.login-card {
  width: 100%;
  max-width: 400px;
}
