.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  color: #f9f5ec;
  background:
    radial-gradient(circle at 20% 0%, rgba(242, 161, 58, 0.2), transparent 30rem),
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, #0c0b09 0%, #030303 62%, #000 100%);
  overflow: auto;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

.auth-gate__ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(242, 161, 58, 0.1), transparent 36%);
  opacity: 0.78;
}

.auth-gate__panel {
  position: relative;
  width: min(25.5rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  padding: 1.28rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.65rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(8, 8, 7, 0.76);
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(34px) saturate(190%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  isolation: isolate;
}

.auth-gate__panel::before {
  content: "";
  position: absolute;
  inset: 0.05rem;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.2), transparent 13rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
}

.auth-gate__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-gate__mark,
.auth-gate__secure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.auth-gate__mark {
  width: 2.55rem;
  height: 2.55rem;
  color: #171007;
  background: linear-gradient(180deg, #fff6dd, #f2a13a);
  box-shadow:
    0 0.8rem 1.8rem rgba(242, 161, 58, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-weight: 850;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.auth-gate__secure {
  width: 2.25rem;
  height: 2.25rem;
  color: rgba(255, 245, 222, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.auth-gate__copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.auth-gate__eyebrow {
  margin: 0;
  color: rgba(255, 222, 168, 0.78);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate__copy h1 {
  margin: 0;
  color: #fffaf1;
  font-size: clamp(1.7rem, 8vw, 2.45rem);
  line-height: 0.98;
  font-weight: 860;
  letter-spacing: 0;
}

.auth-gate__copy p:not(.auth-gate__eyebrow) {
  max-width: 20rem;
  margin: 0.25rem 0 0;
  color: rgba(249, 245, 236, 0.68);
  font-size: 1rem;
  line-height: 1.42;
}

.auth-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
}

.auth-gate__field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  color: rgba(249, 245, 236, 0.7);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate__field input {
  width: 100%;
  min-height: 3.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.05rem;
  color: #fffaf1;
  background: rgba(0, 0, 0, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 0 rgba(242, 161, 58, 0);
  font: 700 1.08rem/1.2 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  -webkit-text-size-adjust: 100%;
}

.auth-gate__field input:focus {
  border-color: rgba(242, 161, 58, 0.72);
  background: rgba(0, 0, 0, 0.62);
  box-shadow:
    0 0 0 0.24rem rgba(242, 161, 58, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-gate__submit {
  min-height: 3.55rem;
  border: 0;
  border-radius: 1.08rem;
  color: #171007;
  background: linear-gradient(180deg, #ffbd59, #f2a13a);
  box-shadow:
    0 1rem 2.2rem rgba(242, 161, 58, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font: 850 1.06rem/1 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-gate__submit:active {
  transform: translateY(1px) scale(0.992);
}

.auth-gate__submit:disabled {
  cursor: progress;
  opacity: 0.74;
  filter: saturate(0.7);
}

.auth-gate__message {
  min-height: 1.15rem;
  color: #ffb4a2;
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 768px) {
  .auth-gate {
    align-items: flex-start;
    padding: calc(4.85rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .auth-gate.is-native {
    padding-top: calc(4.2rem + env(safe-area-inset-top, 0px));
  }

  .auth-gate__panel {
    width: min(100%, 24rem);
    padding: 1.18rem;
    border-radius: 1.45rem;
  }

  .auth-gate__copy h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.45rem);
  }
}

@media (max-width: 390px) {
  .auth-gate {
    padding-left: 0.78rem;
    padding-right: 0.78rem;
  }

  .auth-gate__panel {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate__field input,
  .auth-gate__submit {
    transition: none;
  }
}
