/* =============================================================================
 * bc-signup-gate.css — 2026-04-29
 *
 * Full-screen sign-up wall. No map until signed up.
 * Navy + yellow brand. Mobile + desktop responsive.
 *
 * Z-index: 99999 — sits above everything (map, sidebar, modals, FABs).
 * Body class .bc-gate-locked hides the map underneath so there's no flash.
 * ============================================================================= */

/* ---- Pre-flash guard: hide page chrome BEFORE the gate JS boots ---- */
html.bc-gate-pre body,
html.bc-gate-pre #map,
html.bc-gate-pre #sidebar,
html.bc-gate-pre #v27Sheet,
html.bc-gate-pre #v36Thumb {
  visibility: hidden !important;
}
html.bc-gate-pre {
  background: #0a1526 !important;
}

/* ---- Gate-locked: gate is showing, hide ALL app chrome behind it ---- */
body.bc-gate-locked #map,
body.bc-gate-locked #sidebar,
body.bc-gate-locked #v27Sheet,
body.bc-gate-locked #v36Thumb,
body.bc-gate-locked .leaflet-container,
body.bc-gate-locked .v64-bottom-bar,
body.bc-gate-locked #bcCaptureFab,
body.bc-gate-locked .topbar,
body.bc-gate-locked #topbar,
body.bc-gate-locked nav,
body.bc-gate-locked header {
  display: none !important;
  visibility: hidden !important;
}

/* ---- Gate container ---- */
#bcGate {
  position: fixed;
  inset: 0;
  z-index: var(--z-auth);
  background: #0a1526;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  visibility: visible !important; /* override pre-flash */
}

/* When gate is active, lock body scroll */
body.bc-gate-locked {
  overflow: hidden !important;
}

/* When gate is removed, restore */
body:not(.bc-gate-locked) #bcGate {
  display: none !important;
}

/* ---- Gate inner card ---- */
.bc-gate-card {
  width: 100%;
  max-width: 440px;
  background: #11203b;
  border: 1px solid rgba(246, 194, 59, 0.25);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  margin: auto;
}

/* ---- Logo + heading ---- */
.bc-gate-logo {
  text-align: center;
  margin-bottom: 22px;
}
.bc-gate-logo-img {
  width: 86px;
  height: 86px;
  border-radius: 16px;
  display: inline-block;
  background: url('/app/icon-512.png') center/cover no-repeat, #0a1526;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(246,194,59,0.18);
}
.bc-gate-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #fff;
  letter-spacing: -0.3px;
}
.bc-gate-sub {
  text-align: center;
  font-size: 14px;
  color: #a9b3c6;
  margin: 0 0 22px;
  line-height: 1.4;
}

/* ---- Tabs (Sign up / Sign in) ---- */
.bc-gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 4px;
}
.bc-gate-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: #a9b3c6;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  font-family: inherit;
}
.bc-gate-tab.active {
  background: #f6c23b;
  color: #0a1526;
}

/* ---- Form ---- */
.bc-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bc-gate-form[hidden] { display: none !important; }
.bc-gate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bc-gate-field {
  display: flex;
  flex-direction: column;
}
.bc-gate-label {
  font-size: 12px;
  color: #a9b3c6;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.bc-gate-input {
  appearance: none;
  -webkit-appearance: none;
  background: #0a1526;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px; /* iOS tap target */
}
.bc-gate-input:focus {
  outline: 0;
  border-color: #f6c23b;
  box-shadow: 0 0 0 3px rgba(246,194,59,0.18);
}
.bc-gate-input::placeholder { color: #5a6986; }

/* ---- Submit button ---- */
.bc-gate-submit {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: linear-gradient(180deg, #ffd44a 0%, #f2ab1c 100%);
  color: #0a1526;
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
  min-height: 48px;
  transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
.bc-gate-submit:hover { box-shadow: 0 8px 22px rgba(246,194,59,0.35); }
.bc-gate-submit:active { transform: translateY(1px); }
.bc-gate-submit[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- Status / error / success message ---- */
.bc-gate-status {
  font-size: 13px;
  color: #ff8888;
  min-height: 18px;
  text-align: center;
  margin-top: 4px;
}
.bc-gate-status.ok { color: #7ed957; }
.bc-gate-status.info { color: #a9b3c6; }

/* ---- Helper links ---- */
.bc-gate-help {
  text-align: center;
  font-size: 13px;
  color: #a9b3c6;
  margin-top: 14px;
}
.bc-gate-help a, .bc-gate-help button {
  color: #f6c23b;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.bc-gate-foot {
  text-align: center;
  font-size: 11px;
  color: #5a6986;
  margin-top: 18px;
  line-height: 1.5;
}
.bc-gate-foot a { color: #a9b3c6; }

/* ---- Mobile tweaks ---- */
@media (max-width: 480px) {
  .bc-gate-card { padding: 24px 18px; }
  .bc-gate-row { grid-template-columns: 1fr; gap: 12px; }
  .bc-gate-title { font-size: 19px; }
}

/* ---- Show password toggle ---- */
.bc-gate-pass-wrap {
  position: relative;
}
.bc-gate-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #a9b3c6;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  min-height: 32px;
}
.bc-gate-pass-toggle:hover { color: #f6c23b; }
.bc-gate-pass-wrap .bc-gate-input { padding-right: 64px; }

/* ---- Forgot password link ---- */
.bc-gate-forgot {
  text-align: right;
  font-size: 12px;
  margin-top: -6px;
}
.bc-gate-forgot button {
  background: none;
  border: 0;
  color: #a9b3c6;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  text-decoration: underline;
}
.bc-gate-forgot button:hover { color: #f6c23b; }

/* ---- OAuth divider + buttons ---- */
.bc-gate-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: #5a6986;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.bc-gate-divider::before,
.bc-gate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.bc-gate-oauth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.bc-gate-oauth:has(.bc-gate-oauth-btn.facebook) {
  grid-template-columns: 1fr 1fr 1fr;
}
.bc-gate-oauth-btn {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  color: #1a1a1a;
  border: 0;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: background .15s ease;
}
.bc-gate-oauth-btn.apple {
  background: #000;
  color: #fff;
}
.bc-gate-oauth-btn.facebook {
  background: #1877f2;
  color: #fff;
}
.bc-gate-oauth-btn:hover { opacity: 0.9; }
.bc-gate-oauth-btn svg { flex-shrink: 0; }
@media (max-width: 380px) {
  .bc-gate-oauth,
  .bc-gate-oauth:has(.bc-gate-oauth-btn.facebook) {
    grid-template-columns: 1fr;
  }
}

/* ---- Loading spinner ---- */
.bc-gate-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(10,21,38,0.3);
  border-top-color: #0a1526;
  border-radius: 50%;
  animation: bcGateSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes bcGateSpin { to { transform: rotate(360deg); } }
