:root {
  --ink: #0f172a;
  --navy: #0f2040;
  --slate: #64748b;
  --line: #dbe2ea;
  --blue: #0b5cff;
  --blue-dark: #0846c2;
  --paper: #f4f6f8;
  --white: #ffffff;
  --error: #b42318;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input { font: inherit; }

.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
  background: var(--paper);
}

.auth-side {
  min-height: 100svh;
  padding: 30px clamp(30px, 4vw, 56px) 26px;
  background: #edf2f7;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-side-main {
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-map-frame {
  position: relative;
  width: 100%;
  height: clamp(300px, 44vh, 430px);
  overflow: hidden;
  border: 1px solid #d5dde7;
  border-radius: 9px;
  background: #e5ebf0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

#alphaMap {
  position: absolute;
  inset: 0;
  background: #e5ebf0;
}

#alphaMap.leaflet-container {
  font: inherit;
  background: #e5ebf0;
}

.auth-map-frame .leaflet-tile-pane {
  filter: saturate(.62) contrast(.96) brightness(1.03);
}

.auth-map-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid #d5dde7;
  border-radius: 4px;
  background: rgba(255, 255, 255, .94);
  color: #334155;
  font-size: 10.5px;
  font-weight: 600;
}

.auth-map-label svg { color: var(--blue); flex: none; }

.auth-map-credit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 500;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .82);
  color: #6b7787;
  font-size: 9px;
}

.map-pin {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(11, 92, 255, .45);
}

.map-pin.hub {
  width: 14px;
  height: 14px;
  border-width: 3px;
  box-shadow: 0 0 0 1px var(--blue);
}

.map-tip {
  padding: 2px 5px;
  border: 1px solid #d5dde7;
  border-radius: 3px;
  background: #fff;
  color: #334155;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.map-tip::before { display: none; }

.auth-side-note {
  margin: 15px 0 0;
  max-width: 430px;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.auth-side-foot {
  margin: 0;
  color: #8491a3;
  font-size: 11px;
}

.auth-form {
  min-height: 100svh;
  padding: 44px clamp(28px, 4vw, 64px);
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.auth-form-inner {
  width: 100%;
  max-width: 360px;
}

.auth-form-head { margin-bottom: 22px; }

.auth-meta {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.auth-brand {
  color: var(--slate);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.alpha-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.alpha-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.auth-form h2 {
  margin: 0;
  color: var(--ink);
  font-size: 29px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.auth-subtitle {
  margin: 7px 0 0;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.5;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.signup-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.signup-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  box-shadow: none;
  transition: border-color .12s, box-shadow .12s;
}

.signup-form input::placeholder { color: #9aa6b5; }

.signup-form input:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, .12);
  outline: none;
}

.signup-form input:-webkit-autofill,
.signup-form input:-webkit-autofill:hover,
.signup-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--white) inset;
  box-shadow: 0 0 0 1000px var(--white) inset;
  transition: background-color 9999s ease-out;
}

.field-hint {
  margin: -5px 0 0;
  color: #8491a3;
  font-size: 11px;
  line-height: 1.4;
}

.btn-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  padding: 11px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}

.btn-primary:hover { background: var(--blue-dark); }

.btn-primary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: .65;
  cursor: wait;
}

.form-status {
  margin: 0;
  color: var(--error);
  font-size: 12px;
  line-height: 1.5;
}

.form-status:empty { display: none; }

.fine {
  margin: 3px 0 0;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.5;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup-success {
  padding: 6px 0;
  outline: none;
}

.success-mark {
  display: block;
  margin-bottom: 16px;
  color: var(--blue);
}

.signup-success h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.signup-success p {
  margin: 0;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.55;
}

[hidden],
.hidden { display: none !important; }

@media (max-width: 900px) {
  .auth-shell {
    display: block;
    min-height: 100svh;
  }

  .auth-side { display: none; }

  .auth-form {
    min-height: 100svh;
    max-width: none;
    margin: 0;
    padding: calc(24px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    background: var(--white);
  }

  .auth-form-inner { max-width: 420px; }
  .auth-form-head { margin-bottom: 20px; }
  .auth-form h2 { font-size: 27px; }
}

@media (min-width: 600px) and (max-width: 900px) {
  .auth-form { justify-content: center; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }

  body { background: #070d17; color: #e8edf6; }

  .auth-shell { background: #070d17; }

  .auth-side {
    background: #0c1726;
    border-right-color: rgba(148, 163, 184, .16);
  }

  .auth-map-frame {
    border-color: rgba(148, 163, 184, .2);
    background: #0e1a30;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .24);
  }

  #alphaMap,
  #alphaMap.leaflet-container { background: #0e1a30; }

  .auth-map-frame .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(.68) saturate(.38) contrast(1.05);
  }

  .auth-map-label {
    background: rgba(10, 19, 34, .92);
    border-color: rgba(148, 163, 184, .24);
    color: #dbe4f3;
  }

  .auth-map-label svg { color: #7ea4ff; }

  .auth-map-credit {
    background: rgba(10, 19, 34, .86);
    color: #8fa0b8;
  }

  .map-pin {
    border-color: #0a1322;
    box-shadow: 0 0 0 1px rgba(126, 164, 255, .65);
  }

  .map-pin.hub {
    border-color: #0a1322;
    box-shadow: 0 0 0 1px #7ea4ff;
  }

  .map-tip {
    background: #111f36;
    border-color: rgba(148, 163, 184, .24);
    color: #dbe4f3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }

  .auth-side-note { color: #aeb9cf; }
  .auth-side-foot { color: #6f7f95; }
  .auth-form { background: #0a1322; }
  .auth-brand { color: #8fa0b8; }
  .alpha-label { color: #7ea4ff; }
  .auth-form h2 { color: #f2f6fd; }
  .auth-subtitle { color: #8fa0b8; }
  .signup-form label { color: #aeb9cf; }

  .signup-form input {
    background: #0e1a30;
    border-color: rgba(148, 163, 184, .2);
    color: #e8edf6;
  }

  .signup-form input::placeholder { color: #5d6b84; }

  .signup-form input:focus {
    background: #142641;
    border-color: #7ea4ff;
    box-shadow: 0 0 0 3px rgba(126, 164, 255, .15);
  }

  .signup-form input:-webkit-autofill,
  .signup-form input:-webkit-autofill:hover,
  .signup-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e8edf6;
    -webkit-box-shadow: 0 0 0 1000px #0e1a30 inset;
    box-shadow: 0 0 0 1000px #0e1a30 inset;
  }

  .field-hint { color: #8fa0b8; }
  .btn-primary { background: #2f6df6; }
  .btn-primary:hover { background: #3b7bff; }
  .form-status { color: #fca5a5; }
  .fine { color: #8fa0b8; border-top-color: rgba(148, 163, 184, .16); }
  .success-mark { color: #7ea4ff; }
  .signup-success h3 { color: #f2f6fd; }
  .signup-success p { color: #8fa0b8; }
}
