/* Sign-in and loading. Same type and palette as scep.city, which follows
   penrosetactical.com: near-black field, General Sans, mono folio, hairlines.
   Scoped custom properties so this file can sit beside the map stylesheet
   without recolouring the app. */

@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

.gate {
  --gate-bg: #0b0d0c;
  --gate-fg: #eef1ea;
  --gate-muted: #a2a89e;
  --gate-faint: #6d746a;
  --gate-accent: #a9bd8f;
  --gate-line: rgba(232, 236, 228, .14);
  --gate-warn: #e08c84;
  --gate-ok: #a9bd8f;
  --font-sans: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.gate {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--gate-bg);
  color: var(--gate-fg);
  font-family: var(--font-sans);
  font-weight: 400;
}

.gate:not(.gate--scroll) {
  overflow-x: hidden;
  overflow-y: auto;
}

.gate * { box-sizing: border-box; }

.gate .field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.gate .gate-shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 13, 12, .55) 0%, rgba(11, 13, 12, 0) 30%, rgba(11, 13, 12, 0) 70%, rgba(11, 13, 12, .6) 100%),
    linear-gradient(90deg, rgba(11, 13, 12, .88) 0%, rgba(11, 13, 12, .55) 34%, rgba(11, 13, 12, 0) 56%);
}

@media (max-width: 719px) {
  .gate .gate-shade {
    background: linear-gradient(180deg, rgba(11, 13, 12, .9) 0%, rgba(11, 13, 12, .7) 55%, rgba(11, 13, 12, .1) 78%);
  }
}

.gate-panel {
  position: relative;
  z-index: 2;
  width: min(32rem, calc(100% - 2.5rem));
  margin: 0;
  padding: clamp(2.25rem, 8vh, 5rem) 0 3rem clamp(1.25rem, 6vw, 4.5rem);
  box-sizing: border-box;
}

.gate .hud {
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gate-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin: 0 0 1.75rem;
  color: var(--gate-muted);
}

.gate .chip {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .4em .75em;
  border: 1px solid var(--gate-line);
  border-radius: .375rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gate-muted);
}

.gate .chip::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--gate-accent);
}

.gate .folio {
  display: flex;
  align-items: baseline;
  gap: .625rem;
  margin: 0 0 1rem;
  color: var(--gate-muted);
}

.gate .folio__num { color: var(--gate-accent); }
.gate .folio__sep { color: var(--gate-faint); }

.gate h1,
.gate .loading-logo {
  margin: 0 0 .75rem;
  color: var(--gate-fg);
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.025em;
}

.gate .lead {
  margin: 0 0 2rem;
  max-width: 28rem;
  color: var(--gate-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.5;
}

.gate-form label {
  display: block;
  margin: 1rem 0 .4rem;
  color: var(--gate-muted);
}

.gate-form input {
  width: 100%;
  padding: .85rem 0;
  border: 0;
  border-bottom: 1px solid var(--gate-line);
  border-radius: 0;
  background: transparent;
  color: var(--gate-fg);
  font-family: inherit;
  font-size: 1.0625rem;
}

.gate-form input:focus {
  outline: none;
  border-bottom-color: var(--gate-fg);
}

.gate-form input::placeholder { color: var(--gate-faint); }

.password-wrapper { position: relative; }

.password-wrapper input { padding-right: 4.5rem; }

.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gate-muted);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.password-toggle:hover { color: var(--gate-fg); }

.gate-form .err {
  min-height: 1.25rem;
  margin: .75rem 0 0;
  color: var(--gate-warn);
  font-size: .875rem;
}

.gate-submit {
  display: inline-flex;
  align-items: center;
  margin-top: 1.75rem;
  padding: .875rem 1.375rem;
  border: 0;
  border-radius: .375rem;
  background: var(--gate-fg);
  color: var(--gate-bg);
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 550;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.gate-submit:hover { opacity: .88; }

.gate-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin-top: 1.5rem;
}

.gate-links a {
  color: var(--gate-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}

.gate-links a:hover { color: var(--gate-fg); }

/* Loading sits in the same frame as sign-in so the wordmark does not move
   when the form hands over to the map. */
#authLoading.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  min-height: 0;
  overflow: hidden;
}

.gate .chip--live::before { animation: gate-pulse 1.4s ease-in-out infinite; }

@keyframes gate-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.gate .loading-bar {
  position: relative;
  width: min(16rem, 70%);
  height: 1px;
  margin-top: 1.75rem;
  overflow: hidden;
  background: var(--gate-line);
}

.gate .loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: var(--gate-fg);
  animation: gate-scan 1.6s var(--gate-ease, cubic-bezier(.2, .8, .3, 1)) infinite;
}

@keyframes gate-scan {
  from { left: -30%; }
  to { left: 100%; }
}

.gate--scroll { height: auto; overflow-x: hidden; overflow-y: auto; }
.gate--scroll .gate-panel {
  justify-content: flex-start;
  min-height: 100dvh;
  padding-top: clamp(2.5rem, 8vh, 4.5rem);
  padding-bottom: 3rem;
  width: min(40rem, calc(100% - 2.5rem));
}

.gate-form textarea,
.gate-form input[type="text"],
.gate-form input[type="email"] {
  width: 100%;
  font-family: inherit;
}

.gate-form textarea {
  min-height: 5.5rem;
  margin-top: .4rem;
  padding: .75rem 0;
  border: 0;
  border-bottom: 1px solid var(--gate-line);
  border-radius: 0;
  background: transparent;
  color: var(--gate-fg);
  font-size: 1.0625rem;
  line-height: 1.45;
  resize: vertical;
}

.gate-form textarea:focus {
  outline: none;
  border-bottom-color: var(--gate-fg);
}

.gate .features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .75rem;
  margin-top: .35rem;
}

.gate .feature {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--gate-line);
  color: var(--gate-fg);
  font-size: .9375rem;
  line-height: 1.35;
  cursor: pointer;
}

.gate .feature input { accent-color: var(--gate-accent); margin-top: .2rem; }

.gate .msg { min-height: 1.25rem; margin: 0 0 .5rem; font-size: .875rem; }
.gate .msg.err { color: var(--gate-warn); }
.gate .msg.ok { color: var(--gate-ok); }

.gate .hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 480px) {
  .gate .features { grid-template-columns: 1fr; }
}

@media (max-height: 760px) {
  .gate h1,
  .gate .loading-logo { font-size: 2.6rem; }
  .gate .lead { margin-bottom: 1.1rem; }
  .gate-kicker { margin-bottom: 1rem; }
  .gate-form label { margin-top: .65rem; }
  .gate-submit { margin-top: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gate .chip--live::before,
  .gate .loading-bar::after { animation: none; }
  .gate .loading-bar::after { left: 0; width: 100%; opacity: .4; }
}
