/* Mobile-first centered login — self-contained (no styles.css) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html.login-html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #0a0a0a;
}

body.login-body {
  margin: 0 !important;
  width: 100% !important;
  min-height: 100% !important;
  min-height: 100dvh !important;
  min-height: -webkit-fill-available;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    20px
    max(24px, env(safe-area-inset-bottom, 0px))
    20px !important;
  background:
    radial-gradient(
      ellipse 90% 50% at 50% -5%,
      rgba(245, 166, 35, 0.18),
      transparent 55%
    ),
    #0a0a0a !important;
  color: #f2f2f2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* Center column — never full bleed */
.login-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  flex: 0 0 auto;
}

.login-card {
  width: 100%;
  max-width: 100%;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  padding: 28px 18px 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  /* no overflow:hidden — GIS "Sign in as …" button is wider than width hint */
}

/* Brand row */
.login-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  width: 100%;
}

.login-brand .brand-mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f5a623;
  color: #111;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(245, 166, 35, 0.4);
}

.login-brand .brand-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand .brand-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-brand .brand-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #8a8a8a;
}

.login-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: #fff;
}

.login-sub {
  margin: 0 0 24px;
  color: #9a9a9a;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

/* Google button host — personalized "Sign in as …" is scaled in JS if needed */
.google-btn-host {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 48px;
  overflow: hidden; /* clip only after we scale to fit */
  position: relative;
}

.google-btn-host > div {
  margin: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  width: 100%;
}

.google-btn-host iframe {
  /* transform applied by login.js when wider than host */
  will-change: transform;
}

.login-hint {
  margin: 18px 0 0;
  font-size: 0.75rem;
  color: #6b6b6b;
  text-align: center;
  line-height: 1.4;
  padding: 0 4px;
}

.login-body .form-error {
  color: #ef4444;
  font-size: 0.88rem;
  margin: 14px 0 0;
  min-height: 1.2em;
  text-align: center;
}

/* Narrow phones */
@media (max-width: 380px) {
  body.login-body {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .login-card {
    padding: 24px 16px 22px;
  }

  .login-title {
    font-size: 1.45rem;
  }
}
